Skip to content

Commit

Permalink
- Make it possible to have tempDir a closure
Browse files Browse the repository at this point in the history
- Release 1.1 SNAPSHOT
  • Loading branch information
snimavat committed Mar 2, 2018
1 parent e368a11 commit 8600822
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
grailsVersion=3.3.2
gormVersion=6.1.8.RELEASE
gradleWrapperVersion=3.5
projectVersion=1.0-SNAPSHOT
projectVersion=1.1-SNAPSHOT

title=Grails View tools
projectDesc=Grails plugin to help locate views in the spring mvc context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,18 @@ class AppResourceLoader implements ResourceLoader, GrailsConfigurationAware {
return tmpFile
}

@SuppressWarnings(['NoDef'])
File getTempDir() {
File tempDir
String tmpDirPath = getResourceConfig("tempDir")
if(tmpDirPath) { tempDir = new File(tmpDirPath) }
def tmpDirPath = getResourceConfig("tempDir")
if(tmpDirPath) {
if(tmpDirPath instanceof Closure) {
tempDir = new File(tmpDirPath.call())
} else {
tempDir = new File(tmpDirPath)
}
}

else { tempDir = new File(System.getProperty('java.io.tmpdir')) }

return tempDir
Expand Down

0 comments on commit 8600822

Please sign in to comment.