|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.schmant.app.groovy.GroovyExecutor
public final class GroovyExecutor
Script executor for Groovy build scripts.
Constructor Summary | |
---|---|
GroovyExecutor()
|
Method Summary | |
---|---|
void |
init(NamedReadableFile scriptFile,
LauncherSettings ls,
Report r)
Initialize the script executor. |
boolean |
isClosure(Object o)
Is the object a closure that can be run? |
Object |
runClosure(Object closure,
Object... arguments)
Run the closure and return the result. |
void |
runDefaultPreparationScript(Report r)
Run the default environment preparation script. |
void |
runPreparationScript(File script,
Report r)
Run the preparation script in the file. |
Object |
runScript(Object scriptFile)
|
Object |
runWithDefaultWrapperScript()
Run the script using the default wrapper script, if any. |
void |
setBindings(Bindings bnd,
int scope)
Set the variables stored in the bindings in the specified scope. |
void |
setGlobalVariable(String name,
Object value)
Set the value of a global variable in the script. |
void |
tearDown()
Tear down the script executor when Schmant terminates. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GroovyExecutor()
Method Detail |
---|
public void init(NamedReadableFile scriptFile, LauncherSettings ls, Report r) throws IOException
ScriptExecutor
FlatteningList.registerDecorator(org.schmant.support.util.FlatteningListDecorator)
,
TaskExecutorThreadFactory.registerThreadContextInitializer(org.schmant.run.ThreadContextInitializer)
and
ClosureSupport.registerClosureRunner(org.schmant.lang.ClosureRunner)
.
init
in interface ScriptExecutor
scriptFile
- The script file that is run.ls
- The command line settings.r
- The report.
IOException
ScriptExecutor.tearDown()
public void tearDown()
ScriptExecutor
ScriptExecutor.init(NamedReadableFile, LauncherSettings, Report)
registered
with.
tearDown
in interface ScriptExecutor
public void runDefaultPreparationScript(Report r) throws IOException
ScriptExecutor
runDefaultPreparationScript
in interface ScriptExecutor
r
- A report to log to.
IOException
public void runPreparationScript(File script, Report r) throws IOException
ScriptExecutor
runPreparationScript
in interface ScriptExecutor
script
- The script file.r
- A report to log to.
IOException
public Object runWithDefaultWrapperScript() throws IOException
ScriptExecutor
runWithDefaultWrapperScript
in interface ScriptExecutor
IOException
public Object runScript(Object scriptFile) throws IOException
IOException
public void setBindings(Bindings bnd, int scope)
ScriptExecutor
setBindings
in interface ScriptExecutor
bnd
- The bindings containing a map of variables to set.scope
- The scope to set the variables in. See
ScriptContext
. For now this parameter can be
ignored and all variables set to the global scope.public void setGlobalVariable(String name, Object value)
ScriptExecutor
setGlobalVariable
in interface ScriptExecutor
name
- The name of the variable.value
- The variable value.public boolean isClosure(Object o)
ClosureRunner
isClosure
in interface ClosureRunner
o
- The object.
true
if the object is a closure.public Object runClosure(Object closure, Object... arguments) throws SchmantException
ClosureRunner
runClosure
in interface ClosureRunner
closure
- The closure to run.arguments
- Arguments to the closure.
PyObject
.
SchmantException
- On errors.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |