ant -buildfile cc-build.xml
ant -Dversion=1_0
ant -proejcthelp
target의 description 속성의 내용을 볼 수 있음.
<includesfiles name="includes.files/>
<excludesfiles name="excludes.files/>
<filelist id="libFiles" fiels="a.files b.files"/>
<property="build.dir" location="build"/>
<property="build.prod.dir" location="${build.dir}/prod"/>
<property="build.test.dir" location="${build.dir}/test"/>
<property="lib.dir" location="${build.dir}/lib"/>
<path id="project.classpath">
<pathelement location="${build.prod.dir}"/>
<pathelement location="${build.test.dir}"/>
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<javac srcdir="${src.dir}" destdir="${build.prod.dir}">
<classpath refid="project.classpath"/>
</javac>
<jspc srcdir="${jsp}" destdir="${src}" pakcage="test.jsp">
<include name="**/*.jsp"/>
</jspc>
이후에 javac
<junit>
<test my="my.test.TestCase"/>
</junit>
<target name="test" depends="cimpoile-tests">
<delete dir="${test.xml.dir}"/>
<mkdir dir="${test.xml.dir}"/>
<junit errorProperty="test.failed" failureProperty="test.failed">
<classpath refid="project.classpath"/>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<batchtes todir="${test.xml.dir}">
<fileset dir="${build.test.dir}" includes="**/*Test.class"/>
</batchtests>
<sysproperty key="doc.dir" value="${doc.dir}"/>
<sysproperty key="index.dir" value="${index.dir}"/>
</junit>
<fail message="Tests failed!" if="test.failed"/>
</target>
<jar destfile="{jar.path}" basedir="${build.prod.dir}" />
<zip destfile="${zip.path}">
<zipfilest dir="bin" filemode="755" prefix="${release}/bin">
<include name="index.*"/>
</zipfileset>
</zip>
<deploy url="$tomcat.manager.url"
username="${tomcat.manager.username}"
password="${tomcat.manager.password}"
path="/{webapp.name}"
war="file:${warfile.path}"
/>
<target name="manual">
<java classname="mypackage.MyClassl" maxmemory="128m" fork="true" classpathref="classpath">
<classpath path="${project.classes.dir}"/>
<arg value="Sample"/>
<arg value="Jsh"/>
<jvmarg value="-Dlog4j.configuration=file:${updater.src}/classes/log4j.xml"/> <jvmarg value="-XX:+UseParallelGC"/>
<jvmarg value="-Xms3072m"/> <jvmarg value="-Xmx3072m"/>
</java>
</target>
<target name="insert-data">
<sql driver="${db.driver}"
url="${db.url}"
userid="${db.username}"
password="${db.password}"
src="${database.dir}/insert-data.sql">
<classpath>
<pathelement location="${mysql-connector.jar}"/>
</classpath>
</sql>
</target>