filebot/build.xml

683 lines
28 KiB
XML
Raw Normal View History

2009-05-21 10:00:48 +00:00
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<project name="filebot" default="fatjar">
2012-11-23 04:27:54 +00:00
<!-- include default inputs (optional) -->
<property file="profile.properties" />
2011-11-09 11:57:54 +00:00
<!-- include application properties -->
<property file="source/net/sourceforge/filebot/Settings.properties" />
<property name="title" value="${application.name}" />
<property name="version" value="${application.version}" />
<tstamp>
<format property="today" pattern="yyyy-MM-dd" />
</tstamp>
2011-11-09 11:57:54 +00:00
2011-11-09 02:57:10 +00:00
<!-- define source dirs -->
<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.website" location="${basedir}/website" />
<property name="dir.installer" location="${basedir}/installer" />
2011-11-09 02:57:10 +00:00
<!-- define output paths -->
<property name="path.fatjar" location="${dir.dist}/${title}_${version}.jar" />
<property name="path.appbundle.tar.gz" location="${dir.dist}/${title}_${version}.app.tar.gz" />
<property name="path.ubuntu-binary.tar.gz" location="${dir.dist}/filebot-${version}-ubuntu.tar.gz" />
<property name="path.source.zip" location="${dir.dist}/filebot-${version}-src.zip" />
<property name="deploy.release" value="web.sourceforge.net:/home/frs/project/f/fi/filebot/filebot" />
<property name="deploy.website" value="web.sourceforge.net:htdocs" />
<property name="deploy.data.frs" value="web.sourceforge.net:/home/frs/project/f/fi/filebot/data" />
2012-11-23 04:27:54 +00:00
<target name="jar" depends="build">
<!-- create dist dir -->
<mkdir dir="${dir.dist}" />
<!-- main jar -->
<jar destfile="${dir.dist}/filebot.jar">
2011-12-14 12:18:06 +00:00
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Built-Date" value="${today}" />
<attribute name="Built-Revision" value="${svn.revision}" />
<attribute name="Application-Name" value="${title}" />
<attribute name="Application-Version" value="${version}" />
<attribute name="Main-Class" value="net.sourceforge.filebot.Main" />
</manifest>
<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 11:51:28 +00:00
<!-- source as zip -->
<zip destfile="${path.source.zip}">
2009-08-02 11:51:28 +00:00
<fileset dir="source" />
<fileset dir="test" />
</zip>
</target>
<target name="fatjar" depends="jar" description="Merge all class files into a single executable jar file">
2013-11-07 07:53:07 +00:00
<jar destfile="${path.fatjar}" filesetmanifest="merge" duplicate="fail" index="yes">
2009-07-29 22:09:10 +00:00
<!-- include main jar -->
<zipfileset src="${dir.dist}/filebot.jar" />
2008-06-09 18:41:06 +00:00
<!-- 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>
2013-08-04 13:12:45 +00:00
<zipfileset src="${dir.lib}/jsoup.jar">
<include name="org/jsoup/**" />
</zipfileset>
<zipfileset src="${dir.lib}/json-simple.jar">
<include name="org/json/simple/**" />
</zipfileset>
<zipfileset src="${dir.lib}/json-io.jar">
2013-02-22 18:31:06 +00:00
<include name="com/cedarsoftware/util/**" />
</zipfileset>
<zipfileset src="${dir.lib}/simmetrics.jar">
<include name="uk/ac/shef/wit/simmetrics/**" />
2008-06-09 18:41:06 +00:00
</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}/rsyntaxtextarea.jar">
<include name="org/fife/**" />
</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}/xz.jar">
<include name="org/tukaani/xz/**" />
</zipfileset>
<zipfileset src="${dir.lib}/ehcache.jar">
<include name="META-INF/services/**" />
<include name="net/sf/ehcache/**" />
<include name="org/terracotta/**" />
<include name="ehcache-failsafe.xml" />
<include name="build-info.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}/commons-io.jar">
<include name="org/apache/commons/io/**" />
2011-11-26 07:53:00 +00:00
</zipfileset>
<!-- include classes and native libraries -->
<zipfileset src="${dir.lib}/jna.jar">
<include name="com/sun/jna/**" />
</zipfileset>
<zipfileset src="${dir.lib}/platform.jar">
<include name="com/sun/jna/platform/win32/**" />
</zipfileset>
<zipfileset src="${dir.lib}/groovy.jar">
<include name="groovy*/**" />
<include name="org/codehaus/groovy/**" />
<include name="META-INF/dgminfo" />
<include name="META-INF/services/**" />
<include name="META-INF/*.properties" />
</zipfileset>
<zipfileset src="${dir.lib}/icu4j.jar">
<include name="com/ibm/icu/**" />
</zipfileset>
<zipfileset src="${dir.lib}/jacksum.jar">
<include name="jonelo/jacksum/adapt/**" />
<include name="jonelo/jacksum/algorithm/**" />
<include name="jonelo/sugar/util/**" />
</zipfileset>
<zipfileset src="${dir.lib}/junrar-custom.jar">
<include name="de/innosystec/unrar/**" />
</zipfileset>
2011-09-21 13:40:46 +00:00
<zipfileset src="${dir.lib}/jgat-custom.jar">
<include name="com/dmurph/tracking/**" />
</zipfileset>
<zipfileset src="${dir.lib}/sevenzipjbinding.jar">
<include name="net/sf/sevenzipjbinding/**" />
</zipfileset>
<!-- Ivy for @Grapes automatic dependency management -->
<zipfileset src="${dir.lib}/scripting/ivy.jar">
<include name="org/apache/ivy/**" />
</zipfileset>
<!-- AntBuilder including dependencies for ant-javamail, ant-commons-net and ant-jsch -->
<zipfileset src="${dir.lib}/scripting/ant.jar">
<include name="org/apache/tools/**" />
</zipfileset>
<zipfileset src="${dir.lib}/scripting/ant-launcher.jar">
<include name="org/apache/tools/**" />
</zipfileset>
<zipfileset src="${dir.lib}/scripting/ant-commons-net.jar">
<include name="org/apache/tools/**" />
</zipfileset>
<zipfileset src="${dir.lib}/scripting/ant-jsch.jar">
<include name="org/apache/tools/**" />
</zipfileset>
<zipfileset src="${dir.lib}/scripting/ant-javamail.jar">
<include name="org/apache/tools/**" />
</zipfileset>
<zipfileset src="${dir.lib}/scripting/commons-net.jar">
<include name="org/apache/commons/net/**" />
</zipfileset>
<zipfileset src="${dir.lib}/scripting/jsch.jar">
<include name="com/jcraft/jsch/**" />
</zipfileset>
<zipfileset src="${dir.lib}/scripting/mail.jar">
<include name="javax/mail/**" />
<include name="com/sun/mail/**" />
<include name="META-INF/*mail*" />
</zipfileset>
</jar>
</target>
<target name="appbundle" depends="fatjar" description="Build an OSX application bundle">
2011-12-13 15:26:17 +00:00
<taskdef name="jarbundler" classname="net.sourceforge.jarbundler.JarBundler" classpath="${dir.lib}/build/jarbundler.jar" />
<copy tofile="${dir.dist}/appbundle/FileBot.jar" file="${path.fatjar}" />
<!-- build app bundle folder and add native libs -->
<jarbundler dir="${dir.dist}" name="${title}" version="${version}" build="${svn.revision}" icon="${dir.installer}/appbundle/icon.icns" bundleid="net.sourceforge.filebot" jar="${dir.dist}/appbundle/FileBot.jar" stubfile="${dir.installer}/appbundle/JavaApplicationStub" workingdirectory="$JAVAROOT" mainclass="net.sourceforge.filebot.Main" jvmversion="1.6+">
<javaproperty name="application.deployment" value="app" />
<javaproperty name="unixfs" value="false" />
<javaproperty name="useExtendedFileAttributes" value="true" />
<javaproperty name="net.sourceforge.filebot.AcoustID.fpcalc" value="$JAVAROOT/fpcalc" />
<javaproperty name="jna.library.path" value="$JAVAROOT" />
<javaproperty name="java.library.path" value="$JAVAROOT" />
<javaproperty name="java.net.useSystemProxies" value="true" />
2012-08-25 09:28:10 +00:00
<javaproperty name="sun.net.client.defaultConnectTimeout" value="10000" />
<javaproperty name="sun.net.client.defaultReadTimeout" value="60000" />
</jarbundler>
<!-- shell scripts -->
<copy todir="${dir.dist}/${title}.app/Contents/MacOS" file="${dir.installer}/appbundle/filebot" />
<copy todir="${dir.dist}/${title}.app/Contents/MacOS" file="${dir.installer}/appbundle/install.sh" />
<copy todir="${dir.dist}/${title}.app/Contents/Resources/Java">
<fileset dir="${dir.lib}/native/mac-x86_64" includes="*.dylib" />
</copy>
<!-- application bundle folder as .tar.gz -->
<tar destfile="${path.appbundle.tar.gz}" compression="gzip">
<tarfileset dir="${dir.dist}" includes="${title}.app/**" excludes="**/MacOS/**" />
<!-- IMPORTANT application stub must be executable!! -->
2013-01-10 19:13:21 +00:00
<tarfileset dir="${dir.dist}" includes="${title}.app/**/MacOS/**" filemode="755" />
<tarfileset dir="${dir.lib}/native/mac-x86_64" includes="fpcalc" filemode="755" prefix="${title}.app/Contents/Resources/Java" />
</tar>
</target>
2013-07-09 08:07:54 +00:00
<target name="ppa-binary" depends="svn-update, fatjar">
<tar longfile="gnu" compression="gzip" destfile="${path.ubuntu-binary.tar.gz}">
<tarfileset fullpath="i386/opt/filebot/FileBot.jar" file="${path.fatjar}" />
<tarfileset fullpath="amd64/opt/filebot/FileBot.jar" file="${path.fatjar}" />
<tarfileset prefix="i386/opt/filebot" dir="${dir.lib}/native/linux-i386" includes="*.so" />
<tarfileset prefix="amd64/opt/filebot" dir="${dir.lib}/native/linux-amd64" includes="*.so" />
<tarfileset prefix="i386/opt/filebot/bin" file="${dir.installer}/ubuntu/filebot.sh" filemode="755" />
<tarfileset prefix="amd64/opt/filebot/bin" file="${dir.installer}/ubuntu/filebot.sh" filemode="755" />
2013-02-08 04:45:54 +00:00
<tarfileset fullpath="filebot.desktop" file="${dir.installer}/ubuntu/FileBot.desktop" />
<tarfileset fullpath="filebot.svg" file="${dir.installer}/icons/icon.svg" />
</tar>
</target>
<target name="deb" depends="fatjar" description="Build debian package for i386 and amd64">
2011-11-29 03:18:49 +00:00
<taskdef resource="ant_deb_task.properties" classpath="${dir.lib}/build/ant-deb.jar" />
<antcall target="deb-arch">
<param name="arch" value="i386" />
</antcall>
<antcall target="deb-arch">
<param name="arch" value="amd64" />
</antcall>
</target>
<target name="deb-arch">
<deb todir="${dir.dist}" package="filebot" version="${version}" architecture="${arch}" section="misc" depends="openjdk-7-jre | openjdk-7-jre-headless" homepage="http://www.filebot.net" priority="optional" postinst="${dir.installer}/deb/postinst.sh" prerm="${dir.installer}/deb/prerem.sh">
2011-12-07 05:51:08 +00:00
<maintainer name="Reinhard Pointner" email="rednoah@users.sourceforge.net" />
<description synopsis="The ultimate TV and Movie Renamer">FileBot is the ultimate tool for renaming your movies, tv shows or anime and even downloading subtitles. It's smart, streamlined for simplicity and just works. Putting the super-efficient UI aside, it's also got a full-featured command-line interface and scripting engine for all sorts of automation. Anything is possible.</description>
<tarfileset fullpath="usr/share/filebot/FileBot.jar" file="${path.fatjar}" />
<tarfileset prefix="usr/share/filebot" dir="${dir.lib}/native/linux-${arch}" includes="*.so" />
<tarfileset prefix="usr/share/filebot" file="${dir.lib}/native/linux-${arch}/fpcalc" filemode="755" />
<tarfileset prefix="usr/share/filebot" file="${dir.installer}/icons/icon.svg" />
<tarfileset prefix="usr/share/filebot/bin" file="${dir.installer}/deb/filebot.sh" filemode="755" />
<tarfileset prefix="usr/share/applications" file="${dir.installer}/deb/FileBot.desktop" />
</deb>
</target>
<target name="ipkg" depends="fatjar" description="Build ipkg package for ARM and ATOM">
2012-05-08 01:23:32 +00:00
<taskdef resource="ant_deb_task.properties" classpath="${dir.lib}/build/ant-deb.jar" />
<antcall target="ipkg-arch">
<param name="arch" value="arm" />
</antcall>
<antcall target="ipkg-arch">
<param name="arch" value="i686" />
</antcall>
</target>
<target name="ipkg-arch">
<deb todir="${dir.dist}" package="filebot" version="${version}" architecture="${arch}" section="misc" homepage="http://www.filebot.net" priority="optional" postinst="${dir.installer}/ipkg/postinst.sh" prerm="${dir.installer}/ipkg/prerem.sh">
<maintainer name="Reinhard Pointner" email="rednoah@users.sourceforge.net" />
<description synopsis="The ultimate TV and Movie Renamer">FileBot is the ultimate tool for renaming your movies, tv shows or anime and even downloading subtitles. It's smart, streamlined for simplicity and just works. Putting the super-efficient UI aside, it's also got a full-featured command-line interface and scripting engine for all sorts of automation. Anything is possible.</description>
2013-03-05 16:14:36 +00:00
<tarfileset fullpath="opt/usr/share/filebot/FileBot.jar" file="${path.fatjar}" />
<tarfileset prefix="opt/usr/share/filebot" dir="${dir.lib}/native/linux-${arch}" includes="*.so" />
<tarfileset prefix="opt/usr/share/filebot" file="${dir.lib}/native/linux-${arch}/fpcalc" filemode="755" />
2013-03-05 16:14:36 +00:00
<tarfileset prefix="opt/usr/share/filebot/bin" file="${dir.installer}/ipkg/filebot.sh" filemode="755" />
2012-05-14 19:15:22 +00:00
</deb>
<move tofile="${dir.dist}/filebot_${version}_${arch}.ipk" file="${dir.dist}/filebot_${version}_${arch}.deb" overwrite="true" />
2012-05-14 19:15:22 +00:00
</target>
2010-11-06 11:01:19 +00:00
<target name="msi" depends="fatjar" description="Build Windows Installer for x86 and x64">
<antcall target="msi-arch">
2010-11-06 11:01:19 +00:00
<param name="arch" value="x86" />
<param name="libgcc_name" value="mingwm10.dll" />
2010-11-06 11:01:19 +00:00
</antcall>
<antcall target="msi-arch">
2010-11-06 11:01:19 +00:00
<param name="arch" value="x64" />
<param name="libgcc_name" value="libgcc_s_sjlj-1.dll" />
2010-11-06 11:01:19 +00:00
</antcall>
</target>
<target name="msi-arch">
<property name="jnidispatch" location="${dir.lib}/native/win32-${arch}/jnidispatch.dll" />
2010-11-06 11:01:19 +00:00
<property name="mediainfo" location="${dir.lib}/native/win32-${arch}/MediaInfo.dll" />
<property name="lib7z_binding" location="${dir.lib}/native/win32-${arch}/7-Zip-JBinding.dll" />
<property name="libgcc_path" location="${dir.lib}/native/win32-${arch}/${libgcc_name}" />
<property name="fpcalc_path" location="${dir.lib}/native/win32-${arch}/fpcalc.exe" />
<property name="installer" location="${dir.dist}/FileBot_${version}_${arch}.msi" />
2010-11-06 11:01:19 +00:00
<exec executable="candle.exe" dir="${dir.installer}/msi" failonerror="true">
<arg line="filebot-wix.xml -out ${dir.dist}/msi.wixobj -darch=${arch} -dreleaseversion=${version} -dfatjar=${path.fatjar} -djnidispatch=${jnidispatch} -dmediainfo=${mediainfo} -dlib7z_binding=${lib7z_binding} -dlibgcc_name=${libgcc_name} -dlibgcc_path=${libgcc_path} -dfpcalc_path=${fpcalc_path}" />
2010-11-06 11:01:19 +00:00
</exec>
<exec executable="light.exe" dir="${dir.installer}/msi" failonerror="true">
<arg line="${dir.dist}/msi.wixobj -sval -ext WixUIExtension -out ${installer}" />
</exec>
</target>
2011-12-28 13:51:36 +00:00
<target name="portable" depends="fatjar" description="Portable application package">
<mkdir dir="${dir.dist}/portable" />
2011-12-28 13:51:36 +00:00
<copy file="${path.fatjar}" tofile="${dir.dist}/portable/FileBot.jar" />
<copy todir="${dir.dist}/portable">
2012-11-04 02:10:27 +00:00
<fileset dir="${dir.installer}/portable" includes="*.exe, *.ini, *.cmd, *.sh" />
2011-12-28 13:51:36 +00:00
</copy>
2011-12-28 13:51:36 +00:00
<zip destfile="${dir.dist}/FileBot_${version}-portable.zip">
2012-11-04 02:10:27 +00:00
<zipfileset dir="${dir.dist}/portable" includes="*.jar, *.exe, *.ini, *.cmd" />
2011-12-28 13:51:36 +00:00
<zipfileset dir="${dir.dist}/portable" includes="*.sh" filemode="755" />
</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">
2011-11-09 02:57:10 +00:00
<fileset dir="${dir.lib}" includes="*.jar" excludes="jna.jar" />
</copy>
2009-08-02 11:51:28 +00:00
<!-- copy jna.jar without native libs -->
<jar destfile="${dir.dist}/webstart/jna.jar">
<zipfileset src="${dir.lib}/jna.jar" includes="**/*.class" />
</jar>
<!-- create mediainfo jar as seperate jar and use as trigger for lazy loading the native libs -->
<jar destfile="${dir.dist}/webstart/mediainfo.jar">
<fileset dir="${dir.build}" includes="net/sourceforge/filebot/mediainfo/**" />
</jar>
<!-- create indexed main jar -->
<jar destfile="${dir.dist}/webstart/filebot.jar" index="yes">
<fileset dir="${dir.build}" excludes="**/*Test*, net/sourceforge/filebot/mediainfo/**" />
<indexjars>
<!-- IMPORTANT if groovy is indexed things break during runtime!! -->
<fileset dir="${dir.dist}/webstart" includes="**/*.jar" excludes="filebot.jar, groovy.jar" />
</indexjars>
</jar>
<!-- create native lib jars -->
<antcall target="webstart-nativelib">
2009-07-29 22:09:10 +00:00
<param name="arch" value="win32-x86" />
</antcall>
<antcall target="webstart-nativelib">
2010-11-06 11:01:19 +00:00
<param name="arch" value="win32-x64" />
</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>
2011-12-07 21:56:43 +00:00
<!-- sign all 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 />
2011-12-07 21:56:43 +00:00
<fileset dir="${dir.dist}/webstart" includes="**/*.jar" />
</apply>
<signjar alias="filebot" keystore="filebot.keystore" storepass="secret">
2011-12-07 21:56:43 +00:00
<fileset id="signjar" dir="${dir.dist}/webstart" includes="**/*.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}/*" />
2013-01-10 19:13:21 +00:00
<fileset dir="${dir.lib}/native">
<include name="${arch}/**.dll" />
<include name="${arch}/**.dylib" />
<include name="${arch}/**.so" />
</fileset>
</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 18:41:06 +00:00
<target name="build">
<!-- create build dir -->
2008-06-09 18:41:06 +00:00
<mkdir dir="${dir.build}" />
<!-- compile -->
2013-10-12 14:07:12 +00:00
<javac srcdir="${dir.source}:${dir.test}" destdir="${dir.build}" target="1.6" source="1.6" encoding="utf-8" debug="true" debuglevel="lines,vars,source" includeAntRuntime="false">
<classpath>
2008-06-09 18:41:06 +00:00
<fileset dir="${dir.lib}" includes="*.jar" />
2011-11-09 02:57:10 +00:00
<pathelement location="${dir.lib}/build/junit.jar" />
</classpath>
</javac>
<!-- copy resources -->
2008-06-09 18:41:06 +00:00
<copy todir="${dir.build}">
<fileset dir="${dir.source}">
<exclude name="**/*.java" />
</fileset>
</copy>
<!-- update application properties -->
<replace dir="${dir.build}" encoding="utf-8" summary="yes">
<include name="**/*.properties" />
<replacefilter token="@{svn.revision}" value="${svn.revision}" />
</replace>
</target>
<target name="clean">
<delete dir="${dir.dist}" />
2008-06-09 18:41:06 +00:00
<delete dir="${dir.build}" />
</target>
<target name="test" depends="jar">
<junit printsummary="yes" fork="true">
2008-06-09 18:41:06 +00:00
<classpath>
<fileset dir="${dir.dist}" includes="*.jar" />
<fileset dir="${dir.lib}" includes="*.jar" />
2011-11-09 02:57:10 +00:00
<pathelement location="${dir.lib}/build/junit.jar" />
2008-06-09 18:41:06 +00:00
</classpath>
<formatter type="plain" />
<test name="net.sourceforge.filebot.AllTests" outfile="test-report" />
2008-06-09 18:41:06 +00:00
</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" />
2011-11-09 02:57:10 +00:00
<pathelement location="${dir.lib}/build/junit.jar" />
</classpath>
<formatter type="plain" />
<test name="net.sourceforge.filebot.AllTests" outfile="test-report" />
</junit>
</target>
2012-12-01 15:57:10 +00:00
<target name="svn-update" depends="login">
<taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpath="${dir.lib}/groovy.jar" />
<groovy>
2012-12-01 15:57:10 +00:00
properties['svn.revision'] = "svn update --password ${properties['sf.password']}".execute().text.split(/\n/).last().replaceAll(/\D/, '')
</groovy>
<fail unless="svn.revision" />
2011-11-09 11:18:38 +00:00
<echo>Revision: ${svn.revision}</echo>
</target>
<target name="deploy-release" depends="svn-update, fatjar, appbundle, deb, ipkg, msi, portable, webstart, login">
<mkdir dir="${dir.dist}/release" />
2011-08-31 11:10:43 +00:00
<!-- prepare release packages -->
<copy todir="${dir.dist}/release/${title}_${version}" file="${path.fatjar}" />
<copy todir="${dir.dist}/release/${title}_${version}" file="${path.appbundle.tar.gz}" />
<copy todir="${dir.dist}/release/${title}_${version}" file="${dir.dist}/filebot_${version}_i386.deb" />
<copy todir="${dir.dist}/release/${title}_${version}" file="${dir.dist}/filebot_${version}_amd64.deb" />
2012-05-08 01:23:32 +00:00
<copy todir="${dir.dist}/release/${title}_${version}" file="${dir.dist}/filebot_${version}_arm.ipk" />
2012-05-14 19:15:22 +00:00
<copy todir="${dir.dist}/release/${title}_${version}" file="${dir.dist}/filebot_${version}_i686.ipk" />
<copy todir="${dir.dist}/release/${title}_${version}" file="${dir.dist}/FileBot_${version}_x86.msi" />
<copy todir="${dir.dist}/release/${title}_${version}" file="${dir.dist}/FileBot_${version}_x64.msi" />
2011-12-28 13:51:36 +00:00
<copy todir="${dir.dist}/release/${title}_${version}" file="${dir.dist}/FileBot_${version}-portable.zip" />
<!-- deploy fatjar -->
<sleep seconds="5" />
<scp todir="${sf.user}:${sf.password}@${deploy.release}" trust="yes" verbose="true" sftp="true">
<fileset dir="${dir.dist}/release" includes="**/*.jar" />
</scp>
2011-12-28 13:51:36 +00:00
<!-- deploy portable application package -->
<sleep seconds="5" />
<scp todir="${sf.user}:${sf.password}@${deploy.release}" trust="yes" verbose="true" sftp="true">
2011-12-28 13:51:36 +00:00
<fileset dir="${dir.dist}/release" includes="**/*-portable.zip" />
</scp>
2010-11-06 11:01:19 +00:00
<!-- deploy windows installers -->
<sleep seconds="5" />
<scp todir="${sf.user}:${sf.password}@${deploy.release}" trust="yes" verbose="true" sftp="true">
2010-11-06 11:01:19 +00:00
<fileset dir="${dir.dist}/release" includes="**/*.msi" />
</scp>
<!-- deploy debian packages -->
<sleep seconds="5" />
<scp todir="${sf.user}:${sf.password}@${deploy.release}" trust="yes" verbose="true" sftp="true">
<fileset dir="${dir.dist}/release" includes="**/*.deb" />
</scp>
2012-05-08 01:23:32 +00:00
<!-- deploy ipkg packages -->
<sleep seconds="5" />
<scp todir="${sf.user}:${sf.password}@${deploy.release}" trust="yes" verbose="true" sftp="true">
2012-05-08 01:23:32 +00:00
<fileset dir="${dir.dist}/release" includes="**/*.ipk" />
</scp>
<!-- deploy osx app bundle -->
<sleep seconds="5" />
<scp todir="${sf.user}:${sf.password}@${deploy.release}" trust="yes" verbose="true" sftp="true">
<fileset dir="${dir.dist}/release" includes="**/*.app.tar.gz" />
</scp>
<!-- deploy webstart jars and jnlp descriptors -->
<scp todir="${sf.user}:${sf.password}@${deploy.website}/webstart" trust="yes" verbose="true" sftp="true">
<fileset dir="${dir.dist}/webstart" />
</scp>
</target>
<target name="deploy-website" depends="login">
2011-08-31 11:10:43 +00:00
<!-- prepare website resources -->
<copy todir="${dir.dist}/website">
<fileset dir="${dir.website}">
2012-12-14 15:32:27 +00:00
<include name="*.json" />
2011-12-24 10:57:36 +00:00
<include name="*.xml" />
<include name="*.php" />
<include name="*.html" />
<include name="*.css" />
<include name="*.js" />
<include name="*.png" />
<include name="*.ico" />
<include name="images/**" />
2011-12-14 12:18:06 +00:00
<include name="screenshots/**" />
<include name=".htaccess" />
</fileset>
</copy>
<!-- replace variables for new release -->
<replace dir="${dir.dist}/website" encoding="utf-8" summary="yes">
<include name="**/*.html" />
<include name="**/*.php" />
<replacefilter token="@{version}" value="${version}" />
</replace>
<!-- upload -->
<scp todir="${sf.user}:${sf.password}@${deploy.website}" trust="yes" verbose="true" sftp="true">
<fileset dir="${dir.dist}/website" />
</scp>
</target>
2012-11-23 04:27:54 +00:00
<target name="chocolatey-push" description="chocolatey package">
<copy todir="${dir.dist}/chocolatey">
<fileset dir="${dir.installer}/chocolatey" />
</copy>
<!-- replace variables for new release -->
<replace dir="${dir.dist}/chocolatey" encoding="utf-8" summary="yes">
<include name="**/*.ps1" />
<include name="**/*.nuspec" />
<replacefilter token="@{version}" value="${version}" />
</replace>
<!-- chocolatey pack -->
<exec executable="C:\Chocolatey\bin\chocolatey.bat" dir="${dir.dist}\chocolatey" failonerror="true">
2012-11-23 04:27:54 +00:00
<arg line="pack" />
</exec>
<exec executable="C:\Chocolatey\bin\chocolatey.bat" dir="${dir.dist}\chocolatey" failonerror="true">
<arg line="push ${dir.dist}\chocolatey\filebot.${version}.nupkg" />
2012-11-23 04:27:54 +00:00
</exec>
</target>
<target name="upload-data" depends="login">
2012-12-14 15:23:38 +00:00
<scp todir="${sf.user}:${sf.password}@${deploy.website}" trust="yes" verbose="true" sftp="true">
<fileset dir="${dir.website}">
<include name="data/.htaccess" />
<include name="data/*.txt" />
<include name="*.json" />
</fileset>
</scp>
2012-10-12 15:45:00 +00:00
</target>
<target name="upload-data-frs" depends="login">
<scp todir="${sf.user}:${sf.password}@${deploy.data.frs}" trust="yes" verbose="true" sftp="true">
<fileset dir="${dir.website}/data">
<include name="*.xz" />
<include name="*.gz" />
</fileset>
</scp>
</target>
<target name="upload-scripts" depends="login">
<scp todir="${sf.user}:${sf.password}@${deploy.website}" trust="yes" verbose="true" sftp="true">
<fileset dir="${dir.website}">
<include name="scripts/**" />
</fileset>
</scp>
</target>
<target name="deploy-test-package" depends="svn-update, fatjar, login">
<!-- deploy fatjar -->
<input message="Mark:" addproperty="mark" />
<scp file="${path.fatjar}" remoteTofile="${sf.user}:${sf.password}@${deploy.release}/HEAD/filebot-${version}-r${svn.revision}-${mark}.jar" trust="yes" verbose="true" sftp="true" />
<scp file="${path.fatjar}" remoteTofile="${sf.user}:${sf.password}@${deploy.release}/HEAD/FileBot.jar" trust="yes" verbose="true" sftp="true" />
</target>
<target name="login">
<!-- ask for sourceforge password -->
2012-11-23 04:27:54 +00:00
<input message="Please enter sourceforge username:" addproperty="sf.user" />
<input message="Please enter sourceforge password:" addproperty="sf.password" />
</target>
</project>