org.codehaus.groovy.grails.cli.support
Class ScriptBindingInitializer
java.lang.Object
org.codehaus.groovy.grails.cli.support.ScriptBindingInitializer
public class ScriptBindingInitializer
- extends java.lang.Object
Configures the binding used when running Grails scripts.
- Since:
- 2.0
|
Method Summary |
static BaseSettingsApi |
initBinding(groovy.lang.Binding binding,
grails.util.BuildSettings buildSettings,
java.net.URLClassLoader classLoader,
GrailsConsole grailsConsole,
boolean interactive)
|
org.codehaus.gant.GantBinding |
initBinding(org.codehaus.gant.GantBinding binding,
java.lang.String scriptName)
Prep the binding. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GRAILS_SCRIPT
public static final java.lang.String GRAILS_SCRIPT
- See Also:
- Constant Field Values
GRAILS_CONSOLE
public static final java.lang.String GRAILS_CONSOLE
- See Also:
- Constant Field Values
GRAILS_SETTINGS
public static final java.lang.String GRAILS_SETTINGS
- See Also:
- Constant Field Values
BASEDIR
public static final java.lang.String BASEDIR
- See Also:
- Constant Field Values
SCAFFOLD_DIR
public static final java.lang.String SCAFFOLD_DIR
- See Also:
- Constant Field Values
BASE_FILE
public static final java.lang.String BASE_FILE
- See Also:
- Constant Field Values
BASE_NAME
public static final java.lang.String BASE_NAME
- See Also:
- Constant Field Values
GRAILS_HOME
public static final java.lang.String GRAILS_HOME
- See Also:
- Constant Field Values
GRAILS_VERSION
public static final java.lang.String GRAILS_VERSION
- See Also:
- Constant Field Values
USER_HOME
public static final java.lang.String USER_HOME
- See Also:
- Constant Field Values
GRAILS_ENV
public static final java.lang.String GRAILS_ENV
- See Also:
- Constant Field Values
ARGS_MAP
public static final java.lang.String ARGS_MAP
- See Also:
- Constant Field Values
ScriptBindingInitializer
public ScriptBindingInitializer(CommandLine commandLine,
java.net.URLClassLoader classLoader,
grails.util.BuildSettings settings,
PluginPathDiscoverySupport pluginPathSupport,
boolean interactive)
initBinding
public org.codehaus.gant.GantBinding initBinding(org.codehaus.gant.GantBinding binding,
java.lang.String scriptName)
- Prep the binding. We add the location of GRAILS_HOME under the variable name "grailsHome". We also add a closure that should be used with "includeTargets <<" - it takes a string and returns
either a file containing the named Grails script or the script class.
So, this:
includeTargets << grailsScript("Init")
will load the "Init" script from $GRAILS_HOME/scripts if it exists there; otherwise it will load the Init class.
initBinding
public static BaseSettingsApi initBinding(groovy.lang.Binding binding,
grails.util.BuildSettings buildSettings,
java.net.URLClassLoader classLoader,
GrailsConsole grailsConsole,
boolean interactive)