GrailsScriptRunner (Grails 2.3.8)
Date: 2014-04-24

Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.groovy.grails.cli
[Java] Class GrailsScriptRunner

    java.lang.Object
      org.codehaus.groovy.grails.cli.GrailsScriptRunner

    public class GrailsScriptRunner
    extends java.lang.Object

Handles Grails command line interface for running scripts.

Authors:
  Graeme Rocher

Since:
  0.4

Field Summary
`static groovy.lang.Closure` | `DO_NOTHING_CLOSURE`

Constructor Summary
`GrailsScriptRunner()`
`GrailsScriptRunner(java.lang.String grailsHome)`
`GrailsScriptRunner(BuildSettings settings)`

Method Summary
`int` | `executeCommand(java.lang.String scriptName, java.lang.String args)`
`int` | `executeCommand(java.lang.String scriptName, java.lang.String args, java.lang.String env)`
`int` | `executeScriptWithCaching(CommandLine commandLine)`
`java.util.List` | `getAvailableScripts()` Adds all the command scripts (i.e. those whose name does *not* start with an underscore, '_') found in the given directory to the given list.
`static CommandLineParser` | `getCommandLineParser()`
`java.io.PrintStream` | `getOut()`
`protected void` | `initializeLogging()`
`void` | `initializeState()`
`static void` | `main(java.lang.String[] args)` Evaluate the arguments to get the name of the script to execute, which environment to run it in, and the arguments to pass to the script.
`void` | `setInteractive(boolean interactive)`
`void` | `setOut(java.io.PrintStream outputStream)`

Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Field Detail

### DO_NOTHING_CLOSURE

    @java.lang.SuppressWarnings("rawtypes")
    public static final groovy.lang.Closure DO_NOTHING_CLOSURE

Constructor Detail

### GrailsScriptRunner

    public GrailsScriptRunner()

### GrailsScriptRunner

    public GrailsScriptRunner(java.lang.String grailsHome)

### GrailsScriptRunner

    public GrailsScriptRunner(BuildSettings settings)

Method Detail

### executeCommand

    public int executeCommand(java.lang.String scriptName, java.lang.String args)

### executeCommand

    public int executeCommand(java.lang.String scriptName, java.lang.String args, java.lang.String env)

### executeScriptWithCaching

    public int executeScriptWithCaching(CommandLine commandLine)

### getAvailableScripts

    public java.util.List getAvailableScripts()

  Adds all the command scripts (i.e. those whose name does *not* start with an underscore, '_') found in the given directory to the given list.

### getCommandLineParser

    public static CommandLineParser getCommandLineParser()

### getOut

    public java.io.PrintStream getOut()

### initializeLogging

    protected void initializeLogging()

### initializeState

    public void initializeState()

### main

    public static void main(java.lang.String[] args)

  Evaluate the arguments to get the name of the script to execute, which environment to run it in, and the arguments to pass to the script. This also evaluates arguments of the form "-Dprop=value" and creates system properties from each one.
  Parameters:
    `args` - Command line arguments

### setInteractive

    public void setInteractive(boolean interactive)

### setOut

    public void setOut(java.io.PrintStream outputStream)

Groovy Documentation