org.apache.tools.ant
Class Main
java.lang.Object
org.apache.tools.ant.Main
- AntMain
public class Main
extends java.lang.Object
Command line entry point into Ant. This class is entered via the
canonical `public static void main` entry point and reads the
command line arguments. It then assembles and executes an Ant
project.
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.
Main() - Constructor used when creating Main for later arg processing
and startup
|
Main(String[] args)
|
protected void | addBuildListeners(Project project) - Adds the listeners specified in the command line arguments,
along with the default listener, to the specified project.
|
static String | getAntVersion() - Returns the Ant version information, if available.
|
static void | main(String[] args) - Command line entry point.
|
static void | start(String[] args, Properties additionalUserProperties, 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, ClassLoader coreLoader) - Start Ant
|
DEFAULT_BUILD_FILENAME
public static final String DEFAULT_BUILD_FILENAME
The default build file name.
Main
public Main()
Constructor used when creating Main for later arg processing
and startup
Main
protected Main(String[] args)
throws BuildException
Sole constructor, which parses and deals with command line
arguments.
args
- Command line arguments. Must not be null
.
BuildException
- if the specified build file doesn't exist
or is a directory.
addBuildListeners
protected void addBuildListeners(Project project)
Adds the listeners specified in the command line arguments,
along with the default listener, to the specified project.
project
- The project to add listeners to.
Must not be null
.
getAntVersion
public static String getAntVersion()
throws BuildException
Returns the Ant version information, if available. Once the information
has been loaded once, it's cached and returned from the cache on future
calls.
- the Ant version information as a String
(always non-
null
)
main
public static void main(String[] args)
Command line entry point. This method kicks off the building
of a project object and executes a build using either a given
target or the default target.
args
- Command line arguments. Must not be null
.
start
public static void start(String[] args,
Properties additionalUserProperties,
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.
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.
startAnt
public void startAnt(String[] args,
Properties additionalUserProperties,
ClassLoader coreLoader)
Start Ant
- startAnt in interface AntMain
args
- command line argsadditionalUserProperties
- properties to set beyond those that
may be specified on the args listcoreLoader
- - not used
Copyright © 2000-2006 Apache Software Foundation. All Rights Reserved.