|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ScriptExecutor
This interface defines something that Launcher
can use to run a build
script with. The launcher class looks up a ScriptExecutorFactory
that
it uses to create a script executor.
A script executor often registers itself with different Schmant extension
points to be able to run closures, flatten lists, etc. See
init(NamedReadableFile, LauncherSettings, Report)
.
Launcher
,
ScriptExecutorFactory
Method Summary | |
---|---|
void |
init(NamedReadableFile scriptFile,
LauncherSettings ls,
Report r)
Initialize the script executor. |
void |
runDefaultPreparationScript(Report r)
Run the default environment preparation script. |
void |
runPreparationScript(File script,
Report r)
Run the preparation script in the file. |
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. |
Method Detail |
---|
void init(NamedReadableFile scriptFile, LauncherSettings ls, Report r) throws IOException
FlatteningList.registerDecorator(org.schmant.support.util.FlatteningListDecorator)
,
TaskExecutorThreadFactory.registerThreadContextInitializer(org.schmant.run.ThreadContextInitializer)
and
ClosureSupport.registerClosureRunner(org.schmant.lang.ClosureRunner)
.
scriptFile
- The script file that is run.ls
- The command line settings.r
- The report.
IOException
tearDown()
void tearDown()
init(NamedReadableFile, LauncherSettings, Report)
registered
with.
void setGlobalVariable(String name, Object value)
name
- The name of the variable.value
- The variable value.void setBindings(Bindings bnd, int scope)
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.void runDefaultPreparationScript(Report r) throws SchmantException, IOException
r
- A report to log to.
SchmantException
- On errors.
WrappedIOException
- On I/O errors.
IOException
void runPreparationScript(File script, Report r) throws SchmantException, IOException
script
- The script file.r
- A report to log to.
SchmantException
- On errors.
WrappedIOException
- On I/O errors.
IOException
Object runWithDefaultWrapperScript() throws SchmantException, IOException
SchmantException
- On errors.
WrappedIOException
- On I/O errors.
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |