@@ -129,6 +129,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
129129 configurePathingJar(project)
130130 }
131131
132+ @CompileStatic
132133 protected void configureProfile (Project project ) {
133134 def profileConfiguration = project. configurations. create(PROFILE_CONFIGURATION )
134135
@@ -182,7 +183,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
182183
183184 buildPropertiesTask. inputs. properties(buildPropertiesContents)
184185 buildPropertiesTask. outputs. file(buildInfoFile)
185- buildPropertiesTask << {
186+ buildPropertiesTask. doLast {
186187 project. buildDir. mkdirs()
187188 ant. mkdir(dir :buildInfoFile. parentFile)
188189 ant. propertyfile(file : buildInfoFile) {
@@ -207,6 +208,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
207208 }
208209 }
209210
211+ @CompileStatic
210212 protected void registerToolingModelBuilder (Project project , ToolingModelBuilderRegistry registry ) {
211213 registry. register(new GrailsClasspathToolingModelBuilder ())
212214 }
@@ -222,11 +224,13 @@ class GrailsGradlePlugin extends GroovyPlugin {
222224 project. extensions. add(" grails" , new GrailsExtension (project))
223225 }
224226
227+ @CompileStatic
225228 protected void configureFileWatch (Project project ) {
226229 def environment = Environment . current
227230 enableFileWatch(environment, project)
228231 }
229232
233+ @CompileStatic
230234 protected String configureGrailsBuildSettings (Project project ) {
231235 System . setProperty(BuildSettings . APP_BASE_DIR , project. projectDir. absolutePath)
232236 }
@@ -306,12 +310,13 @@ class GrailsGradlePlugin extends GroovyPlugin {
306310 }
307311 }
308312
309- protected void configureForkSettings (project , grailsVersion ) {
313+ @CompileStatic
314+ protected void configureForkSettings (Project project , grailsVersion ) {
310315 boolean isJava8Compatible = JavaVersion . current(). isJava8Compatible()
311316
312317 def systemPropertyConfigurer = { String defaultGrailsEnv , JavaForkOptions task ->
313318 def map = System . properties. findAll { entry ->
314- entry. key. startsWith(" grails." )
319+ entry. key?. toString() ? . startsWith(" grails." )
315320 }
316321 for (key in map. keySet()) {
317322 def value = map. get(key)
@@ -335,13 +340,16 @@ class GrailsGradlePlugin extends GroovyPlugin {
335340 // Copy GRAILS_FORK_OPTS into the fork. Or use GRAILS_OPTS if no fork options provided
336341 // This allows run-app etc. to run using appropriate settings and allows users to provided
337342 // different FORK JVM options to the build options.
338- String opts = System . env. GRAILS_FORK_OPTS ?: System . env. GRAILS_OPTS
339- if (opts) task. jvmArgs opts. split(' ' )
343+ def envMap = System . getenv()
344+ String opts = envMap. GRAILS_FORK_OPTS ?: envMap. GRAILS_OPTS
345+ if (opts) {
346+ task. jvmArgs opts. split(' ' )
347+ }
340348 }
341349
342- def tasks = project. tasks
350+ TaskContainer tasks = project. tasks
343351
344- def grailsEnvSystemProperty = System . getProperty(Environment . KEY )
352+ String grailsEnvSystemProperty = System . getProperty(Environment . KEY )
345353 tasks. withType(Test ). each systemPropertyConfigurer. curry(grailsEnvSystemProperty ?: Environment . TEST . name)
346354 tasks. withType(JavaExec ). each systemPropertyConfigurer. curry(grailsEnvSystemProperty ?: Environment . DEVELOPMENT . name)
347355 }
@@ -477,7 +485,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
477485
478486 protected Task createNative2AsciiTask (TaskContainer taskContainer , src , dest ) {
479487 def native2asciiTask = taskContainer. create(' native2ascii' )
480- native2asciiTask << {
488+ native2asciiTask. doLast {
481489 ant. native2ascii(src : src, dest : dest,
482490 includes : " **/*.properties" , encoding : " UTF-8" )
483491 }
0 commit comments