Package: org.grails.cli.profile.commands.script

## [Groovy] Class GroovyScriptCommand

- org.grails.cli.profile.commands.script.GroovyScriptCommand

- All Implemented Interfaces and Traits:
    CommandEvents, ConsoleLogger, FileSystemInteraction, ModelBuilder, ProfileCommand, ProfileRepositoryAware, ServerInteraction, TemplateRenderer

      @groovy.transform.CompileStatic
      abstract class GroovyScriptCommand
      extends groovy.lang.Script

  A base class for Groovy scripts that implement commands

  Authors:
    Graeme Rocher
  Since:
    3.0

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `groovy.util.AntBuilder` | `ant` Access to Ant via AntBuilder
    `ConsoleLogger` | `consoleLogger`
    `CommandDescription` | `description`
    `ExecutionContext` | `executionContext`
    `FileSystemInteraction` | `fileSystemInteraction`
    `GradleInvoker` | `gradle` Allows invoking of Gradle commands
    `java.lang.String` | `grailsVersion` The version of Grails being used
    `java.lang.String` | `name`
    `Profile` | `profile`
    `ProfileRepository` | `profileRepository`
    `SpringInvoker` | `spring` Allows invoking of Spring Boot's CLI
    `TemplateRenderer` | `templateRenderer`
    `java.lang.String` | `userHome` The location of the user.home directory

  - ### Methods Summary

    Methods
    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, groovy.lang.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()` @return The arguments as a list of strings
    `` | `java.util.Map<java.lang.String, java.lang.Object>` | `getArgsMap()` @return The undeclared command line arguments
    `` | `ExecutionContext` | `getExecutionContext()`
    `` | `GrailsConsole` | `getGrailsConsole()` @return The GrailsConsole instance
    `` | `java.lang.String` | `getGrailsEnv()` @return The name of the current Grails environment
    `` | `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)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class groovy.lang.Script` | `groovy.lang.Script#getBinding(), groovy.lang.Script#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.Script#evaluate(java.lang.String), groovy.lang.Script#evaluate(java.io.File), groovy.lang.Script#setBinding(groovy.lang.Binding), groovy.lang.Script#println(), groovy.lang.Script#println(java.lang.Object), groovy.lang.Script#run(java.io.File, [Ljava.lang.String;), groovy.lang.Script#run(), groovy.lang.Script#setProperty(java.lang.String, java.lang.Object), groovy.lang.Script#getProperty(java.lang.String), groovy.lang.Script#print(java.lang.Object), groovy.lang.Script#printf(java.lang.String, java.lang.Object), groovy.lang.Script#printf(java.lang.String, [Ljava.lang.Object;), groovy.lang.Script#getMetaClass(), groovy.lang.Script#setMetaClass(groovy.lang.MetaClass), groovy.lang.Script#wait(long, int), groovy.lang.Script#wait(long), groovy.lang.Script#wait(), groovy.lang.Script#equals(java.lang.Object), groovy.lang.Script#toString(), groovy.lang.Script#hashCode(), groovy.lang.Script#getClass(), groovy.lang.Script#notify(), groovy.lang.Script#notifyAll()`
    `class groovy.lang.GroovyObjectSupport` | `groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll()`

- - ### Property Detail

    - #### groovy.util.AntBuilder ant

      Access to Ant via AntBuilder

    - #### @groovy.lang.Delegate ConsoleLogger consoleLogger

    - #### CommandDescription description

    - #### @groovy.lang.Delegate ExecutionContext executionContext

    - #### @groovy.lang.Delegate FileSystemInteraction fileSystemInteraction

    - #### GradleInvoker gradle

      Allows invoking of Gradle commands

    - #### java.lang.String grailsVersion

      The version of Grails being used

    - #### java.lang.String name

    - #### Profile profile

    - #### ProfileRepository profileRepository

    - #### SpringInvoker spring

      Allows invoking of Spring Boot's CLI

    - #### @groovy.lang.Delegate TemplateRenderer templateRenderer

    - #### java.lang.String userHome

      The location of the user.home directory

  - ### Method Detail

    - #### void description(java.lang.String desc, java.lang.String usage)

      Provides a description for the command

      Parameters:
        `desc` - The description
        `usage` - The usage information

    - #### void description(java.lang.String desc, groovy.lang.Closure detail)

      Provides a description for the command

      Parameters:
        `desc` - The description
        `usage` - The usage information

    - #### java.lang.Object flag(java.lang.String name)

      Obtains details of the given flag if it has been set by the user

      Parameters:
        `name` - The name of the flag
      Returns:
        The flag information, or null if it isn't set by the user

    - #### java.util.List<java.lang.String> getArgs()

      Returns:
        The arguments as a list of strings

    - #### java.util.Map<java.lang.String, java.lang.Object> getArgsMap()

      Returns:
        The undeclared command line arguments

    - #### ExecutionContext getExecutionContext()

    - #### GrailsConsole getGrailsConsole()

      Returns:
        The GrailsConsole instance

    - #### java.lang.String getGrailsEnv()

      Returns:
        The name of the current Grails environment

    - #### @java.lang.Override boolean handle(ExecutionContext executionContext)

      Implementation of the handle method that runs the script

      Parameters:
        `executionContext` - The ExecutionContext
      Returns:
        True if the script succeeds, false otherwise

    - #### java.lang.Object methodMissing(java.lang.String name, java.lang.Object args)

      Method missing handler used to invoke other commands from a command script

      Parameters:
        `name` - The name of the command as a method name (for example 'run-app' would be runApp())
        `args` - The arguments to the command

    - #### void setExecutionContext(ExecutionContext executionContext)