This is an automated email from the ASF dual-hosted git repository.
jdaugherty pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/grails-core.git
The following commit(s) were added to refs/heads/8.0.x by this push:
new bfd17896e9 Fix task resolution in grails wrapper cli
bfd17896e9 is described below
commit bfd17896e9ee929e5ca72a609bba064b48385ea4
Author: James Daugherty <[email protected]>
AuthorDate: Mon Jul 20 11:43:28 2026 -0500
Fix task resolution in grails wrapper cli
---
.../gradle/plugin/commands/GrailsCliGradlePlugin.groovy | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git
a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/commands/GrailsCliGradlePlugin.groovy
b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/commands/GrailsCliGradlePlugin.groovy
index b1e49a1717..35feca256f 100644
---
a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/commands/GrailsCliGradlePlugin.groovy
+++
b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/commands/GrailsCliGradlePlugin.groovy
@@ -61,6 +61,13 @@ class GrailsCliGradlePlugin implements Plugin<Project> {
public static final String APPLICATION_CONTEXT_COMMAND_CLASS =
'org.apache.grails.core.cli.ApplicationCommand'
+ /**
+ * The task group the CLI command tasks are placed in. A group makes them
visible in the
+ * default {@code gradle tasks} listing (and therefore to shell
tab-completion), matching the
+ * commands offered by the interactive Grails shell.
+ */
+ public static final String GRAILS_COMMAND_GROUP = 'Grails'
+
/**
* The dependency bucket carrying CLI-only dependencies (Grails commands
and their libraries):
* compile-visible so `grails-app/commands` sources compile against the
cli-only contract, on
@@ -305,6 +312,8 @@ class GrailsCliGradlePlugin implements Plugin<Project> {
String commandName =
GrailsNameUtils.getScriptName(GrailsNameUtils.getLogicalName(ctxCommand,
'Command'))
if (!project.tasks.names.contains(taskName)) {
project.tasks.register(taskName,
ApplicationContextCommandTask).configure {
+ it.group = GRAILS_COMMAND_GROUP
+ it.description = "Runs the Grails ${commandName}
command"
it.classpath = fileCollection
it.command = commandName
it.systemProperty(Environment.KEY,
System.getProperty(Environment.KEY, Environment.DEVELOPMENT.getName()))
@@ -384,6 +393,8 @@ class GrailsCliGradlePlugin implements Plugin<Project> {
def consoleTask = tasks.register('console', JavaExec)
project.afterEvaluate {
consoleTask.configure {
+ it.group = GRAILS_COMMAND_GROUP
+ it.description = 'Runs the interactive Grails Swing console'
it.dependsOn(tasks.named('classes'),
tasks.named('findMainClass'))
// grails-console arrives through the auto-provisioned
grailsCli tier; the
// `console` configuration remains for additional console-only
dependencies
@@ -406,6 +417,8 @@ class GrailsCliGradlePlugin implements Plugin<Project> {
def shellTask = tasks.register('shell', JavaExec)
project.afterEvaluate {
shellTask.configure {
+ it.group = GRAILS_COMMAND_GROUP
+ it.description = 'Runs the interactive Grails shell'
it.dependsOn(tasks.named('classes'),
tasks.named('findMainClass'))
// grails-console arrives through the auto-provisioned
grailsCli tier; the
// `console` configuration remains for additional console-only
dependencies
@@ -430,6 +443,8 @@ class GrailsCliGradlePlugin implements Plugin<Project> {
def runTask = project.tasks.register('runScript',
ApplicationContextScriptTask)
project.afterEvaluate {
runTask.configure {
+ it.group = GRAILS_COMMAND_GROUP
+ it.description = 'Executes a Grails script'
SourceSet mainSourceSet =
SourceSets.findMainSourceSet(project)
it.classpath = mainSourceSet.runtimeClasspath +
project.configurations.getByName(GRAILS_CLI_CLASSPATH_CONFIGURATION)
it.systemProperty(Environment.KEY,
System.getProperty(Environment.KEY, Environment.DEVELOPMENT.getName()))
@@ -461,6 +476,8 @@ class GrailsCliGradlePlugin implements Plugin<Project> {
def runTask = project.tasks.register('runCommand',
ApplicationContextCommandTask)
project.afterEvaluate {
runTask.configure {
+ it.group = GRAILS_COMMAND_GROUP
+ it.description = 'Runs a Grails command against the
application context'
SourceSet mainSourceSet =
SourceSets.findMainSourceSet(project)
it.classpath = mainSourceSet.runtimeClasspath +
project.configurations.getByName(GRAILS_CLI_CLASSPATH_CONFIGURATION)
it.systemProperty(Environment.KEY,
System.getProperty(Environment.KEY, Environment.DEVELOPMENT.getName()))