103 lines
3.8 KiB
XML
Executable file
103 lines
3.8 KiB
XML
Executable file
<?xml version="1.0" encoding="UTF-8"?>
|
|
<project name="abstract plugin build file" >
|
|
|
|
<!-- ________________________ PROPERTIES AND SETTINGS ________________________ -->
|
|
<!-- ____________ (THESE SHOULD BE SET BY IMPORTING BUILD SCRIPT) ____________ -->
|
|
|
|
<!--common properties-->
|
|
<!--
|
|
<property name="root" value="." />
|
|
<property name="srcDir" value="${root}/src" />
|
|
<property name="testDir" value="${root}/test" />
|
|
<property name="libDir" value="${root}/lib" />
|
|
|
|
<property name="buildRoot" value="${root}/build" />
|
|
<property name="compileDir" value="${buildRoot}/production" />
|
|
<property name="compileTestDir" value="${buildRoot}/test" />
|
|
<property name="releaseDir" value="${buildRoot}/release" />
|
|
<property name="releaseJar" value="tellstick.jar" />
|
|
<property name="reportsDir" value="../../${buildRoot}/reports" />
|
|
-->
|
|
|
|
<!-- ________________________ CLASSPATH ________________________ -->
|
|
|
|
<!--define standard arguments for javac-->
|
|
<presetdef name="javac">
|
|
<javac includeantruntime="false" />
|
|
</presetdef>
|
|
|
|
<!--classpath included when building-->
|
|
<path id="classpath.build">
|
|
<fileset dir="${libDir}" erroronmissingdir="false">
|
|
<include name="**/*.jar"/>
|
|
</fileset>
|
|
<pathelement location="${compileDir}" />
|
|
<!-- Hal core -->
|
|
<pathelement location="../../build/production" />
|
|
<fileset dir="../../lib">
|
|
<include name="**/*.jar"/>
|
|
</fileset>
|
|
</path>
|
|
|
|
<path id="classpath.test">
|
|
<pathelement location="${compileTestDir}" />
|
|
<pathelement location="../../${compileTestDir}" />
|
|
<!--include libraries used for building-->
|
|
<path refid="classpath.build"/>
|
|
</path>
|
|
|
|
<!-- ________________________ EXECUTION TARGETS ________________________ -->
|
|
|
|
<target name="test" depends="build-test">
|
|
<mkdir dir="${reportsDir}" />
|
|
<junit printsummary="yes" haltonfailure="false" fork="true">
|
|
<classpath refid="classpath.test" />
|
|
<formatter type="plain" usefile="false" /> <!-- to screen -->
|
|
<formatter type="xml" /> <!-- to file -->
|
|
|
|
<batchtest todir="${reportsDir}" skipNonTests="true">
|
|
<fileset dir="${compileTestDir}" includes="**/*Test*.class" erroronmissingdir="false"/>
|
|
</batchtest>
|
|
</junit>
|
|
</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="build">
|
|
<mkdir dir="${compileDir}" />
|
|
<javac srcdir="${srcDir}" destdir="${compileDir}" debug="yes" debugLevel="lines,vars,source" fork="yes">
|
|
<classpath refid="classpath.build" />
|
|
<include name="**/*.java" />
|
|
</javac>
|
|
<copy todir="${compileDir}">
|
|
<fileset dir="${srcDir}"
|
|
excludes="**/*.java" />
|
|
</copy>
|
|
</target>
|
|
|
|
<available file="${testDir}" property="testDirAvailable" value=""/>
|
|
|
|
<target name="build-test" depends="build" if="testDirAvailable">
|
|
<mkdir dir="${compileTestDir}" />
|
|
<javac srcdir="${testDir}" destdir="${compileTestDir}" debug="yes" debugLevel="lines,vars,source" fork="yes">
|
|
<classpath refid="classpath.test" />
|
|
<include name="**/*.java" />
|
|
</javac>
|
|
</target>
|
|
|
|
<target name="package" depends="build">
|
|
<copy todir="${releaseDir}/resource" failonerror="false">
|
|
<fileset dir="${resourceDir}" />
|
|
</copy>
|
|
<jar destfile="${releaseDir}/${releaseJar}" basedir="${compileDir}" />
|
|
</target>
|
|
|
|
</project>
|