From a950bd593f9f84bb8cc6dcc8d5afb626bb40b335 Mon Sep 17 00:00:00 2001
From: Matthew Jason Benson
Some of Ant's core classes ant tasks can be configured via system properties.
+Some of Ant's core classes can be configured via system properties.
Here is the result of a search through the codebase. Because system properties are available via Project instance, I searched for them with a
@@ -442,26 +442,26 @@ org.apache.tools.ant.Executor implementation specified here. If new properties get added (it happens), expect them to appear under the "ant." and "org.apache.tools.ant" prefixes, unless the developers have a very good reason to use another prefix. Accordingly, please avoid using -properties that begin with these prefixes, to reduce the risk that future -Ant releases break your build file. +properties that begin with these prefixes. This protects you from future +Ant releases breaking your build file.Cygwin Users
The Unix launch script that come with Ant works correctly with Cygwin. You -should not have any problems launching Ant form the Cygwin shell. It is important -to note however, that once Ant is runing it is part of the JDK which operates as -a native Windows application. The JDK is not a Cygwin executable, and it therefore -has no knowledge of the Cygwin paths, etc. In particular when using the
<exec>
-task, executable names such as "/bin/sh" will not work, even though these -work from the Cygwin shell from which Ant was launched. You can use an executable -name such as "sh" and rely on that command being available in the Windows -path. +should not have any problems launching Ant from the Cygwin shell. It is +important to note, however, that once Ant is running it is part of the JDK +which operates as a native Windows application. The JDK is not a Cygwin +executable, and it therefore has no knowledge of Cygwin paths, etc. In +particular when using the<exec>
task, executable names such +as "/bin/sh" will not work, even though these work from the Cygwin +shell from which Ant was launched. You can use an executable name such as +"sh" and rely on that command being available in the Windows path.OS/2 Users
-The OS/2 launch script was developed so as it can perform complex tasks. It has two parts: -
ant.cmd
which calls Ant andantenv.cmd
which sets environment for Ant. +The OS/2 launch script was developed to perform complex tasks. It has two parts: +
@@ -470,13 +470,13 @@ requirements are:ant.cmd
which calls Ant andantenv.cmd
which sets the environment for Ant. Most often you will just callant.cmd
using the same command line options as described above. The behaviour can be modified by a number of ways explained below.
- Environment variable
JAVA_HOME
is set.- Environment variable
-ANT_HOME
is set.- environment variable
CLASSPATH
is set and contains at least one element from +- Environment variable
CLASSPATH
is set and contains at least one element fromJAVA_HOME
and at least one element fromANT_HOME
.If any of these conditions is violated, script
-antenv.cmd
is called. This script first invokes configuration scripts if there exist: the system-wide configuration -antconf.cmd
from the%ETC%
directory and then the user comfiguration +antconf.cmd
from the%ETC%
directory and then the user configurationantrc.cmd
from the%HOME%
directory. At this moment bothJAVA_HOME
andANT_HOME
must be defined becauseantenv.cmd
now addsclasses.zip
ortools.jar
(depending on version of JVM) and @@ -484,15 +484,15 @@ everything from%ANT_HOME%\lib
exceptant-*.jar
toCLASSPATH
. Finallyant.cmd
calls per-directory configurationantrc.cmd
. All settings made byant.cmd
are local and are undone when the script ends. The settings made byantenv.cmd
are persistent during the lifetime of the -shell (of course unless called automaticaly fromant.cmd
). It is thus possible to call +shell (of course unless called automatically fromant.cmd
). It is thus possible to callantenv.cmd
manually and modify some settings before callingant.cmd
.Scripts
envset.cmd
andrunrc.cmd
perform auxilliary tasks. All scripts +Scripts
envset.cmd
andrunrc.cmd
perform auxiliary tasks. All scripts have some documentation inside.Running Ant via Java
If you have installed Ant in the do-it-yourself way, Ant can be started -with two entry points:
+from one of two entry points:java -Dant.home=c:\ant org.apache.tools.ant.Main [options] [target]