Tutorial by Examples

Add the following to a file named build.xml in your project directory: <?xml version="1.0" encoding="UTF-8"?> <project name="HelloWorld" default="main"> <target name="main" description="this is target main"> ...
Add the following target in your build.xml <!-- Bootstrap ivy --> <target name="ivy.bootstrap" description="Download Apache Ivy"> <!-- Define the version to use --> <property name="ivy.version">2.4.0</property> <!-- ...
The following is handy to have in build logs that identifies the build machine, and some parameters; simply make you main task depend on this task to print it before every build. <!-- Print Environment Info --> <target name="environment"> <!-- Get the current ti...
The following will run JUnit on the tests matching test/**/*Test.java. This need the junit.jar to be in the lib folder. <project name="Project" default="junit" basedir="."> <path id="classpath"> <fileset dir="lib" includ...
The following will create dist/output.jar from the source code in src and the libraries in lib, and will use src/Main.java as the main class. <project name="Project" default="main" basedir="."> <property name="src.dir" value="src&quot...
Installing Ant is very simple. Follow the steps given below to install Ant on windows platform: Download latest ant version from Apache website Unzip the file on your machine. Set ANT_HOME in environment variables Add %ANT_HOME%\bin to your PATH environment variable. Set CLA...

Page 1 of 1