Ant introduction Ant is a Java-based build tool. Everyone knows that there is already a lot of Build tools, such as make, gnumake, nmake, jam, etc., and these tools are very excellent. Then why should I introduce to the new tool of Ant? Because Ant is a cross-platform Build tool. The reason that Ant can cross the platform because Ant no longer needs you to write shell commands, Ant's profile is XML-based task tree, which allows you to run a variety of tasks, the task run is the implementation of a specific task interface Objects are completed. 2.1 Get an Ant Binary version: The latest stable download address is: http://jakarta.apache.org/builds/ant/release/v1.1/bin. SOURCE Edition: The latest source stabilization download address is: http://jakarta.apache.org/builds/ant/release/v1.1/src/. If you want to get the latest source code, the address is: http://jakarta.apache.org/from-cvs/jakarta-ant/ 2.2 System Requirements You need to include XML Parser compatible with JAXP in ClassPath to compile and use ANT. I recommend an XML Parser: Xerces, download address: http://xml.apache.org/xerces Of course, JDK is definitely necessary and is 1.1 or later. 2.3 Compiling Ant 1. Enter Jakarta-Ant Contents 2. Add JDK to your path environment variable 3. Set the Java_Home environment variable, point to your JDK installation directory 4. Run Bootstrap.SH Corner file 5. Run the following command to create Ant's binary version: build.sh -dant.dist.dir =
Dist 2.4 Installing Ant 1. Set the ANT_HOME environment variable, point to your Ant directory 2. Set the java_home environment variable, point to your JSK directory 3. Add ant_home / bin to the PATH environment variable 4. Add ant.jar and Xerces.jar Add to To the ClassPath environment variable, assuming that Ant is installed in the / usr / local / ant directory, can be set by the following method: export ant_home = / usr / local / ant export java_home = / usr / local / jdk-1.2.2 export path = $ {Ant_Home} / bin: $ {path} export classpath = $ {ant_home} /lib/ant.jar:/lib/xerces.jar: $ {classpath} 2.5 Run Ant Run Ant is very simple, if you follow the methods described above Ant is installed, just type Ant on the command line. When you run Ant without any parameters, Ant will find a file called build.xml in the current directory. If you find it, you will use the file as the build profile. If not found, it will automatically find the upper level directory, and have always found the root directory. Other profiles can also be specified by command line parameters -buildfile, where is the configuration file name you want to use.