Split plugin ant targets into a abstract build.xml file
This commit is contained in:
parent
279c19272e
commit
26ed8584c8
3 changed files with 127 additions and 144 deletions
100
build_plugin.xml
Executable file
100
build_plugin.xml
Executable file
|
|
@ -0,0 +1,100 @@
|
||||||
|
<?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">
|
||||||
|
<jar destfile="${releaseDir}/${releaseJar}" basedir="${compileDir}" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</project>
|
||||||
|
|
@ -1,96 +1,23 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project name="Tellstick Plugin" >
|
<project name="Tellstick Plugin" >
|
||||||
|
|
||||||
<!-- ________________________ PROPERTIES AND SETTINGS ________________________ -->
|
<!-- ________________________ PROPERTIES AND SETTINGS ________________________ -->
|
||||||
|
|
||||||
<!--common properties-->
|
<!--common properties-->
|
||||||
<property name="root" value="." />
|
<property name="root" value="." />
|
||||||
<property name="srcDir" value="${root}/src" />
|
<property name="srcDir" value="${root}/src" />
|
||||||
<property name="testDir" value="${root}/test" />
|
<property name="testDir" value="${root}/test" />
|
||||||
<property name="libDir" value="${root}/lib" />
|
<property name="libDir" value="${root}/lib" />
|
||||||
|
|
||||||
<property name="buildRoot" value="${root}/build" />
|
<property name="buildRoot" value="${root}/build" />
|
||||||
<property name="compileDir" value="${buildRoot}/production" />
|
<property name="compileDir" value="${buildRoot}/production" />
|
||||||
<property name="compileTestDir" value="${buildRoot}/test" />
|
<property name="compileTestDir" value="${buildRoot}/test" />
|
||||||
<property name="releaseDir" value="${buildRoot}/release" />
|
<property name="releaseDir" value="${buildRoot}/release" />
|
||||||
<property name="releaseJar" value="tellstick.jar" />
|
<property name="releaseJar" value="tellstick.jar" />
|
||||||
<property name="reportsDir" value="../../${buildRoot}/reports" /> <!-- Use Hal reports folder -->
|
<property name="reportsDir" value="../../${buildRoot}/reports" /> <!-- Use Hal reports folder -->
|
||||||
|
|
||||||
<!-- ________________________ CLASSPATH ________________________ -->
|
<!-- ________________________ TARGETS ________________________ -->
|
||||||
|
|
||||||
<!--define standard arguments for javac-->
|
<import file="../../build_plugin.xml"/>
|
||||||
<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" />
|
|
||||||
</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>
|
|
||||||
|
|
||||||
<target name="build-test" depends="build">
|
|
||||||
<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">
|
|
||||||
<jar destfile="${releaseDir}/${releaseJar}" basedir="${compileDir}" />
|
|
||||||
</target>
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
|
|
@ -1,67 +1,23 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project name="ZWave Plugin" >
|
<project name="ZWave Plugin" >
|
||||||
|
|
||||||
<!-- ________________________ PROPERTIES AND SETTINGS ________________________ -->
|
<!-- ________________________ PROPERTIES AND SETTINGS ________________________ -->
|
||||||
|
|
||||||
<!--common properties-->
|
<!--common properties-->
|
||||||
<property name="root" value="." />
|
<property name="root" value="." />
|
||||||
<property name="srcDir" value="${root}/src" />
|
<property name="srcDir" value="${root}/src" />
|
||||||
<property name="libDir" value="${root}/lib" />
|
<property name="testDir" value="${root}/test" />
|
||||||
|
<property name="libDir" value="${root}/lib" />
|
||||||
|
|
||||||
<property name="buildRoot" value="${root}/build" />
|
<property name="buildRoot" value="${root}/build" />
|
||||||
<property name="compileDir" value="${buildRoot}/production" />
|
<property name="compileDir" value="${buildRoot}/production" />
|
||||||
<property name="releaseDir" value="${buildRoot}/release" />
|
<property name="compileTestDir" value="${buildRoot}/test" />
|
||||||
<property name="releaseJar" value="zwave.jar" />
|
<property name="releaseDir" value="${buildRoot}/release" />
|
||||||
|
<property name="releaseJar" value="zwave.jar" />
|
||||||
|
<property name="reportsDir" value="../../${buildRoot}/reports" /> <!-- Use Hal reports folder -->
|
||||||
|
|
||||||
|
<!-- ________________________ TARGETS ________________________ -->
|
||||||
|
|
||||||
<!-- ________________________ CLASSPATH ________________________ -->
|
<import file="../../build_plugin.xml"/>
|
||||||
|
|
||||||
<!--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>
|
|
||||||
|
|
||||||
<!-- ________________________ EXECUTION TARGETS ________________________ -->
|
|
||||||
|
|
||||||
<target name="test" />
|
|
||||||
|
|
||||||
<!-- ________________________ 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>
|
|
||||||
|
|
||||||
<target name="package" depends="build">
|
|
||||||
<jar destfile="${releaseDir}/${releaseJar}" basedir="${compileDir}" />
|
|
||||||
</target>
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue