2009-05-21 06:00:48 -04:00
|
|
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
2008-12-31 15:11:27 -05:00
|
|
|
<project name="FileBot" default="jar">
|
2009-06-02 07:32:30 -04:00
|
|
|
|
2007-12-23 14:28:04 -05:00
|
|
|
<property name="title" value="${ant.project.name}" />
|
2008-12-31 15:11:27 -05:00
|
|
|
<property name="version" value="1.9" />
|
2007-12-23 14:28:04 -05:00
|
|
|
|
2008-12-31 15:11:27 -05:00
|
|
|
<tstamp>
|
|
|
|
<format property="today" pattern="yyyy-MM-dd" />
|
|
|
|
</tstamp>
|
2007-12-23 14:28:04 -05:00
|
|
|
|
2008-12-31 15:11:27 -05: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.dist" location="${basedir}/dist" />
|
|
|
|
<property name="dir.lib" location="${basedir}/lib" />
|
2008-02-13 15:08:06 -05:00
|
|
|
|
2007-12-23 14:28:04 -05:00
|
|
|
|
2008-12-31 15:11:27 -05:00
|
|
|
<target name="jar" depends="build">
|
2008-07-30 18:37:01 -04:00
|
|
|
<!-- create dist dir -->
|
|
|
|
<mkdir dir="${dir.dist}" />
|
2008-12-31 15:11:27 -05:00
|
|
|
|
|
|
|
<!-- main jar -->
|
|
|
|
<jar destfile="${dir.dist}/filebot.jar">
|
|
|
|
<fileset dir="${dir.build}" excludes="**/*Test*" />
|
|
|
|
</jar>
|
|
|
|
|
|
|
|
<!-- extra jar containing all the unit tests -->
|
|
|
|
<jar destfile="${dir.dist}/filebot-test.jar">
|
|
|
|
<fileset dir="${dir.build}" includes="**/*Test*" />
|
|
|
|
</jar>
|
2009-08-02 07:51:28 -04:00
|
|
|
|
|
|
|
<!-- source zip -->
|
|
|
|
<zip destfile="${dir.dist}/filebot-${version}-src.zip">
|
|
|
|
<fileset dir="source" />
|
|
|
|
<fileset dir="test" />
|
|
|
|
</zip>
|
2008-12-31 15:11:27 -05:00
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
|
|
<target name="fatjar" depends="jar">
|
|
|
|
<!-- create dist/fatjar dir -->
|
|
|
|
<mkdir dir="${dir.dist}/fatjar" />
|
|
|
|
|
2009-08-02 07:51:28 -04:00
|
|
|
<jar destfile="${dir.dist}/fatjar/FileBot_${version}.jar" filesetmanifest="merge" duplicate="fail">
|
2009-07-30 20:27:07 -04:00
|
|
|
<manifest>
|
|
|
|
<attribute name="Built-By" value="${user.name}" />
|
|
|
|
<attribute name="Built-Date" value="${today}" />
|
|
|
|
<attribute name="Application-Name" value="${title}" />
|
|
|
|
<attribute name="Application-Version" value="${version}" />
|
|
|
|
<attribute name="Main-Class" value="net.sourceforge.filebot.Main" />
|
|
|
|
</manifest>
|
|
|
|
|
2009-07-29 18:09:10 -04:00
|
|
|
<!-- include main jar -->
|
|
|
|
<zipfileset src="${dir.dist}/filebot.jar" />
|
2009-07-30 20:27:07 -04:00
|
|
|
|
2008-06-09 14:41:06 -04:00
|
|
|
<!-- include libs -->
|
2008-12-31 15:11:27 -05:00
|
|
|
<zipfileset src="${dir.lib}/xercesImpl.jar">
|
2009-04-11 19:27:10 -04:00
|
|
|
<include name="org/apache/**" />
|
|
|
|
<include name="org/w3c/dom/html/**" />
|
2007-12-23 14:28:04 -05:00
|
|
|
</zipfileset>
|
2009-06-02 07:32:30 -04:00
|
|
|
|
2008-12-31 15:11:27 -05:00
|
|
|
<zipfileset src="${dir.lib}/nekohtml.jar">
|
2009-04-11 19:27:10 -04:00
|
|
|
<include name="org/cyberneko/html/**" />
|
2008-02-13 15:08:06 -05:00
|
|
|
</zipfileset>
|
2009-06-02 07:32:30 -04:00
|
|
|
|
2008-12-31 15:11:27 -05:00
|
|
|
<zipfileset src="${dir.lib}/simmetrics.jar">
|
2009-04-11 19:27:10 -04:00
|
|
|
<include name="uk/ac/shef/wit/simmetrics/**" />
|
2008-06-09 14:41:06 -04:00
|
|
|
</zipfileset>
|
2009-06-02 07:32:30 -04:00
|
|
|
|
2008-12-31 15:11:27 -05:00
|
|
|
<zipfileset src="${dir.lib}/glazedlists.jar">
|
2009-04-11 19:27:10 -04:00
|
|
|
<include name="ca/odell/glazedlists/**" />
|
2008-10-12 16:25:23 -04:00
|
|
|
</zipfileset>
|
|
|
|
|
2008-12-31 15:11:27 -05:00
|
|
|
<zipfileset src="${dir.lib}/miglayout.jar">
|
2009-04-11 19:27:10 -04:00
|
|
|
<include name="net/miginfocom/**" />
|
2008-02-13 15:08:06 -05:00
|
|
|
</zipfileset>
|
2009-06-02 07:32:30 -04:00
|
|
|
|
2008-12-31 15:11:27 -05:00
|
|
|
<zipfileset src="${dir.lib}/xmlrpc-client.jar">
|
2009-04-11 19:27:10 -04:00
|
|
|
<include name="redstone/xmlrpc/**" />
|
2008-02-13 15:08:06 -05:00
|
|
|
</zipfileset>
|
2008-10-12 16:25:23 -04:00
|
|
|
|
2008-12-31 15:11:27 -05:00
|
|
|
<zipfileset src="${dir.lib}/args4j.jar">
|
2009-04-11 19:27:10 -04:00
|
|
|
<include name="org/kohsuke/args4j/**" />
|
2008-07-30 18:37:01 -04:00
|
|
|
</zipfileset>
|
2009-06-02 07:32:30 -04:00
|
|
|
|
2009-02-02 15:50:04 -05:00
|
|
|
<zipfileset src="${dir.lib}/ehcache.jar">
|
2009-04-11 19:27:10 -04:00
|
|
|
<include name="net/sf/ehcache/**" />
|
2009-04-05 06:08:00 -04:00
|
|
|
</zipfileset>
|
2009-06-02 07:32:30 -04:00
|
|
|
|
2009-04-05 06:08:00 -04:00
|
|
|
<zipfileset src="${dir.lib}/jna.jar">
|
|
|
|
<!-- include classes and native libraries -->
|
|
|
|
<include name="com/sun/jna/**" />
|
2009-04-11 19:27:10 -04:00
|
|
|
</zipfileset>
|
2009-06-02 07:32:30 -04:00
|
|
|
|
2009-04-11 19:27:10 -04:00
|
|
|
<zipfileset src="${dir.lib}/js-engine.jar">
|
|
|
|
<include name="com/sun/phobos/script/**" />
|
|
|
|
</zipfileset>
|
2009-06-02 07:32:30 -04:00
|
|
|
|
2009-04-11 19:27:10 -04:00
|
|
|
<zipfileset src="${dir.lib}/js.jar">
|
|
|
|
<include name="org/mozilla/**" />
|
|
|
|
</zipfileset>
|
2009-07-27 18:34:42 -04:00
|
|
|
|
2009-06-02 07:32:30 -04:00
|
|
|
<zipfileset src="${dir.lib}/sublight-ws.jar">
|
|
|
|
<include name="net/sublight/webservice/**" />
|
|
|
|
</zipfileset>
|
2009-07-27 18:34:42 -04:00
|
|
|
|
2009-06-30 16:49:09 -04:00
|
|
|
<zipfileset src="${dir.lib}/junrar-custom.jar">
|
|
|
|
<include name="de/innosystec/unrar/**" />
|
|
|
|
</zipfileset>
|
2009-07-27 18:34:42 -04:00
|
|
|
|
2009-06-30 16:49:09 -04:00
|
|
|
<zipfileset src="${dir.lib}/commons-logging.jar">
|
|
|
|
<include name="org/apache/commons/logging/**" />
|
|
|
|
</zipfileset>
|
2007-12-23 14:28:04 -05:00
|
|
|
</jar>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
2009-07-27 18:34:42 -04:00
|
|
|
<target name="webstart" depends="jar">
|
|
|
|
<!-- create dirs -->
|
|
|
|
<mkdir dir="${dir.dist}/webstart" />
|
|
|
|
|
|
|
|
<!-- copy jars -->
|
|
|
|
<copy todir="${dir.dist}/webstart">
|
|
|
|
<fileset dir="${dir.dist}" includes="filebot.jar" />
|
|
|
|
<fileset dir="${dir.lib}" includes="*.jar" excludes="junit.jar, jna.jar" />
|
|
|
|
</copy>
|
2009-08-02 07:51:28 -04:00
|
|
|
|
2009-07-27 18:34:42 -04:00
|
|
|
<!-- copy jna.jar without native libs -->
|
|
|
|
<jar destfile="${dir.dist}/webstart/jna.jar">
|
|
|
|
<zipfileset src="${dir.lib}/jna.jar" includes="**/*.class" />
|
|
|
|
</jar>
|
|
|
|
|
|
|
|
<!-- create native lib jars -->
|
|
|
|
<antcall target="webstart-nativelib">
|
2009-07-29 18:09:10 -04:00
|
|
|
<param name="arch" value="win32-x86" />
|
2009-07-27 18:34:42 -04:00
|
|
|
</antcall>
|
|
|
|
<antcall target="webstart-nativelib">
|
|
|
|
<param name="arch" value="win32-amd64" />
|
|
|
|
</antcall>
|
|
|
|
<antcall target="webstart-nativelib">
|
|
|
|
<param name="arch" value="linux-i386" />
|
|
|
|
</antcall>
|
|
|
|
<antcall target="webstart-nativelib">
|
|
|
|
<param name="arch" value="linux-amd64" />
|
|
|
|
</antcall>
|
|
|
|
<antcall target="webstart-nativelib">
|
|
|
|
<param name="arch" value="darwin" />
|
|
|
|
</antcall>
|
|
|
|
|
|
|
|
<!-- sign main jar and native lib jars -->
|
|
|
|
<fileset id="signjar" dir="${dir.dist}/webstart" includes="filebot.jar, native/*.jar" />
|
|
|
|
<apply executable="pack200">
|
|
|
|
<arg line="--repack" />
|
|
|
|
<srcfile />
|
|
|
|
<fileset refid="signjar" />
|
|
|
|
</apply>
|
|
|
|
<signjar alias="filebot" keystore="filebot.keystore" storepass="secret">
|
|
|
|
<fileset refid="signjar" />
|
|
|
|
</signjar>
|
|
|
|
|
|
|
|
<!-- pack200 all jars -->
|
|
|
|
<apply executable="pack200" dest="${dir.dist}/webstart">
|
|
|
|
<targetfile />
|
|
|
|
<srcfile />
|
|
|
|
<fileset dir="${dir.dist}/webstart" includes="*.jar" />
|
|
|
|
<mapper type="glob" from="*.jar" to="*.jar.pack.gz" />
|
|
|
|
</apply>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
|
|
<target name="webstart-nativelib">
|
|
|
|
<!-- create temp dir -->
|
|
|
|
<mkdir dir="${dir.dist}/webstart/native/${arch}" />
|
|
|
|
|
|
|
|
<!-- copy native libs to temp dir -->
|
|
|
|
<copy todir="${dir.dist}/webstart/native/${arch}" flatten="true">
|
|
|
|
<zipfileset src="${dir.lib}/jna.jar" includes="com/sun/jna/${arch}/*" />
|
|
|
|
<fileset dir="${dir.lib}/native" includes="${arch}/*" />
|
|
|
|
</copy>
|
|
|
|
|
|
|
|
<!-- create native lib jar -->
|
|
|
|
<jar destfile="${dir.dist}/webstart/native/${arch}.jar" basedir="${dir.dist}/webstart/native/${arch}" />
|
|
|
|
|
|
|
|
<!-- delete temp dir -->
|
|
|
|
<delete dir="${dir.dist}/webstart/native/${arch}" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
|
|
<target name="genkey">
|
|
|
|
<genkey alias="filebot" keystore="filebot.keystore" storepass="secret" validity="3650" dname="CN=${user.name}" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
2008-06-09 14:41:06 -04:00
|
|
|
<target name="build">
|
2007-12-23 14:28:04 -05:00
|
|
|
<!-- create build dir -->
|
2008-06-09 14:41:06 -04:00
|
|
|
<mkdir dir="${dir.build}" />
|
2007-12-23 14:28:04 -05:00
|
|
|
|
|
|
|
<!-- compile -->
|
2008-12-31 15:11:27 -05:00
|
|
|
<javac srcdir="${dir.source}:${dir.test}" destdir="${dir.build}" source="1.6" encoding="utf-8">
|
2007-12-23 14:28:04 -05:00
|
|
|
<classpath>
|
2008-06-09 14:41:06 -04:00
|
|
|
<fileset dir="${dir.lib}" includes="*.jar" />
|
2007-12-23 14:28:04 -05:00
|
|
|
</classpath>
|
|
|
|
</javac>
|
2009-06-02 07:32:30 -04:00
|
|
|
|
2007-12-23 14:28:04 -05:00
|
|
|
<!-- copy resources -->
|
2008-06-09 14:41:06 -04:00
|
|
|
<copy todir="${dir.build}">
|
|
|
|
<fileset dir="${dir.source}">
|
2009-07-27 18:34:42 -04:00
|
|
|
<exclude name="**/*.java" />
|
2007-12-23 14:28:04 -05:00
|
|
|
</fileset>
|
|
|
|
</copy>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
|
|
<target name="clean">
|
2008-07-30 18:37:01 -04:00
|
|
|
<delete dir="${dir.dist}" />
|
2008-06-09 14:41:06 -04:00
|
|
|
<delete dir="${dir.build}" />
|
2007-12-23 14:28:04 -05:00
|
|
|
</target>
|
|
|
|
|
2008-12-31 15:11:27 -05:00
|
|
|
|
|
|
|
<target name="test" depends="jar">
|
|
|
|
<junit printsummary="yes" fork="true">
|
2008-06-09 14:41:06 -04:00
|
|
|
<classpath>
|
2008-12-31 15:11:27 -05:00
|
|
|
<fileset dir="${dir.dist}" includes="*.jar" />
|
|
|
|
<fileset dir="${dir.lib}" includes="*.jar" />
|
2008-06-09 14:41:06 -04:00
|
|
|
</classpath>
|
2008-12-31 15:11:27 -05:00
|
|
|
|
2008-06-09 14:41:06 -04:00
|
|
|
<formatter type="plain" />
|
2008-12-31 15:11:27 -05:00
|
|
|
|
|
|
|
<test name="net.sourceforge.filebot.AllTests" outfile="test-report" />
|
2008-06-09 14:41:06 -04:00
|
|
|
</junit>
|
|
|
|
</target>
|
2008-12-31 15:11:27 -05:00
|
|
|
|
2009-06-02 07:32:30 -04:00
|
|
|
|
2008-12-31 15:11:27 -05:00
|
|
|
<target name="test-fatjar" depends="fatjar">
|
|
|
|
<junit printsummary="yes" fork="true">
|
|
|
|
<classpath>
|
|
|
|
<pathelement location="${dir.dist}/fatjar/FileBot.jar" />
|
|
|
|
<pathelement location="${dir.dist}/filebot-test.jar" />
|
|
|
|
<pathelement location="${dir.lib}/junit.jar" />
|
|
|
|
</classpath>
|
2009-06-02 07:32:30 -04:00
|
|
|
|
2008-12-31 15:11:27 -05:00
|
|
|
<formatter type="plain" />
|
2008-03-02 12:02:37 -05:00
|
|
|
|
2008-12-31 15:11:27 -05:00
|
|
|
<test name="net.sourceforge.filebot.AllTests" outfile="test-report" />
|
|
|
|
</junit>
|
|
|
|
</target>
|
2009-06-02 07:32:30 -04:00
|
|
|
|
|
|
|
|
2009-02-15 16:11:03 -05:00
|
|
|
<target name="run-fatjar" depends="fatjar">
|
|
|
|
<java jar="${dir.dist}/fatjar/FileBot.jar" fork="true" />
|
|
|
|
</target>
|
2009-06-02 07:32:30 -04:00
|
|
|
|
2008-03-02 12:02:37 -05:00
|
|
|
</project>
|