devinsy-xml/build.xml

129 lines
4.2 KiB
XML
Raw Normal View History

2013-06-25 14:29:44 +02:00
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<project default="dist" name="devinsy-utils">
2013-06-25 02:31:19 +02:00
<!--ANT 1.7 is required -->
2013-06-25 14:29:44 +02:00
<property file="build.properties" />
2013-06-20 02:05:11 +02:00
<property name="build.dir" value="${basedir}/build" />
2013-06-25 02:31:19 +02:00
<property name="build.src" value="${basedir}/src" />
<property name="build.classes" value="${build.dir}/classes" />
2013-06-25 14:29:44 +02:00
<property name="build.javadoc" value="${build.dir}/javadoc" />
2013-06-25 02:31:19 +02:00
<property name="test.src" value="${basedir}/test" />
<property name="test.classes" value="${build.dir}/test-classes" />
2013-06-25 14:29:44 +02:00
<property name="debug" value="on" />
2013-06-25 02:31:19 +02:00
<path id="build.classpath">
2013-06-25 14:29:44 +02:00
<fileset dir="lib" includes="**/*.jar" />
2013-06-25 02:31:19 +02:00
</path>
<path id="test.classpath.compile">
2013-06-25 14:29:44 +02:00
<path refid="build.classpath" />
<pathelement path="${build.classes}" />
2013-06-25 02:31:19 +02:00
</path>
<path id="test.classpath.run">
2013-06-25 14:29:44 +02:00
<path refid="test.classpath.compile" />
<pathelement path="${test.classes}" />
2013-06-25 02:31:19 +02:00
</path>
2013-06-25 14:29:44 +02:00
2013-06-25 02:55:12 +02:00
<!-- ***** Help ***** -->
2013-06-25 02:31:19 +02:00
<target name="help" description="Display detailed usage information">
<echo>Type ant -p</echo>
</target>
2013-06-20 02:05:11 +02:00
2013-06-25 02:31:19 +02:00
<!-- ***** Clean ***** -->
<target name="clean" description="Clean temporary directories">
2013-06-25 14:29:44 +02:00
<delete dir="${build.dir}" />
2013-06-25 02:31:19 +02:00
</target>
<!-- ***** Compile ***** -->
<target name="compile" description="Compile main code">
2013-06-25 14:29:44 +02:00
<mkdir dir="${build.dir}/classes" />
2013-06-25 02:31:19 +02:00
<javac srcdir="${build.src}" destdir="${build.classes}" debug="${debug}" deprecation="on" includeantruntime="false">
2013-06-25 14:29:44 +02:00
<classpath refid="test.classpath.compile" />
2013-06-25 02:31:19 +02:00
</javac>
</target>
<!-- ***** Compile test ***** -->
<target name="compile-test" description="Compile test code">
2013-06-25 14:29:44 +02:00
<mkdir dir="${test.classes}" />
2013-06-25 02:31:19 +02:00
<javac srcdir="${test.src}" destdir="${test.classes}" debug="${debug}" deprecation="on" includeantruntime="false">
2013-06-25 14:29:44 +02:00
<classpath refid="test.classpath.compile" />
2013-06-25 02:31:19 +02:00
</javac>
</target>
2013-06-25 14:29:44 +02:00
2013-06-25 02:31:19 +02:00
<!-- ***** Test ***** -->
<target name="test" description="Run unit tests" depends="clean,compile,compile-test">
2013-06-25 14:29:44 +02:00
<mkdir dir="${build.dir}/test-reports" />
<junit printsummary="yes" haltonfailure="no">
<classpath refid="test.classpath.run" />
2013-06-25 02:31:19 +02:00
<formatter type="plain" usefile="true" />
<batchtest fork="yes" todir="${build.dir}/test-reports/">
<fileset dir="test">
2013-06-25 14:29:44 +02:00
<include name="**/*Test.java" />
2013-06-25 02:31:19 +02:00
</fileset>
</batchtest>
</junit>
</target>
2013-06-25 14:29:44 +02:00
<!-- ***** JavaDoc ***** -->
<target name="javadoc" description="Javadoc construction">
<javadoc sourcepath="${build.src}" destdir="${build.javadoc}">
<classpath>
<fileset dir="lib" includes="**/*.jar" />
</classpath>
</javadoc>
</target>
2013-06-25 02:31:19 +02:00
<!-- ***** Dist ***** -->
2013-06-25 14:29:44 +02:00
<target name="dist" description="Build distribution" depends="clean,compile,javadoc">
2013-06-25 02:31:19 +02:00
<!-- -->
2013-06-25 14:29:44 +02:00
<buildnumber file="build.num" description="Id of the build" />
<!-- AUTOMATIC MANAGEMENT -->
2013-06-25 02:31:19 +02:00
<property name="dist.version" value="${product.revision.major}.${product.revision.minor}.${build.number}" />
<property name="dist.name" value="${product.name}-${dist.version}" />
2013-06-25 14:29:44 +02:00
<property name="dist.dir" value="${basedir}/dist/${dist.name}" />
2013-06-20 02:05:11 +02:00
2013-06-25 14:29:44 +02:00
<!-- -->
<mkdir dir="${dist.dir}" />
<!-- -->
<copy file="LICENSE" todir="${dist.dir}/" overwrite="true" />
<!-- Package main -->
2013-06-25 02:31:19 +02:00
<property name="dist.jar" value="${dist.dir}/${dist.name}.jar" />
<tstamp>
2013-06-25 14:29:44 +02:00
<format property="dist.time" pattern="dd/MM/yyyy HH:mm:ss" />
<!-- TODAY -->
2013-06-25 02:31:19 +02:00
</tstamp>
2013-06-25 14:29:44 +02:00
<jar destfile="${dist.jar}">
2013-06-25 02:31:19 +02:00
<manifest>
2013-06-25 14:29:44 +02:00
<attribute name="Built-By" value="${user.name} using ant" />
<attribute name="Built-Date" value="${dist.time}" />
2013-06-25 02:31:19 +02:00
</manifest>
2013-06-25 14:29:44 +02:00
<fileset dir="${build.classes}" />
<zipfileset dir="${basedir}/" includes="LICENSE" />
2013-06-20 02:05:11 +02:00
</jar>
2013-06-25 02:31:19 +02:00
<!-- Package sources -->
2013-06-25 14:29:44 +02:00
<property name="dist.srczip" value="${dist.dir}/${dist.name}-sources.zip" />
2013-06-25 02:31:19 +02:00
<zip destfile="${dist.srczip}" update="true" preserve0permissions="true">
2013-06-25 14:29:44 +02:00
<fileset dir="${basedir}/src" />
<zipfileset dir="${basedir}/" includes="LICENSE" />
</zip>
<!-- Package Javadoc -->
<property name="dist.javadoc.zip" value="${dist.dir}/${dist.name}-javadoc.zip" />
<zip destfile="${dist.javadoc.zip}" update="true" preserve0permissions="true">
<fileset dir="${build.javadoc}" />
<zipfileset dir="${basedir}/" includes="LICENSE" />
2013-06-20 02:05:11 +02:00
</zip>
2013-06-25 14:29:44 +02:00
<!-- Package lib -->
<copy todir="${dist.dir}/lib" overwrite="true">
<fileset dir="lib" />
</copy>
2013-06-25 02:31:19 +02:00
</target>
2013-06-20 02:05:11 +02:00
</project>