324 lines
11 KiB
XML
324 lines
11 KiB
XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
<project name="FileBot" default="jar">
|
|
|
|
<property name="title" value="${ant.project.name}" />
|
|
<property name="version" value="r440" />
|
|
|
|
<tstamp>
|
|
<format property="today" pattern="yyyy-MM-dd" />
|
|
</tstamp>
|
|
|
|
<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" />
|
|
<property name="dir.installer" location="${basedir}/installer" />
|
|
|
|
<property name="path.fatjar" location="${dir.dist}/${title}_${version}.jar" />
|
|
<property name="path.appbundle.zip" location="${dir.dist}/${title}_${version}.app.zip" />
|
|
<property name="path.source.zip" location="${dir.dist}/filebot-${version}-src.zip" />
|
|
|
|
|
|
<target name="jar" depends="build">
|
|
<!-- create dist dir -->
|
|
<mkdir dir="${dir.dist}" />
|
|
|
|
<!-- 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>
|
|
|
|
<!-- source as zip -->
|
|
<zip destfile="${path.source.zip}">
|
|
<fileset dir="source" />
|
|
<fileset dir="test" />
|
|
</zip>
|
|
</target>
|
|
|
|
|
|
<target name="fatjar" depends="jar" description="Merge all class files into a single executable jar file">
|
|
<jar destfile="${path.fatjar}" filesetmanifest="merge" duplicate="fail">
|
|
<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>
|
|
|
|
<!-- include main jar -->
|
|
<zipfileset src="${dir.dist}/filebot.jar" />
|
|
|
|
<!-- include libs -->
|
|
<zipfileset src="${dir.lib}/xercesImpl.jar">
|
|
<include name="org/apache/**" />
|
|
<include name="org/w3c/dom/html/**" />
|
|
</zipfileset>
|
|
|
|
<zipfileset src="${dir.lib}/nekohtml.jar">
|
|
<include name="org/cyberneko/html/**" />
|
|
</zipfileset>
|
|
|
|
<zipfileset src="${dir.lib}/simmetrics.jar">
|
|
<include name="uk/ac/shef/wit/simmetrics/**" />
|
|
</zipfileset>
|
|
|
|
<zipfileset src="${dir.lib}/glazedlists.jar">
|
|
<include name="ca/odell/glazedlists/**" />
|
|
</zipfileset>
|
|
|
|
<zipfileset src="${dir.lib}/miglayout.jar">
|
|
<include name="net/miginfocom/**" />
|
|
</zipfileset>
|
|
|
|
<zipfileset src="${dir.lib}/xmlrpc.jar">
|
|
<include name="redstone/xmlrpc/**" />
|
|
</zipfileset>
|
|
|
|
<zipfileset src="${dir.lib}/args4j.jar">
|
|
<include name="org/kohsuke/args4j/**" />
|
|
</zipfileset>
|
|
|
|
<zipfileset src="${dir.lib}/ehcache.jar">
|
|
<include name="net/sf/ehcache/**" />
|
|
<include name="ehcache-failsafe.xml" />
|
|
<include name="ehcache-version.properties" />
|
|
</zipfileset>
|
|
|
|
<zipfileset src="${dir.lib}/slf4j.jar">
|
|
<include name="org/slf4j/**" />
|
|
</zipfileset>
|
|
|
|
<zipfileset src="${dir.lib}/slf4j-jdk.jar">
|
|
<include name="org/slf4j/**" />
|
|
</zipfileset>
|
|
|
|
<zipfileset src="${dir.lib}/jna.jar">
|
|
<!-- include classes and native libraries -->
|
|
<include name="com/sun/jna/**" />
|
|
</zipfileset>
|
|
|
|
<zipfileset src="${dir.lib}/groovy.jar">
|
|
<include name="groovy*/**" />
|
|
<include name="org/codehaus/groovy/**" />
|
|
<include name="META-INF/dgminfo" />
|
|
</zipfileset>
|
|
|
|
<zipfileset src="${dir.lib}/sublight-ws.jar">
|
|
<include name="net/sublight/webservice/**" />
|
|
</zipfileset>
|
|
|
|
<zipfileset src="${dir.lib}/junrar-custom.jar">
|
|
<include name="de/innosystec/unrar/**" />
|
|
</zipfileset>
|
|
</jar>
|
|
</target>
|
|
|
|
|
|
<target name="appbundle" depends="fatjar" description="Build an OSX application bundle">
|
|
<taskdef name="jarbundler" classname="net.sourceforge.jarbundler.JarBundler">
|
|
<classpath path="${dir.installer}/appbundle/jarbundler.jar" />
|
|
</taskdef>
|
|
|
|
<!-- build app bundle folder and add native libs -->
|
|
<jarbundler dir="${dir.dist}" name="${title}" version="${version}" icon="${dir.installer}/appbundle/icon.icns" bundleid="net.sourceforge.filebot" jar="${path.fatjar}" stubfile="${dir.installer}/appbundle/JavaApplicationStub" workingdirectory="$APP_PACKAGE/Contents/Resources/Java" mainclass="net.sourceforge.filebot.Main" jvmversion="1.6+" vmoptions="-Xmx256m" />
|
|
<copy todir="${dir.dist}/${title}.app/Contents/Resources/Java">
|
|
<fileset dir="${dir.lib}/native/mac-x86_64" includes="*.dylib" />
|
|
</copy>
|
|
|
|
<!-- application bundle folder as zip -->
|
|
<zip destfile="${path.appbundle.zip}">
|
|
<zipfileset dir="${dir.dist}" includes="${title}.app/**" excludes="**/JavaApplicationStub" />
|
|
<zipfileset dir="${dir.dist}" includes="${title}.app/**/JavaApplicationStub" filemode="744" /> <!-- application stub must be executable!! -->
|
|
</zip>
|
|
</target>
|
|
|
|
|
|
<target name="webstart" depends="jar" description="Build and compress jars used for webstart deployment">
|
|
<!-- create dirs -->
|
|
<mkdir dir="${dir.dist}/webstart" />
|
|
|
|
<!-- copy jnlp descriptors and icons -->
|
|
<copy todir="${dir.dist}/webstart">
|
|
<fileset dir="${dir.installer}/webstart" />
|
|
<fileset dir="${dir.installer}/icons" />
|
|
</copy>
|
|
|
|
<!-- 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>
|
|
|
|
<!-- 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">
|
|
<param name="arch" value="win32-x86" />
|
|
</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="mac-x86_64" />
|
|
</antcall>
|
|
|
|
<!-- sign main jar and native lib jars -->
|
|
<apply executable="pack200">
|
|
<!-- workaround for bug 6575373, see http://bugs.sun.com/view_bug.do?bug_id=6575373 -->
|
|
<arg line="--segment-limit=-1" />
|
|
<arg line="--repack" />
|
|
<srcfile />
|
|
<fileset dir="${dir.dist}/webstart" includes="filebot.jar" />
|
|
</apply>
|
|
|
|
<signjar alias="filebot" keystore="filebot.keystore" storepass="secret">
|
|
<fileset id="signjar" dir="${dir.dist}/webstart" includes="filebot.jar, native/*.jar" />
|
|
</signjar>
|
|
|
|
<!-- pack200 all jars -->
|
|
<apply executable="pack200" dest="${dir.dist}/webstart">
|
|
<!-- workaround for bug 6575373, see http://bugs.sun.com/view_bug.do?bug_id=6575373 -->
|
|
<arg line="--segment-limit=-1" />
|
|
<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>
|
|
|
|
|
|
<target name="build">
|
|
<!-- create build dir -->
|
|
<mkdir dir="${dir.build}" />
|
|
|
|
<!-- compile -->
|
|
<javac srcdir="${dir.source}:${dir.test}" destdir="${dir.build}" source="1.6" encoding="utf-8" includeAntRuntime="false">
|
|
<classpath>
|
|
<fileset dir="${dir.lib}" includes="*.jar" />
|
|
</classpath>
|
|
</javac>
|
|
|
|
<!-- copy resources -->
|
|
<copy todir="${dir.build}">
|
|
<fileset dir="${dir.source}">
|
|
<exclude name="**/*.java" />
|
|
</fileset>
|
|
</copy>
|
|
</target>
|
|
|
|
|
|
<target name="clean">
|
|
<delete dir="${dir.dist}" />
|
|
<delete dir="${dir.build}" />
|
|
</target>
|
|
|
|
|
|
<target name="test" depends="jar">
|
|
<junit printsummary="yes" fork="true">
|
|
<classpath>
|
|
<fileset dir="${dir.dist}" includes="*.jar" />
|
|
<fileset dir="${dir.lib}" includes="*.jar" />
|
|
</classpath>
|
|
|
|
<formatter type="plain" />
|
|
|
|
<test name="net.sourceforge.filebot.AllTests" outfile="test-report" />
|
|
</junit>
|
|
</target>
|
|
|
|
|
|
<target name="test-fatjar" depends="fatjar">
|
|
<junit printsummary="yes" fork="true">
|
|
<classpath>
|
|
<pathelement location="${path.fatjar}" />
|
|
<pathelement location="${dir.dist}/filebot-test.jar" />
|
|
<pathelement location="${dir.lib}/junit.jar" />
|
|
</classpath>
|
|
|
|
<formatter type="plain" />
|
|
|
|
<test name="net.sourceforge.filebot.AllTests" outfile="test-report" />
|
|
</junit>
|
|
</target>
|
|
|
|
|
|
<target name="run-fatjar" depends="fatjar">
|
|
<java jar="${path.fatjar}" fork="true" />
|
|
</target>
|
|
|
|
<target name="deploy">
|
|
<!-- ask for sourceforge password -->
|
|
<input message="Please enter password:" addproperty="sf.password" />
|
|
|
|
<!-- create fatjar release folder -->
|
|
<mkdir dir="${dir.dist}/release" />
|
|
|
|
<!-- copy fatjar and source -->
|
|
<copy todir="${dir.dist}/release/${title}_${version}" file="${path.fatjar}" />
|
|
<copy todir="${dir.dist}/release/${title}_${version}" file="${path.appbundle.zip}" />
|
|
<copy todir="${dir.dist}/release/${title}_${version}" file="${path.source.zip}" />
|
|
|
|
<!-- deploy source zip first so it will be the oldest file in the release folder -->
|
|
<scp todir="rednoah,filebot:${sf.password}@web.sourceforge.net:/home/frs/project/f/fi/filebot/filebot" trust="yes">
|
|
<fileset dir="${dir.dist}/release" includes="**/*-src.zip" />
|
|
</scp>
|
|
|
|
<!-- deploy fatjar -->
|
|
<sleep seconds="20" />
|
|
<scp todir="rednoah,filebot:${sf.password}@web.sourceforge.net:/home/frs/project/f/fi/filebot/filebot" trust="yes">
|
|
<fileset dir="${dir.dist}/release" includes="**/*.jar" />
|
|
</scp>
|
|
|
|
<!-- deploy osx app bundle -->
|
|
<sleep seconds="20" />
|
|
<scp todir="rednoah,filebot:${sf.password}@web.sourceforge.net:/home/frs/project/f/fi/filebot/filebot" trust="yes">
|
|
<fileset dir="${dir.dist}/release" includes="**/*.app.zip" />
|
|
</scp>
|
|
|
|
<!-- deploy webstart jars and jnlp descriptors -->
|
|
<scp todir="rednoah,filebot:${sf.password}@web.sourceforge.net:htdocs/webstart" trust="yes">
|
|
<fileset dir="${dir.dist}/webstart" />
|
|
</scp>
|
|
</target>
|
|
|
|
</project>
|