Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (47 sloc) 2.24 KB
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="jsbuilder" basedir="." default="build">
<property name="src.dir" value="src" />
<property name="lib.dir" value="lib" />
<property name="build.dir" value="build" />
<property name="classes.dir" value="${build.dir}/classes" />
<property name="build.lib.dir" value="${build.dir}/lib" />
<target name="clean" description="Delete all generated files">
<delete dir="${build.dir}" failonerror="false" />
</target>
<target name="compile" description="Compiles the Task">
<mkdir dir="${classes.dir}" />
<javac includeantruntime="true" debug="true" debuglevel="{lines,vars,source}" srcdir="${src.dir}" destdir="${classes.dir}" classpath="${lib.dir}/commons-io.jar;${lib.dir}/log4j.jar;${lib.dir}/jcl-core.jar;${lib.dir}/compiler.jar" />
</target>
<target name="jar" description="JARs the Task" depends="compile">
<mkdir dir="${build.dir}/jar" />
<mkdir dir="${build.dir}/jar/lib" />
<unzip src="${lib.dir}/jcl-core.jar" dest="${build.dir}/jar" />
<unzip src="${lib.dir}/log4j.jar" dest="${build.dir}/jar" />
<unzip src="${lib.dir}/commons-io.jar" dest="${build.dir}/jar" />
<unzip src="${lib.dir}/compiler.jar" dest="${build.dir}/jar" />
<copy todir="${build.dir}/jar">
<fileset dir="${classes.dir}" />
</copy>
<delete dir="${build.dir}/jar/META-INF"/>
<jar flattenAttributes="true" destfile="${build.dir}/${ant.project.name}.jar" basedir="${build.dir}/jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
</manifest>
</jar>
</target>
<target name="update.example" description="Updates the example withe the latest build." depends="build.partial">
<copy file="${build.dir}/${ant.project.name}.jar" tofile="example/tools/jsbuilder.jar" />
</target>
<target name="build.partial" depends="compile">
<copy todir="${build.dir}/jar">
<fileset dir="${classes.dir}" />
</copy>
<jar flattenAttributes="true" destfile="${build.dir}/${ant.project.name}.jar" basedir="${build.dir}/jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
</manifest>
</jar>
</target>
<target name="build" depends="clean,compile,jar" />
<target name="example" depends="build.partial,update.example" />
</project>