jdaugherty commented on code in PR #14816:
URL: https://github.com/apache/grails-core/pull/14816#discussion_r2150189390


##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy:
##########
@@ -812,13 +830,26 @@ class GrailsGradlePlugin extends GroovyPlugin {
     @CompileDynamic
     protected void configureRunCommand(Project project) {
         if (!project.tasks.names.contains('runCommand')) {
-            project.tasks.register('runCommand', 
ApplicationContextCommandTask).configure {
-                SourceSet mainSourceSet = SourceSets.findMainSourceSet(project)
-                it.classpath = mainSourceSet.runtimeClasspath + 
project.configurations.getByName('console')
-                it.systemProperty Environment.KEY, 
System.getProperty(Environment.KEY, Environment.DEVELOPMENT.getName())
-                def argsProperty = project.findProperty('args')
-                if (argsProperty) {
-                    
it.args(CommandLineParser.translateCommandline(argsProperty))
+            def runTask = project.tasks.register('runCommand', 
ApplicationContextCommandTask)
+            project.afterEvaluate {
+                runTask.configure {
+                    SourceSet mainSourceSet = 
SourceSets.findMainSourceSet(project)
+                    it.classpath = mainSourceSet.runtimeClasspath + 
project.configurations.getByName('console')
+                    it.systemProperty Environment.KEY, 
System.getProperty(Environment.KEY, Environment.DEVELOPMENT.getName())
+
+                    List<Object> args = []
+                    def otherArgs = project.findProperty('args')
+                    if (otherArgs) {
+                        
args.addAll(CommandLineParser.translateCommandline(otherArgs as String))
+                    }
+
+                    def appClassProvider = 
GrailsGradlePlugin.getMainClassProvider(project)

Review Comment:
   See previously



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@grails.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to