filebot/build.xml

131 lines
3.8 KiB
XML
Raw Normal View History

<?xml version="1.0"?>
<project name="FileBot" basedir="." default="fatjar">
<property name="title" value="${ant.project.name}" />
2008-06-09 18:41:06 +00:00
<property name="version" value="1.9" />
2008-06-09 18:41:06 +00:00
<property name="dir.source" location="${basedir}/source" />
<property name="dir.test" location="${basedir}/test" />
<property name="dir.build" location="${basedir}/build" />
<property name="dir.lib" location="${basedir}/lib" />
2008-06-09 18:41:06 +00:00
<property name="executable" location="${dir.build}/${title}.jar" />
2008-06-09 18:41:06 +00:00
<property name="lib.xerces" value="${dir.lib}/xercesImpl.jar" />
<property name="lib.nekohtml" value="${dir.lib}/nekohtml-1.9.7.jar" />
<property name="lib.simmetrics" value="${dir.lib}/simmetrics_jar_v1_6_2_d07_02_07.jar" />
<property name="lib.xmlrpc" value="${dir.lib}/xmlrpc-client-1.1.jar" />
<property name="lib.glazedlists" value="${dir.lib}/glazedlists-1.7.0_java15.jar" />
<property name="lib.junit" value="${dir.lib}/junit-4.4.jar" />
2008-06-09 18:41:06 +00:00
<target name="fatjar" depends="clean, build">
<jar destfile="${executable}" duplicate="fail">
2008-06-09 18:41:06 +00:00
<fileset dir="${dir.build}" />
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="Main" />
<attribute name="Version" value="${version}" />
</manifest>
2008-06-09 18:41:06 +00:00
<!-- include libs -->
<zipfileset src="${lib.xerces}">
<include name="org/apache/html/dom/**" />
<include name="org/apache/xerces/dom/**" />
<include name="org/apache/xerces/impl/**" />
<include name="org/apache/xerces/parsers/**" />
<include name="org/apache/xerces/util/**" />
<include name="org/apache/xerces/xni/**" />
<include name="org/apache/xerces/xs/**" />
</zipfileset>
2008-06-09 18:41:06 +00:00
<zipfileset src="${lib.nekohtml}">
<include name="**/*.class" />
<include name="**/*.properties" />
</zipfileset>
2008-06-09 18:41:06 +00:00
<zipfileset src="${lib.simmetrics}">
<include name="uk/ac/shef/wit/simmetrics/math/**" />
<include name="uk/ac/shef/wit/simmetrics/similaritymetrics/**" />
<include name="uk/ac/shef/wit/simmetrics/tokenisers/**" />
<include name="uk/ac/shef/wit/simmetrics/wordhandlers/**" />
</zipfileset>
<zipfileset src="${lib.xmlrpc}">
<include name="**/*.class" />
</zipfileset>
2008-06-09 18:41:06 +00:00
<!--
<zipfileset src="${lib.glazedlists}">
<include name="ca/odell/glazedlists/*.class" />
<include name="ca/odell/glazedlists/event/**" />
<include name="ca/odell/glazedlists/matchers/**" />
<include name="ca/odell/glazedlists/gui/**" />
<include name="ca/odell/glazedlists/swing/**" />
</zipfileset>
2008-06-09 18:41:06 +00:00
-->
</jar>
</target>
2008-06-09 18:41:06 +00:00
<target name="build">
<!-- create build dir -->
2008-06-09 18:41:06 +00:00
<mkdir dir="${dir.build}" />
<!-- compile -->
2008-06-09 18:41:06 +00:00
<javac srcdir="${dir.source}" destdir="${dir.build}">
<classpath>
2008-06-09 18:41:06 +00:00
<fileset dir="${dir.lib}" includes="*.jar" />
</classpath>
</javac>
<!-- copy resources -->
2008-06-09 18:41:06 +00:00
<copy todir="${dir.build}">
<fileset dir="${dir.source}">
<include name="**/*.png" />
<include name="**/*.gif" />
</fileset>
</copy>
</target>
2008-06-09 18:41:06 +00:00
<target name="build-test" depends="build">
<javac srcdir="${dir.test}" destdir="${dir.build}">
<classpath>
<fileset dir="${dir.lib}" includes="*.jar" />
</classpath>
</javac>
</target>
<target name="clean">
2008-06-09 18:41:06 +00:00
<delete file="${executable}" verbose="yes" />
<delete dir="${dir.build}" />
</target>
2008-06-09 18:41:06 +00:00
2008-06-09 18:41:06 +00:00
<target name="test" depends="clean, build-test, fatjar">
<junit printsummary="yes" fork="yes">
<classpath>
<pathelement location="${executable}"/>
<pathelement location="${lib.junit}"/>
</classpath>
<formatter type="plain" />
<test name="AllTests" outfile="test-report" />
</junit>
</target>
<target name="run" depends="fatjar">
2008-06-09 18:41:06 +00:00
<java jar="${executable}" fork="yes" />
</target>
</project>