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 |
|---|---|
| private boolean | allowInput
Indicates whether this build is to support interactive input |
| private static String | antVersion
Cache of the Ant version information when it has been loaded. |
| private File | buildFile
File that we are using for configuration. |
| public static final String | DEFAULT_BUILD_FILENAME
The default build file name. |
| private final Properties | definedProps
Set of properties that can be used by tasks. |
| private boolean | emacsMode
Whether or not output to the log is to be unadorned. |
| private PrintStream | err
Stream that we are using for logging error messages. |
| private final Map | |
| private String | inputHandlerClassname
The Ant InputHandler class. |
| private boolean | isLogFileUsed
Whether or not a logfile is being used. |
| private boolean | keepGoingMode
keep going mode |
| private static final Set | LAUNCH_COMMANDS
A Set of args that are handled by the launcher and should not be seen by Main. |
| private final Vector | listeners
Names of classes to add as listeners to project. |
| private String | loggerClassname
The Ant logger class. |
| private int | msgOutputLevel
Our current message output status. |
| private static final GetProperty | |
| private PrintStream | out
Stream to use for logging. |
| private boolean | projectHelp
Whether or not we should only parse and display the project help information. |
| private final Vector | propertyFiles
File names of property files to load on startup. |
| private boolean | proxy
proxy flag: default is false |
| private boolean | readyToRun
Whether or not this instance has successfully been constructed and is ready to run. |
| private static String | shortAntVersion
Cache of the short Ant version information when it has been loaded. |
| private boolean | silent
Whether or not log output should be reduced to the minimum |
| private final Vector | targets
The build targets. |
| private Integer | threadPriority
optional thread priority |
| Access | Constructor and Description |
|---|---|
| public | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected void | addBuildListeners(final Project
The project to add listeners to.
Must not be project)null.Adds the listeners specified in the command line arguments, along with the default listener, to the specified project. |
| private void | addInputHandler(final Project
the project instance. project)Creates the InputHandler and adds it to the project. |
| private BuildLogger | Returns: the logger instance for this build.Creates the default build logger for sending build events to the ant log. |
| protected void | exit(final int
code to exit with exitCode)This operation is expected to call |
| private File | Returns: A handle to the build file if one is found,null if notLeaf directory of search.
Must not be start, final String null.Suffix filename to look for in parents.
Must not be suffix)null.Search parent directories for the build file. |
| private static int | Returns: the correct place in the list for the given nameThe current list of names. Must not be names, final String null.The name to find a place for.
Must not be name)null.Searches for the correct place to insert a name into a list so as to keep the list sorted alphabetically. |
| public static synchronized String | Returns: the Ant version information as a String (always non-null)Returns the Ant version information, if available. |
| private File | Returns: Parent file or null if noneFile to find parent of. Must not be file)null.
Deprecated
since 1.6.x
Helper to get the parent file for a given file.
|
| public static String | Returns: the short Ant version information as a String (always non-null)Returns the short Ant version information, if available. |
| private int | |
| private int | |
| private int | |
| private int | |
| private int | |
| private int | |
| private int | |
| private void | |
| private void | |
| public static void | |
| private static void | printDescription(final Project
The project to display a description of.
Must not be project)null.Prints the description of a project (if there is one) to
|
| private static void | printMessage(final Throwable
Throwable to print the message of.
Must not be t)null.Prints the message of the Throwable if it (the message) is not
|
| private static void | printTargets(final Project
The project to display a description of.
Must not be project, boolean null.Whether or not subtarget names should also be
printed. printSubTargets, final boolean printDependencies)Prints a list of all targets in the specified project to
|
| private static void | printTargets(final Project
the project instance. project, final Vector<String> The names to be printed.
Must not be names, final Vector<String> null.The associated target descriptions.
May be descriptions, final Vector<Enumeration<String>> dependencies, final String null, in which case
no descriptions are displayed.
If non-null, this should have
as many elements as names.The heading to display.
Should not be heading, final int null.The maximum length of the names of the targets.
If descriptions are given, they are padded to this
position so they line up (so long as the names really
are shorter than this). maxlen)Writes a formatted list of target names to |
| private static void | |
| private static void | |
| private void | |
| private static Map | Returns: the filtered targets.the targets to filter. targets)Targets in imported files with a project name and not overloaded by the main build file will be in the target map twice. |
| private void | runBuild(final ClassLoader
The classloader to use to find core classes.
May be coreLoader)null, in which case the
system classloader is used.Executes the build. |
| private void | |
| public static void | start(final String[]
Command line arguments. Must not be args, final Properties null.Any extra properties to use in this
build. May be additionalUserProperties, final ClassLoader null, which is the equivalent to
passing in an empty set of properties.Classloader used for core classes. May be
coreLoader)null in which case the system classloader is used.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. |
| public void | startAnt(final String[]
command line args args, final Properties properties to set beyond those that
may be specified on the args list additionalUserProperties, final ClassLoader - not used coreLoader)Implements org. |
| allowInput | back to summary |
|---|---|
| private boolean allowInput Indicates whether this build is to support interactive input | |
| antVersion | back to summary |
|---|---|
| private static String antVersion Cache of the Ant version information when it has been loaded. | |
| buildFile | back to summary |
|---|---|
| private File buildFile File that we are using for configuration. | |
| DEFAULT_BUILD_FILENAME | back to summary |
|---|---|
| public static final String DEFAULT_BUILD_FILENAME The default build file name. build.xml | |
| definedProps | back to summary |
|---|---|
| private final Properties definedProps Set of properties that can be used by tasks. | |
| emacsMode | back to summary |
|---|---|
| private boolean emacsMode Whether or not output to the log is to be unadorned. | |
| err | back to summary |
|---|---|
| private PrintStream err Stream that we are using for logging error messages. | |
| extraArguments | back to summary |
|---|---|
| private final Map<Class<?>, List<String>> extraArguments | |
| inputHandlerClassname | back to summary |
|---|---|
| private String inputHandlerClassname The Ant InputHandler class. There may be only one input handler. | |
| isLogFileUsed | back to summary |
|---|---|
| private boolean isLogFileUsed Whether or not a logfile is being used. This is used to check if the output streams must be closed. | |
| keepGoingMode | back to summary |
|---|---|
| private boolean keepGoingMode keep going mode | |
| LAUNCH_COMMANDS | back to summary |
|---|---|
| private static final Set<String> LAUNCH_COMMANDS A Set of args that are handled by the launcher and should not be seen by Main. | |
| listeners | back to summary |
|---|---|
| private final Vector<String> listeners Names of classes to add as listeners to project. | |
| loggerClassname | back to summary |
|---|---|
| private String loggerClassname The Ant logger class. There may be only one logger. It will have the right to use the 'out' PrintStream. The class must implements the BuildLogger interface. | |
| msgOutputLevel | back to summary |
|---|---|
| private int msgOutputLevel Our current message output status. Follows Project.MSG_XXX. | |
| NOPROPERTIES | back to summary |
|---|---|
| private static final GetProperty NOPROPERTIES | |
| out | back to summary |
|---|---|
| private PrintStream out Stream to use for logging. | |
| projectHelp | back to summary |
|---|---|
| private boolean projectHelp Whether or not we should only parse and display the project help information. | |
| propertyFiles | back to summary |
|---|---|
| private final Vector<String> propertyFiles File names of property files to load on startup. | |
| proxy | back to summary |
|---|---|
| private boolean proxy proxy flag: default is false | |
| readyToRun | back to summary |
|---|---|
| private boolean readyToRun Whether or not this instance has successfully been constructed and is ready to run. | |
| shortAntVersion | back to summary |
|---|---|
| private static String shortAntVersion Cache of the short Ant version information when it has been loaded. | |
| silent | back to summary |
|---|---|
| private boolean silent Whether or not log output should be reduced to the minimum | |
| targets | back to summary |
|---|---|
| private final Vector<String> targets The build targets. | |
| threadPriority | back to summary |
|---|---|
| private Integer threadPriority optional thread priority | |
| Main | back to summary |
|---|---|
| public Main() Constructor used when creating Main for later arg processing and startup | |
| Main | back to summary |
|---|---|
| protected Main(final String[] args) throws BuildException
Deprecated since 1.6.x Sole constructor, which parses and deals with command line arguments.
| |
| addBuildListeners | back to summary |
|---|---|
| protected void addBuildListeners(final Project project) Adds the listeners specified in the command line arguments, along with the default listener, to the specified project.
| |
| addInputHandler | back to summary |
|---|---|
| private void addInputHandler(final Project project) throws BuildException Creates the InputHandler and adds it to the project.
| |
| createLogger | back to summary |
|---|---|
| private BuildLogger createLogger() Creates the default build logger for sending build events to the ant log.
| |
| exit | back to summary |
|---|---|
| protected void exit(final int exitCode) This operation is expected to call
| |
| findBuildFile | back to summary |
|---|---|
| private File findBuildFile(final String start, final String suffix) Search parent directories for the build file.
Takes the given target as a suffix to append to each
parent directory in search of a build file. Once the
root of the file-system has been reached | |
| findTargetPosition | back to summary |
|---|---|
| private static int findTargetPosition(final Vector<String> names, final String name) Searches for the correct place to insert a name into a list so as to keep the list sorted alphabetically. | |
| getAntVersion | back to summary |
|---|---|
| public static synchronized 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.
| |
| getParentFile | back to summary |
|---|---|
| private File getParentFile(final File file)
Deprecated since 1.6.x Helper to get the parent file for a given file. Added to simulate File.getParentFile() from JDK 1.2. | |
| getShortAntVersion | back to summary |
|---|---|
| public static String getShortAntVersion() throws BuildException Returns the short Ant version information, if available. Once the information has been loaded once, it's cached and returned from the cache on future calls.
| |
| handleArgBuildFile | back to summary |
|---|---|
| private int handleArgBuildFile(final String[] args, int pos) Handle the -buildfile, -file, -f argument | |
| handleArgDefine | back to summary |
|---|---|
| private int handleArgDefine(final String[] args, int argPos) Handler -D argument | |
| handleArgInputHandler | back to summary |
|---|---|
| private int handleArgInputHandler(final String[] args, int pos) Handle the -inputhandler argument. | |
| handleArgListener | back to summary |
|---|---|
| private int handleArgListener(final String[] args, int pos) Handle -listener argument | |
| handleArgLogger | back to summary |
|---|---|
| private int handleArgLogger(final String[] args, int pos) Handle the -logger argument. | |
| handleArgNice | back to summary |
|---|---|
| private int handleArgNice(final String[] args, int pos) Handle the -nice argument. | |
| handleArgPropertyFile | back to summary |
|---|---|
| private int handleArgPropertyFile(final String[] args, int pos) Handle the -propertyfile argument. | |
| handleLogfile | back to summary |
|---|---|
| private void handleLogfile() Close logfiles, if we have been writing to them.
| |
| loadPropertyFiles | back to summary |
|---|---|
| private void loadPropertyFiles() Load the property files specified by -propertyfile | |
| main | back to summary |
|---|---|
| public static void main(final 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.
| |
| printDescription | back to summary |
|---|---|
| private static void printDescription(final Project project) Prints the description of a project (if there is one) to
| |
| printMessage | back to summary |
|---|---|
| private static void printMessage(final Throwable t) Prints the message of the Throwable if it (the message) is not
| |
| printTargets | back to summary |
|---|---|
| private static void printTargets(final Project project, boolean printSubTargets, final boolean printDependencies) Prints a list of all targets in the specified project to
| |
| printTargets | back to summary |
|---|---|
| private static void printTargets(final Project project, final Vector<String> names, final Vector<String> descriptions, final Vector<Enumeration<String>> dependencies, final String heading, final int maxlen) Writes a formatted list of target names to
| |
| printUsage | back to summary |
|---|---|
| private static void printUsage() Prints the usage information for this class to | |
| printVersion | back to summary |
|---|---|
| private static void printVersion(final int logLevel) throws BuildException Prints the Ant version information to
| |
| processArgs | back to summary |
|---|---|
| private void processArgs(final String[] args) Process command line arguments. When ant is started from Launcher, launcher-only arguments do not get passed through to this routine.
| |
| removeDuplicateTargets | back to summary |
|---|---|
| private static Map Targets in imported files with a project name and not overloaded by the main build file will be in the target map twice. This method removes the duplicate target. | |
| runBuild | back to summary |
|---|---|
| private void runBuild(final ClassLoader coreLoader) throws BuildException Executes the build. If the constructor for this instance failed (e.g. returned after issuing a warning), this method returns immediately.
| |
| setProperties | back to summary |
|---|---|
| private void setProperties(final Project project) | |
| start | back to summary |
|---|---|
| public static void start(final String[] args, final Properties additionalUserProperties, final 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.
| |
| startAnt | back to summary |
|---|---|
| public void startAnt(final String[] args, final Properties additionalUserProperties, final ClassLoader coreLoader) Implements org. Start Ant
| |