Ant is an automated build tool for software testing, compiling, packaging, and deployment, and is a subproject in the Apache Software Foundation Jakarta Directory with the following benefits:
Ant is written in the Java language and has a good cross-platform nature.
Ant consists of a default task and several optional tasks, and the runtime requires an XML build file, which defaults to Build.xml.
- Build Files ( Build.xml )
A project consists of project, which is composed of multiple target, each of which is subdivided into multiple tasks, each of which is done through a Java class that implements a particular interface. Ant uses the target tree to perform a variety of tasks, automating the build, and being flexible and easy to maintain.
Http://mirrors.cnnic.cn/apache//ant/binaries/apache-ant-1.9.6-bin.zip
Setting environment variables (adding the bin directory to the PATH environment variable)
After the ant is installed correctly, the command line input ant,ant will find Build.xml as the default build file in the current directory, if your build file is not Build.xml, then add filename.xml as a parameter such as Ant-buildfile Test.xml. When target is not specified, ant defaults to the target specified by default in the Project tab.
- Ant command-line arguments
ant [Options] [target target ...]
Options
-help: Displays help group information describing the ant command and its options;
-projecthelp: Displayed in the build file (build.xml), the user writes their own description information, which is the text of the description attribute in each target;
-version: Displays the version information of Ant;
-verbose: Displays detailed information about each execution step during the build process (only with the-debug option);
-quiet: Suppresses information that is not generated by the Echo task in the build file;
-debug: Display the information marked as debug information (with-verbose only two selected);
-EMACS: Format the log messages so that they are easily parsed by the shell mode of Emacs;
-logfile filename redirects the log information to the specified file;
-logger ClassName: Specifies a class to handle the log information of ant, class must implement Org.apache.tools.ant.BuildLogger interface;
-listener ClassName: Declare a listener class and add it to the listener list;
-buildfile FileName: Specifies the ant's Build file, which defaults to Build.xml;
-find FileName: Specifies the ant's build file, unlike the-buildfile, if the specified filename is not found in the current directory, it will be searched up, knowing the root of the system and failing to build if it is not found;
"Ant" Ant overview