@CompileStatic abstract class GroovyScriptCommand extends Script implements CommandEvents, ConsoleLogger, FileSystemInteraction, ModelBuilder, ProfileCommand, ProfileRepositoryAware, ServerInteraction, TemplateRenderer
A base class for Groovy scripts that implement commands
| Type | Name and description |
|---|---|
AntBuilder |
antAccess to Ant via AntBuilder |
ConsoleLogger |
consoleLogger |
CommandDescription |
description |
ExecutionContext |
executionContext |
ExecutionContext |
executionContext |
FileSystemInteraction |
fileSystemInteraction |
GradleInvoker |
gradleAllows invoking of Gradle commands |
java.lang.String |
grailsVersionThe version of Grails being used |
java.lang.String |
name |
Profile |
profile |
ProfileRepository |
profileRepository |
SpringInvoker |
springAllows invoking of Spring Boot's CLI |
TemplateRenderer |
templateRenderer |
java.lang.String |
userHomeThe location of the user.home directory |
| Constructor and description |
|---|
GroovyScriptCommand() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
description(java.lang.String desc, java.lang.String usage)Provides a description for the command |
|
void |
description(java.lang.String desc, Closure detail)Provides a description for the command |
|
java.lang.Object |
flag(java.lang.String name)Obtains details of the given flag if it has been set by the user |
|
java.util.List<java.lang.String> |
getArgs()
|
|
java.util.Map<java.lang.String, java.lang.Object> |
getArgsMap()
|
|
ExecutionContext |
getExecutionContext() |
|
GrailsConsole |
getGrailsConsole()
|
|
java.lang.String |
getGrailsEnv()
|
|
boolean |
handle(ExecutionContext executionContext)Implementation of the handle method that runs the script |
|
java.lang.Object |
methodMissing(java.lang.String name, java.lang.Object args)Method missing handler used to invoke other commands from a command script |
|
void |
setExecutionContext(ExecutionContext executionContext) |
| Methods inherited from class | Name |
|---|---|
class Script |
equals, evaluate, evaluate, getBinding, getClass, getMetaClass, getProperty, hashCode, invokeMethod, notify, notifyAll, print, printf, printf, println, println, run, run, setBinding, setMetaClass, setProperty, toString, wait, wait, wait |
Access to Ant via AntBuilder
Allows invoking of Gradle commands
The version of Grails being used
Allows invoking of Spring Boot's CLI
The location of the user.home directory
Provides a description for the command
desc - The descriptionusage - The usage informationProvides a description for the command
desc - The descriptionusage - The usage informationObtains details of the given flag if it has been set by the user
name - The name of the flag
Implementation of the handle method that runs the script
executionContext - The ExecutionContextMethod missing handler used to invoke other commands from a command script
name - The name of the command as a method name (for example 'run-app' would be runApp())args - The arguments to the command