0% found this document useful (0 votes)
379 views

ANT Cheat Sheet

The document provides examples of common Ant tasks for performing operations like copying files, deleting directories, running Java programs and executables, compiling Java code, creating ZIP files, and unzipping files. Ant is a build tool used to automate tasks like compiling code, packaging files, testing, and deployment. The examples demonstrate how to use Ant tasks like <copy>, <delete>, <echo>, <java>, <exec>, <javac>, <zip>, and <unzip> to perform these automated operations.

Uploaded by

Anupam Lalit
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
379 views

ANT Cheat Sheet

The document provides examples of common Ant tasks for performing operations like copying files, deleting directories, running Java programs and executables, compiling Java code, creating ZIP files, and unzipping files. Ant is a build tool used to automate tasks like compiling code, packaging files, testing, and deployment. The examples demonstrate how to use Ant tasks like <copy>, <delete>, <echo>, <java>, <exec>, <javac>, <zip>, and <unzip> to perform these automated operations.

Uploaded by

Anupam Lalit
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

ANT Cheat Sheet

<copy todir="../dest/dir"> <fileset dir="src_dir"> <exclude name="**/*.java"/> </fileset> </copy> <delete includeEmptyDirs="true"> <fileset dir="build"/> </delete> <echo message="Embed a line break:${line.separator}"/> <java classname="test.Main"> <arg value="-h"/> <classpath> <pathelement location="dist/test.jar"/> <pathelement path="${java.class.path}"/> </classpath> </java> <exec dir="${src}" executable="cmd.exe" os="Windows 2000" output="dir.txt"> <arg line="/c dir"/> </exec> <javac srcdir="${src}" destdir="${build}" classpath="xyz.jar" debug="on" source="1.4" /> <zip destfile="${dist}/manual.zip" basedir="htdocs/manual" update="true" /> <unzip src="${tomcat_src}/tools-src.zip" dest="${tools.home}"/> <target name="compile"> <mkdir dir="build/classes"/> <javac srcdir="src" destdir="build/classes"/> </target>

Ant resource - http://ant.apache.org/manual/index.html

You might also like