@@ -169,7 +169,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
169
169
Provider<FindMainClassTask > findMainClassTask = project. tasks. named(' findMainClass' , FindMainClassTask )
170
170
project. provider {
171
171
File cacheFile = findMainClassTask. get(). mainClassCacheFile. orNull?. asFile
172
- if (! cacheFile. exists()) {
172
+ if (! cacheFile? . exists()) {
173
173
return null
174
174
}
175
175
@@ -450,7 +450,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
450
450
project. tasks. register(taskName, ApplicationContextCommandTask ). configure {
451
451
it. classpath = fileCollection
452
452
it. command = commandName
453
- it. systemProperty Environment . KEY , System . getProperty(Environment . KEY , Environment . DEVELOPMENT . getName())
453
+ it. systemProperty( Environment . KEY , System . getProperty(Environment . KEY , Environment . DEVELOPMENT . getName() ))
454
454
List<Object > args = []
455
455
def otherArgs = project. findProperty(' args' )
456
456
if (otherArgs) {
@@ -596,7 +596,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
596
596
def consoleTask = tasks. register(' console' , JavaExec )
597
597
project. afterEvaluate {
598
598
consoleTask. configure {
599
- it. dependsOn(tasks. named(' classes' ), tasks. named(' findMainClass' , FindMainClassTask ))
599
+ it. dependsOn(tasks. named(' classes' ), tasks. named(' findMainClass' ))
600
600
it. classpath = project. sourceSets. main. runtimeClasspath + configuration. get()
601
601
it. mainClass. set(' grails.ui.console.GrailsSwingConsole' )
602
602
@@ -615,7 +615,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
615
615
def shellTask = tasks. register(' shell' , JavaExec )
616
616
project. afterEvaluate {
617
617
shellTask. configure {
618
- it. dependsOn(tasks. named(' classes' ), tasks. named(' findMainClass' , FindMainClassTask ))
618
+ it. dependsOn(tasks. named(' classes' ), tasks. named(' findMainClass' ))
619
619
it. classpath = project. sourceSets. main. runtimeClasspath + configuration. get()
620
620
it. mainClass. set(' grails.ui.shell.GrailsShell' )
621
621
it. standardInput = System . in
@@ -659,7 +659,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
659
659
project. afterEvaluate {
660
660
// Support overrides - via mainClass property
661
661
def propertyMainClassName = project. findProperty(' mainClass' )
662
- if (propertyMainClassName) {
662
+ if (propertyMainClassName) {
663
663
findMainClassTask. configure {
664
664
it. mainClassName. set(propertyMainClassName)
665
665
}
@@ -668,25 +668,25 @@ class GrailsGradlePlugin extends GroovyPlugin {
668
668
// Support overrides - via mainClass springboot extension
669
669
def springBootExtension = project. extensions. getByType(SpringBootExtension )
670
670
String springBootMainClassName = springBootExtension. mainClass. getOrNull()
671
- if (springBootMainClassName) {
671
+ if (springBootMainClassName) {
672
672
findMainClassTask. configure {
673
673
it. mainClassName. set(springBootMainClassName)
674
674
}
675
675
}
676
676
677
- if (springBootMainClassName && propertyMainClassName) {
678
- if (springBootMainClassName != propertyMainClassName) {
677
+ if (springBootMainClassName && propertyMainClassName) {
678
+ if (springBootMainClassName != propertyMainClassName) {
679
679
throw new GradleException (" If overriding the mainClass, the property 'mainClass' and the springboot.mainClass must be set to the same value" )
680
680
}
681
681
}
682
682
683
683
def extraProperties = project. extensions. getByType(ExtraPropertiesExtension )
684
684
def overriddenMainClass = propertyMainClassName ?: springBootMainClassName
685
- if (! overriddenMainClass) {
685
+ if (! overriddenMainClass) {
686
686
// the findMainClass task needs to set these values
687
687
extraProperties. set(' mainClassName' , project. provider {
688
688
File cacheFile = findMainClassTask. get(). mainClassCacheFile. orNull?. asFile
689
- if (! cacheFile. exists()) {
689
+ if (! cacheFile? . exists()) {
690
690
return null
691
691
}
692
692
@@ -695,14 +695,13 @@ class GrailsGradlePlugin extends GroovyPlugin {
695
695
696
696
springBootExtension. mainClass. set(project. provider {
697
697
File cacheFile = findMainClassTask. get(). mainClassCacheFile. orNull?. asFile
698
- if (! cacheFile. exists()) {
698
+ if (! cacheFile? . exists()) {
699
699
return null
700
700
}
701
701
702
702
cacheFile?. text
703
703
})
704
- }
705
- else {
704
+ } else {
706
705
// we need to set the overridden value on both
707
706
extraProperties. set(' mainClass' , overriddenMainClass)
708
707
springBootExtension. mainClass. set(overriddenMainClass)
@@ -809,7 +808,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
809
808
runTask. configure {
810
809
SourceSet mainSourceSet = SourceSets . findMainSourceSet(project)
811
810
it. classpath = mainSourceSet. runtimeClasspath + project. configurations. getByName(' console' )
812
- it. systemProperty Environment . KEY , System . getProperty(Environment . KEY , Environment . DEVELOPMENT . getName())
811
+ it. systemProperty( Environment . KEY , System . getProperty(Environment . KEY , Environment . DEVELOPMENT . getName() ))
813
812
List<Object > args = []
814
813
def otherArgs = project. findProperty(' args' )
815
814
if (otherArgs) {
@@ -835,7 +834,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
835
834
runTask. configure {
836
835
SourceSet mainSourceSet = SourceSets . findMainSourceSet(project)
837
836
it. classpath = mainSourceSet. runtimeClasspath + project. configurations. getByName(' console' )
838
- it. systemProperty Environment . KEY , System . getProperty(Environment . KEY , Environment . DEVELOPMENT . getName())
837
+ it. systemProperty( Environment . KEY , System . getProperty(Environment . KEY , Environment . DEVELOPMENT . getName() ))
839
838
840
839
List<Object > args = []
841
840
def otherArgs = project. findProperty(' args' )
0 commit comments