public class Main extends Object implements org.apache.tools.ant.launch.AntMain
If you integrating Ant into some other tool, this is not the class to use as an entry point. Please see the source code of this class to see how it manipulates the Ant project classes.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_BUILD_FILENAME
The default build file name.
|
Constructor and Description |
---|
Main()
Constructor used when creating Main for later arg processing
and startup
|
Modifier and Type | Method and Description |
---|---|
protected void |
addBuildListeners(Project project)
Adds the listeners specified in the command line arguments,
along with the default listener, to the specified project.
|
protected void |
exit(int exitCode)
This operation is expected to call
System.exit(int) , which
is what the base version does. |
static String |
getAntVersion()
Returns the Ant version information, if available.
|
static String |
getShortAntVersion()
Returns the short Ant version information, if available.
|
static void |
main(String[] args)
Command line entry point.
|
static void |
start(String[] args,
Properties additionalUserProperties,
java.lang.ClassLoader coreLoader)
Creates a new instance of this class using the
arguments specified, gives it any extra user properties which have been
specified, and then runs the build using the classloader provided.
|
void |
startAnt(String[] args,
Properties additionalUserProperties,
java.lang.ClassLoader coreLoader)
Start Ant
|
public static final String DEFAULT_BUILD_FILENAME
public Main()
protected void addBuildListeners(Project project)
project
- The project to add listeners to.
Must not be null
.protected void exit(int exitCode)
System.exit(int)
, which
is what the base version does.
However, it is possible to do something else.exitCode
- code to exit withpublic static String getAntVersion() throws BuildException
null
)BuildException
- if the version information is unavailablepublic static String getShortAntVersion() throws BuildException
null
)BuildException
- BuildException if the version information is unavailablepublic static void main(String[] args)
args
- Command line arguments. Must not be null
.public static void start(String[] args, Properties additionalUserProperties, java.lang.ClassLoader coreLoader)
args
- Command line arguments. Must not be null
.additionalUserProperties
- Any extra properties to use in this
build. May be null
, which is the equivalent to
passing in an empty set of properties.coreLoader
- Classloader used for core classes. May be
null
in which case the system classloader is used.public void startAnt(String[] args, Properties additionalUserProperties, java.lang.ClassLoader coreLoader)
startAnt
in interface org.apache.tools.ant.launch.AntMain
args
- command line argsadditionalUserProperties
- properties to set beyond those that
may be specified on the args listcoreLoader
- - not used