public final class AntTargetExecutor extends Object
|Modifier and Type||Class and Description|
Class describing the environment in which the Ant target will be executed.
|Modifier and Type||Method and Description|
Factory method for creation of AntTargetExecutor with the given environment.
Execute given target(s).
public static AntTargetExecutor createTargetExecutor(AntTargetExecutor.Env env)
env- a configuration for the executor
public ExecutorTask execute(AntProjectCookie antProject, String targets) throws IOException
AntProjectCookie.getFile() must not be null, since Ant can only
run files present on disk.
The returned task may be used to wait for completion of the script and check result status.
The easiest way to get the project cookie is to get a
representing an Ant build script and to ask it for this cookie. Alternatively,
you may implement the cookie interface directly, where
getFile is critical and other methods may do nothing
null as needed).
While the specification for
AntProjectCookie says that
null simultaneously, the current
executor implementation does not care; to be safe, return an
antProject- a representation of the project to run
targets- non-empty list of target names to run; may be null to indicate default target
IOException- if there is a problem running the script