站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

AntTargetExecutor (Ant) - NetBeans API Javadoc (Current Development Version)

org.apache.tools.ant.module/3 3.27.0 2

org.apache.tools.ant.module.api
Class AntTargetExecutor

java.lang.Object
  extended by org.apache.tools.ant.module.api.AntTargetExecutor

public final class AntTargetExecutor
extends Object

Executes an Ant target or list of targets asynchronously inside NetBeans.

Since:
2.15

Nested Class Summary
static class AntTargetExecutor.Env
          Class describing the environment in which the Ant target will be executed.
 
Method Summary
static AntTargetExecutor createTargetExecutor(AntTargetExecutor.Env env)
          Factory method for creation of AntTargetExecutor with the given environment.
 ExecutorTask execute(AntProjectCookie antProject, String[] targets)
          Execute given target(s).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createTargetExecutor

public static AntTargetExecutor createTargetExecutor(AntTargetExecutor.Env env)
Factory method for creation of AntTargetExecutor with the given environment. The factory does not clone Env what means that any change to Env will influence the factory.

Parameters:
env - a configuration for the executor
Returns:
an executor which can run projects with the given configuration

execute

public ExecutorTask execute(AntProjectCookie antProject,
                            String[] targets)
                     throws IOException
Execute given target(s).

The 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 DataObject 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 (returning null as needed). While the specification for AntProjectCookie says that getDocument and getParseException cannot both return null simultaneously, the current executor implementation does not care; to be safe, return an UnsupportedOperationException from getParseException.

Parameters:
antProject - a representation of the project to run
targets - non-empty list of target names to run; may be null to indicate default target
Returns:
task for tracking of progress of execution
Throws:
IOException - if there is a problem running the script

org.apache.tools.ant.module/3 3.27.0 2

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.