zutil/build.xml

93 lines
3.3 KiB
XML
Raw Normal View History

2016-02-27 02:17:14 +01:00
<?xml version="1.0" encoding="UTF-8"?>
<project name="Zutil" >
<!-- ________________________ PROPERTIES AND SETTINGS ________________________ -->
<!--common properties-->
<property name="gitRoot" value="." />
<property name="srcDir" value="${gitRoot}/src" />
<property name="testDir" value="${gitRoot}/test" />
<property name="libDir" value="${gitRoot}/lib" />
<property name="buildRoot" value="${gitRoot}/build" />
<property name="buildDir" value="${buildRoot}/production" />
<property name="buildTestDir" value="${buildRoot}/test" />
<property name="releaseDir" value="${buildRoot}/release" />
<property name="reportsDir" value="${buildRoot}/reports" />
<!--define standard arduments for javac-->
<presetdef name="javac">
<javac includeantruntime="false" />
</presetdef>
<!-- ________________________ CLASSPATHS ________________________ -->
<!--classpath included when building-->
<path id="classpath.build">
2016-02-28 02:23:32 +01:00
<fileset dir="${libDir}">
<include name="**/*.jar"/>
</fileset>
2016-02-27 02:17:14 +01:00
<pathelement location="${buildDir}" />
</path>
<path id="classpath.test">
<pathelement location="${buildTestDir}" />
2016-02-28 02:10:46 +01:00
<!--include libraries used for building-->
2016-02-27 02:17:14 +01:00
<path refid="classpath.build"/>
</path>
<!-- ________________________ EXECUTION TARGETS ________________________ -->
<target name="test" depends="build-test">
<mkdir dir="${reportsDir}" />
<junit printsummary="yes" fork="true" haltonfailure="false" failureproperty="test.failed" timeout="3000000">
2016-02-27 02:17:14 +01:00
<classpath refid="classpath.test" />
2016-02-28 02:10:46 +01:00
<formatter type="plain" usefile="false" /> <!-- to screen -->
2016-02-27 02:17:14 +01:00
<formatter type="xml" /> <!-- to file -->
2016-02-28 02:29:46 +01:00
<batchtest todir="${reportsDir}" skipNonTests="true">
2016-07-12 17:22:04 +02:00
<fileset dir="${buildTestDir}" includes="**/*.class" />
2016-02-27 02:17:14 +01:00
</batchtest>
</junit>
<fail message="Test failure detected, check test results." if="test.failed" /> <!-- Need this to fail build -->
2016-02-27 02:17:14 +01:00
</target>
<!-- ________________________ BUILD TARGETS ________________________ -->
<!--clean all build paths-->
<target name="clean">
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${buildRoot}" includes="**/*"/>
</delete>
</target>
<!--build product code-->
<target name="release" depends="build">
<jar destfile="${releaseDir}/Zutil.jar" basedir="${buildDir}" />
</target>
<target name="build">
<mkdir dir="${buildDir}" />
2016-03-14 22:32:35 +01:00
<javac target="1.7" srcdir="${srcDir}" destdir="${buildDir}" debug="yes" debugLevel="lines,vars,source">
2016-02-27 02:17:14 +01:00
<classpath refid="classpath.build" />
<include name="**/*.java" />
</javac>
2016-07-12 17:22:04 +02:00
<copy todir="${buildDir}"> <!-- Copy resource files -->
2016-02-27 02:33:13 +01:00
<fileset dir="${srcDir}"
excludes="**/*.java" />
</copy>
2016-02-27 02:17:14 +01:00
</target>
<target name="build-test" depends="build">
<mkdir dir="${buildTestDir}" />
<javac srcdir="${testDir}" destdir="${buildTestDir}" debug="yes" debugLevel="lines,vars,source">
<classpath refid="classpath.test" />
<include name="**/*.java" />
</javac>
2016-02-27 02:33:13 +01:00
<copy todir="${buildTestDir}">
<fileset dir="${testDir}"
excludes="**/*.java" />
</copy>
2016-02-27 02:17:14 +01:00
</target>
</project>