Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
60 lines (50 sloc) 1.86 KB
<project>
<property name="version" value="0.1"/>
<property name="src.dir" value="src"/>
<property name="build.dir" value="build"/>
<property name="lib.dir" value="lib"/>
<property name="test.dir" value="test"/>
<property name="testng.jar" value="/usr/local/lib/java/testng-6.3.1.jar"/>
<property name="main-class" value="com.github.tenorviol.gitsearch.GitSearch"/>
<taskdef resource="testngtasks" classpath="${testng.jar}"/>
<path id="classpath">
<fileset dir="${lib.dir}" includes="*.jar"/>
</path>
<path id="test-classpath">
<path refid="classpath"/>
<pathelement location="${test.dir}"/>
<pathelement location="${testng.jar}"/>
</path>
<target name="clean">
<delete dir="build"/>
<delete dir="{$test.dir}/report"/>
<delete>
<fileset dir="." includes="**/*.class"/>
<fileset dir="${lib.dir}" includes="gitsearch-*.jar"/>
</delete>
</target>
<target name="compile">
<mkdir dir="build/classes"/>
<javac srcdir="${src.dir}" destdir="build/classes" classpathref="classpath" includeantruntime="false"/>
<jar destfile="lib/gitsearch-${version}.jar" basedir="build/classes">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
</jar>
</target>
<target name="test" depends="compile">
<javac srcdir="${test.dir}" classpathref="test-classpath" includeantruntime="false"/>
<mkdir dir="${test.dir}/report"/>
<testng classpathref="test-classpath" outputDir="${test.dir}/report" haltOnFailure="true" verbose="2">
<classfileset dir="${test.dir}" includes="**/*Test*.class" />
</testng>
</target>
<target name="run" depends="compile">
<java fork="true" classname="${main-class}">
<classpath>
<path refid="classpath"/>
<path location="${jar.dir}/*.jar"/>
</classpath>
</java>
</target>
</project>