public class EvalProject extends Object
EvalScript
and provides access to options, targets, etc.Constructor and Description |
---|
EvalProject(Properties props)
Construct a new eval project.
|
EvalProject(Properties props,
ClassLoader loader)
Construct a new eval project.
|
Modifier and Type | Method and Description |
---|---|
void |
executeTarget(String name)
Execute a target in the project.
|
void |
executeTargets(List<String> names)
Execute a sequence of targets.
|
void |
executeTargets(String... names)
Execute a sequence of targets.
|
org.apache.tools.ant.Project |
getAntProject()
Get the Ant project from this eval project.
|
ClassLoader |
getClassLoader()
Get the class loader that should be used for custom class loading.
|
EvalConfig |
getConfig()
Get the (legacy) configuration view of this project.
|
String |
getDefaultTarget() |
EventBus |
getEventBus()
Get this project's event bus.
|
String |
getProperty(String propertyName)
Get a property value.
|
Random |
getRandom()
Get the project's random number generator.
|
void |
setDefaultTarget(String defaultTarget) |
void |
setRandom(Random random)
Set the project's random number generator.
|
void |
setUserProperty(String name,
String value)
Set a "user" property.
|
public EvalProject(@Nullable Properties props)
props
- A set of additional properties. These properties will be available in the
project, in addition to the system properties. This is not where properties
from the command line should be supplied; those should be set with
setUserProperty(String, String)
so that they have Ant-like behavior.public EvalProject(@Nullable Properties props, ClassLoader loader)
props
- A set of additional properties. These properties will be available in the
project, in addition to the system properties. This is not where properties
from the command line should be supplied; those should be set with
setUserProperty(String, String)
so that they have Ant-like behavior.loader
- A class loader. This class loader will be used by the project for custom class
loading, such as reading cached objects from disk. If null, the default classloader
will be used.public ClassLoader getClassLoader()
public org.apache.tools.ant.Project getAntProject()
public EventBus getEventBus()
public Random getRandom()
public void setRandom(Random random)
random
- The project's random number generator.public EvalConfig getConfig()
public String getProperty(String propertyName)
propertyName
- The property name.null
if no such property exists.public void setUserProperty(String name, String value)
name
- The property to set.value
- The property value.public void executeTarget(String name) throws org.apache.tools.ant.BuildException
name
- The target to execute.org.apache.tools.ant.BuildException
public void executeTargets(String... names)
names
- The targets to execute.public void executeTargets(List<String> names)
names
- The targets to execute.public String getDefaultTarget()
public void setDefaultTarget(String defaultTarget)