Files
i2p.syndie/build.xml
2016-10-19 19:21:56 +00:00

1560 lines
74 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<project name="syndie" default="usage" basedir=".">
<description>Builds, tests and runs the project syndie.</description>
<!--
Include property files so that values can be easily overridden.
Users should create an override.properties file to make changes.
-->
<property file="override.properties"/>
<property file="build.properties"/>
<!-- Set some global properties up -->
<property name="src.dir" value="src" />
<property name="data.dir" value="data" />
<property name="build.dir" value="build" />
<property name="dist.dir" value="dist" />
<property name="lib.dir" value="lib" />
<property name="pkgtemp.dir" value="pkg-temp" />
<property name="pkgtemp.lib" value="${pkgtemp.dir}/lib" />
<property name="i2p.src.dir" value="../i2p.i2p" />
<property name="i2psnark.jar" value="${i2p.src.dir}/build/i2psnark.jar" />
<property name="launch4j.dir" value="${i2p.src.dir}/installer/lib/launch4j" />
<property name="izpack.dir" value="${i2p.src.dir}/installer/lib/izpack" />
<property name="desktop.class" value="syndie.gui.desktop.DesktopMain" />
<property name="tabs.class" value="syndie.gui.SWTUI" />
<property name="cli.class" value="syndie.db.TextUI" />
<property name="swt.dir" value="${basedir}/swt/lib" />
<property name="swt.lin32" value="${swt.dir}/swt-lin32.jar" />
<property name="swt.lin64" value="${swt.dir}/swt-lin64.jar" />
<property name="swt.win32" value="${swt.dir}/swt-win32.jar" />
<property name="swt.win64" value="${swt.dir}/swt-win64.jar" />
<property name="swt.mac32" value="${swt.dir}/swt-mac32.jar" />
<property name="swt.mac64" value="${swt.dir}/swt-mac64.jar" />
<property name="tab" value=" " />
<property name="javac.compilerargs" value="" />
<property name="javac.version" value="1.6" />
<property name="require.gettext" value="true" />
<condition property="no.bundle">
<isfalse value="${require.gettext}" />
</condition>
<!-- allow lib locations to be overridden -->
<property name="hsqldb.jar" value="${lib.dir}/hsqldb.jar" />
<property name="i2p.jar" value="${lib.dir}/i2p.jar" />
<property name="swt.jar" value="${lib.dir}/swt.jar" />
<available property="launch4j.available" file="${launch4j.dir}/launch4j.jar" type="file" />
<available property="pack200.available" file="${java.home}/bin/pack200" type="file" />
<!-- Set some classpaths up -->
<path id="classpath.build">
<pathelement location="${hsqldb.jar}" />
<pathelement location="${i2p.jar}" />
<pathelement location="${swt.jar}" />
</path>
<path id="classpath.run">
<pathelement location="${build.dir}/syndie.jar" />
<path refid="classpath.build" />
</path>
<!-- Set up a fileset for the resources -->
<path id="resources.path">
<fileset dir="${data.dir}" />
</path>
<path id="cli.resources.path">
<fileset dir="${data.dir}" excludes="syndie/gui/** syndie/html/** syndie/trac/** com/** syndie/locale/** imports/Browser/** imports/DesktopUI/**" />
</path>
<target name="help" depends="usage" />
<target name="usage">
<echo message="Useful targets:" />
<echo message=" clean: ${tab}Clean up the workspace" />
<echo message=" distclean: ${tab}Clean up all generated files" />
<echo message=" jar: ${tab}Create syndie.jar in build/ without the dependencies"/>
<echo message=" jar-cli: ${tab}Create syndie-cli.jar in build/ without the dependencies"/>
<echo message=" javadocs: ${tab}Generate javadocs for ${ant.project.name}" />
<echo message=" maintainer: ${tab}Display targets for building installers/packages for ${ant.project.name}" />
<echo message=" pkg: ${tab}Generate jar files and copy docs to ./dist" />
<echo message=" pkg-exe: ${tab}Same as pkg but also wraps jar files with launch4j into EXE files" />
<echo message=" poupdate: ${tab}Update PO files for translators" />
<echo message=" run: ${tab}Run ${ant.project.name} with the 'Tabs' interface" />
<echo message=" run-desktop: ${tab}Run ${ant.project.name} with the alternative 'Desktop' interface" />
<echo message=" singlejar: ${tab}Create a single syndie.jar in ${basedir} containing dependencies for YOUR system"/>
<echo message="totallyclean: ${tab}Clean up all generated files and any files downloaded during the build (e.g. SWT)" />
</target>
<target name="maintainer">
<echo message="Useful targets for ${ant.project.name} maintainers:" />
<echo message=" clean: ${tab}Clean up the workspace" />
<echo message=" distclean: ${tab}Clean up all generated files" />
<echo message=" installer-all: ${tab}Create 32- and 64-bit installers for all supported OSes"/>
<echo message=" installer-linux: ${tab}Create 32- and 64-bit installers for Linux"/>
<echo message=" installer-linux32: ${tab}Create 32-bit Linux installer"/>
<echo message=" installer-linux64: ${tab}Create 64-bit Linux installer"/>
<echo message=" installer-osx: ${tab}Create 32- and 64-bit installers for OSX"/>
<echo message=" installer-osx32: ${tab}Create 32-bit OSX installer"/>
<echo message=" installer-osx64: ${tab}Create 64-bit OSX installer"/>
<echo message=" installer-windows: ${tab}Create 32- and 64-bit installers for Windows, wrapped with launch4j (if available)"/>
<echo message="installer-windows32: ${tab}Create 32-bit Windows installer (add -exe to use launch4j, if available)"/>
<echo message="installer-windows64: ${tab}Create 64-bit Windows installer (add -exe to use launch4j, if available)"/>
<echo message=" pkg-all: ${tab}Create installers and packages for all supported systems" />
<echo message=" pkg-osx: ${tab}Create 32- and 64-bit Application Bundles for OSX" />
<echo message=" pkg-osx32: ${tab}Create 32-bit OSX Application Bundle" />
<echo message=" pkg-osx64: ${tab}Create 64-bit OSX Application Bundle" />
<echo message=" plugin: ${tab}Create signed I2P plugins for all supported systems" />
<echo message=" release: ${tab}Create all pkgs/installers with the &quot;pkg-all&quot; target, sign with gpg, generate sha256 checksum files, and update files in doc/web" />
<echo message=" source-tarball: ${tab}Create source tarball" />
<echo message=" totallyclean: ${tab}Clean up all generated files and any files downloaded during the build (e.g. SWT)" />
</target>
<macrodef name="make-stub-jar">
<attribute name="name" default="" />
<attribute name="type-class" />
<attribute name="additional" default=""/>
<sequential>
<jar destfile="${pkgtemp.dir}/bin/syndie@{name}.jar">
<manifest>
<attribute name="Main-Class" value="@{type-class}" />
<attribute name="Class-Path" value="../lib/i2p.jar ../lib/hsqldb.jar ../lib/syndie.jar @{additional}" />
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
</manifest>
</jar>
</sequential>
</macrodef>
<macrodef name="make-stub-jar-debian">
<attribute name="name" default="" />
<attribute name="type-class" />
<attribute name="additional" default=""/>
<sequential>
<jar destfile="${pkgtemp.dir}/bin/syndie@{name}.jar">
<manifest>
<attribute name="Main-Class" value="@{type-class}" />
<attribute name="Class-Path" value="${i2p.jar} ${hsqldb.jar} /usr/share/syndie/syndie.jar @{additional}" />
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
</manifest>
</jar>
</sequential>
</macrodef>
<macrodef name="repack">
<attribute name="jarname" />
<sequential>
<fail unless="pack200.available">Pack200 not found!</fail>
<exec executable="${java.home}/bin/pack200" failonerror="true">
<arg value="-r" />
<arg value="@{jarname}" />
</exec>
</sequential>
</macrodef>
<macrodef name="wrap-to-exe">
<attribute name="type" default=""/>
<sequential>
<local name="launch4j.config" />
<tempfile property="launch4j.config" deleteonexit="true" />
<fail unless="launch4j.available">Specify the location of the Launch4J installation directory with -Dlaunch4j.dir=/some/path/to/launch4j.jar</fail>
<taskdef name="launch4j" classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar"
classname="net.sf.launch4j.ant.Launch4jTask" />
<echo file="${launch4j.config}"><![CDATA[
<launch4jConfig>
<headerType>0</headerType>
<jar>${pkgtemp.dir}/bin/syndie@{type}.jar</jar>
<outfile>${pkgtemp.dir}/bin/syndie@{type}.exe</outfile>
<errTitle>Syndie-@{type}</errTitle>
<chdir>.</chdir>
<icon>doc/web/favicon.ico</icon>
<jre><minVersion>1.6.0</minVersion></jre>
<versionInfo>
<fileVersion>0.0.0.0</fileVersion>
<productVersion>0.0.0.0</productVersion>
<txtFileVersion>syndie-@{type}-${full.version}</txtFileVersion>
<txtProductVersion>${full.version}</txtProductVersion>
<fileDescription>Syndie @{type} Launcher</fileDescription>
<copyright>copyright is theft</copyright>
<productName>Syndie ${full.version}</productName>
<internalName>syndie</internalName>
<originalFilename>syndie@{type}.exe</originalFilename>
</versionInfo>
</launch4jConfig>
]]></echo>
<launch4j configFile="${launch4j.config}" />
</sequential>
</macrodef>
<macrodef name="wrap-installer">
<attribute name="bits" />
<sequential>
<local name="launch4j.config" />
<tempfile property="launch4j.config" deleteonexit="true" />
<fail unless="launch4j.available">Specify the location of the Launch4J installation directory with -Dlaunch4j.dir=/some/path/to/launch4j.jar</fail>
<taskdef name="launch4j" classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar"
classname="net.sf.launch4j.ant.Launch4jTask" />
<echo file="${launch4j.config}"><![CDATA[
<launch4jConfig>
<headerType>0</headerType>
<jar>syndie-installer-${syndie.release.version}.bin.win@{bits}.jar</jar>
<outfile>syndie-installer-${syndie.release.version}.bin.win@{bits}.exe</outfile>
<errTitle>Syndie ${full.version} installer</errTitle>
<chdir>.</chdir>
<icon>doc/web/favicon.ico</icon>
<jre><minVersion>1.6.0</minVersion></jre>
<versionInfo>
<fileVersion>0.0.0.0</fileVersion>
<productVersion>0.0.0.0</productVersion>
<txtFileVersion>syndie-${full.version} Windows @{bit}bit</txtFileVersion>
<txtProductVersion>${full.version}</txtProductVersion>
<fileDescription>Syndie ${full.version} Installation Launcher</fileDescription>
<copyright>copyright is theft</copyright>
<productName>Syndie ${full.version}</productName>
<internalName>syndie</internalName>
<originalFilename>syndie-installer-${full.version}.bin.win@{bits}.exe</originalFilename>
</versionInfo>
</launch4jConfig>
]]></echo>
<launch4j configFile="${launch4j.config}" />
<delete file="syndie-installer-${syndie.release.version}.bin.win@{bits}.jar" />
</sequential>
</macrodef>
<macrodef name="sign-and-sum">
<attribute name="file" />
<sequential>
<exec executable="gpg" failonerror="true">
<arg value="-b" />
<arg value="-u" />
<arg value="${release.gpg.keyid}" />
<arg value="@{file}" />
</exec>
<checksum format="MD5SUM" file="@{file}" algorithm="sha-256" fileext=".sha256"/>
</sequential>
</macrodef>
<macrodef name="make-torrent">
<attribute name="file" />
<sequential>
<java classname="org.klomp.snark.Storage" fork="false" failonerror="true">
<classpath>
<pathelement location="${i2p.jar}" />
<pathelement location="${i2psnark.jar}" />
</classpath>
<arg value="-a" />
<arg value="http://tracker2.postman.i2p/announce.php" />
<arg value="@{file}" />
</java>
</sequential>
</macrodef>
<macrodef name="build-installer">
<attribute name="os" />
<attribute name="swt" />
<attribute name="arch" />
<sequential>
<taskdef name="izpack" classpath="build/izpackpatch.jar:${izpack.dir}/standalone-compiler.jar"
classname="com.izforge.izpack.ant.IzPackTask" />
<jar destfile="build/izpackpatch.jar"
basedir="resources/izpack/patches" />
<delete file="${pkgtemp.dir}/lib/swt.jar" />
<copy file="${i2p.src.dir}/installer/resources/i2plogo.png" tofile="resources/i2plogo.png" />
<copy file="resources/uninstall.ico" todir="${pkgtemp.dir}/doc/Uninstaller" />
<copy tofile="${pkgtemp.dir}/lib/swt.jar" file="@{swt}" />
<ant target="repack-swt" />
<izpack output="syndie-installer-${syndie.release.version}.bin.@{os}@{arch}.jar"
installerType="standard"
basedir="."
izPackDir="${izpack.dir}/">
<config><![CDATA[
<installation version="1.0">
<info>
<!--<pack200/> -->
<appname>Syndie</appname>
<appversion>@{full.version}</appversion>
<appsubpath>syndie</appsubpath>
<authors>
<author name="Syndie development team" email="http://syndie.i2p2.de" />
</authors>
<url>http://syndie.i2p2.de</url>
<javaversion>1.6</javaversion>
<summarylogfilepath>$INSTALL_PATH/install.log</summarylogfilepath>
<run-privileged condition="izpack.windowsinstall.vista|izpack.windowsinstall.7"/>
</info>
<variables>
<variable name="desktopshortcutcheckboxenabled" value="true" />
</variables>
<guiprefs width="590" height="356" resizable="yes">
<!--
<modifier key="labelFontSize" value="1.2" />
-->
<laf name="liquid">
<os family="unix"/>
</laf>
<modifier key="langDisplayType" value="native" />
</guiprefs>
<locale>
<langpack iso3="eng"/>
<langpack iso3="cat"/>
<langpack iso3="chn"/>
<langpack iso3="cze"/>
<langpack iso3="dan"/>
<langpack iso3="deu"/>
<langpack iso3="ell"/>
<langpack iso3="fa"/>
<langpack iso3="fin"/>
<langpack iso3="fra"/>
<langpack iso3="glg"/>
<langpack iso3="hun"/>
<langpack iso3="ind"/>
<langpack iso3="ita"/>
<langpack iso3="jpn"/>
<langpack iso3="kor"/>
<langpack iso3="mys"/>
<langpack iso3="ned"/>
<langpack iso3="nor"/>
<langpack iso3="pol"/>
<langpack iso3="por"/>
<langpack iso3="rom"/>
<langpack iso3="rus"/>
<langpack iso3="scg"/>
<langpack iso3="spa"/>
<langpack iso3="svk"/>
<langpack iso3="swe"/>
<langpack iso3="tur"/>
<langpack iso3="twn"/>
<langpack iso3="ukr"/>
</locale>
<native type="izpack" name="ShellLink.dll" />
<native type="izpack" name="ShellLink_x64.dll" />
<resources>
<res id="Installer.image" src="resources/i2plogo.png" />
<res id="shortcutSpec.xml" src="resources/Win_shortcutSpec.xml" />
<res id="Unix_shortcutSpec.xml" src="resources/Unix_shortcutSpec.xml" />
</resources>
<panels>
<panel classname="HelloPanel"/>
<panel classname="TargetPanel"/>
<panel classname="SummaryPanel"/>
<panel classname="InstallPanel"/>
<panel classname="ShortcutPanel"><os family="windows" /></panel>
<panel classname="SimpleFinishPanel"/>
</panels>
<packs>
<pack name="Base" required="yes">
<description>Base installation files</description>
<fileset dir="pkg-temp" includes="**/*" targetdir="$INSTALL_PATH"/>
<!-- Windows stub EXEs -->
<executable targetfile="$INSTALL_PATH/bin/syndie.exe" type="bin" stage="never" keep="true" failure="warn">
<os family="windows" />
</executable>
<executable targetfile="$INSTALL_PATH/bin/syndie-desktop.exe" type="bin" stage="never" keep="true" failure="warn">
<os family="windows" />
</executable>
<!-- substitute variables in the Linux scripts -->
<parsable targetfile="$INSTALL_PATH/bin/syndie-cli.sh" type="shell" failure="warn">
<os name="Linux" />
</parsable>
<parsable targetfile="$INSTALL_PATH/bin/syndie.sh" type="shell" failure="warn">
<os name="Linux" />
</parsable>
<parsable targetfile="$INSTALL_PATH/bin/syndie-desktop.sh" type="shell" failure="warn">
<os name="Linux" />
</parsable>
<!-- set Linux scripts to be executable -->
<executable targetfile="$INSTALL_PATH/bin/syndie-desktop.sh" type="shell" stage="never" keep="true" failure="warn">
<os name="Linux" />
</executable>
<executable targetfile="$INSTALL_PATH/bin/syndie-cli.sh" type="shell" stage="never" keep="true" failure="warn">
<os name="Linux" />
</executable>
<executable targetfile="$INSTALL_PATH/bin/syndie.sh" type="shell" stage="never" keep="true" failure="warn">
<os name="Linux" />
</executable>
<!-- substitute variables in the OSX scripts -->
<parsable targetfile="$INSTALL_PATH/bin/syndie.command" type="shell" failure="warn">
<os family="mac" />
</parsable>
<parsable targetfile="$INSTALL_PATH/bin/syndie-cli.sh" type="shell" failure="warn">
<os family="mac" />
</parsable>
<parsable targetfile="$INSTALL_PATH/bin/syndie-desktop.command" type="shell" failure="warn">
<os family="mac" />
</parsable>
<!-- set OSX scripts to be executable -->
<executable targetfile="$INSTALL_PATH/bin/syndie.command" type="shell" stage="never" keep="true" failure="warn">
<os family="mac" />
</executable>
<executable targetfile="$INSTALL_PATH/bin/syndie-cli.sh" type="shell" stage="never" keep="true" failure="warn">
<os family="mac" />
</executable>
<executable targetfile="$INSTALL_PATH/bin/syndie-desktop.command" type="shell" stage="never" keep="true" failure="warn">
<os family="mac" />
</executable>
</pack>
</packs>
</installation>
]]></config>
</izpack>
</sequential>
</macrodef>
<target name="init" depends="buildProperties">
<!-- abort the build right away in case deps cannot be found -->
<available property="have.i2p" file="${i2p.jar}" type="file" />
<fail message="Cannot find ${i2p.jar}. Please read INSTALL and build.properties for advice.">
<condition>
<not>
<istrue value="${have.i2p}" />
</not>
</condition>
</fail>
<available property="have.hsqldb" file="${hsqldb.jar}" type="file" />
<fail message="Cannot find ${hsqldb.jar}. Please read INSTALL and build.properties for advice.">
<condition>
<not>
<istrue value="${have.hsqldb}" />
</not>
</condition>
</fail>
<mkdir dir="${dist.dir}" />
<mkdir dir="${build.dir}/obj" />
<mkdir dir="${build.dir}/cli-obj" />
</target>
<condition property="depend.available">
<typefound name="depend" />
</condition>
<target name="-depend" if="depend.available">
<depend
cache="builddep"
srcdir="src"
destdir="${build.dir}/obj">
<classpath>
<path refid="classpath.build" />
</classpath>
</depend>
</target>
<target name="compile" depends="init, -depend" description="compile the source">
<available property="have.swt" file="${swt.jar}" type="file" />
<fail message="Cannot find ${swt.jar}. Please read INSTALL and build.properties for advice.">
<condition>
<not>
<istrue value="${have.swt}" />
</not>
</condition>
</fail>
<javac srcdir="${src.dir}" destdir="${build.dir}/obj" debug="true" source="${javac.version}" target="${javac.version}"
deprecation="on" includeAntRuntime="false">
<compilerarg line="${javac.compilerargs}" />
<classpath>
<path refid="classpath.build" />
</classpath>
</javac>
</target>
<target name="compile-cli" depends="init" description="compile just the cli">
<delete dir="${build.dir}/cli-obj" />
<mkdir dir="${build.dir}/cli-obj" />
<javac srcdir="${src.dir}" destdir="${build.dir}/cli-obj" debug="true" source="${javac.version}" target="${javac.version}"
excludes="syndie/gui/** syndie/trac/** com/** syndie/locale/** imports/Browser/** imports/DesktopUI/**"
deprecation="on" includeAntRuntime="false">
<compilerarg line="${javac.compilerargs}" />
<classpath>
<pathelement location="${i2p.jar}" />
<pathelement location="${hsqldb.jar}" />
</classpath>
</javac>
</target>
<target name="bundle" depends="compile" description="process the translations" unless="no.bundle">
<mkdir dir="build/messages-src" />
<!-- Update the messages_*.po files -->
<exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
<arg value="scripts/bundle-messages.sh" />
</exec>
<exec executable="sh" osfamily="mac" failifexecutionfails="true" failonerror="${require.gettext}" >
<arg value="scripts/bundle-messages.sh" />
</exec>
<exec executable="sh" osfamily="windows" failifexecutionfails="false" >
<arg value="scripts/bundle-messages.sh" />
</exec>
<javac source="${javac.version}" target="${javac.version}"
includeAntRuntime="false"
srcdir="build/messages-src" destdir="build/obj">
<compilerarg line="${javac.compilerargs}" />
</javac>
</target>
<target name="poupdate" depends="compile" description="generate the translation files">
<!-- Update the messages_*.po files. -->
<exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="true" >
<arg value="scripts/bundle-messages.sh" />
<arg value="-p" />
</exec>
<exec executable="sh" osfamily="mac" failifexecutionfails="true" failonerror="true" >
<arg value="scripts/bundle-messages.sh" />
<arg value="-p" />
</exec>
<exec executable="sh" osfamily="windows" failifexecutionfails="true" failonerror="true" >
<arg value="scripts/bundle-messages.sh" />
<arg value="-p" />
</exec>
</target>
<target name="jar" depends="compile, bundle" description="Build jar in ./build">
<property name="build.built-by" value="unknown" />
<jar jarfile="${build.dir}/syndie.jar">
<fileset dir="${build.dir}/obj" />
<path refid="resources.path" />
<manifest>
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-revision" value="${workspace.version}" />
</manifest>
</jar>
</target>
<!-- note hardcoded hsqldb path, won't work for debian -->
<target name="jar-cli" depends="compile-cli" description="Build jar with only the cli in ./build">
<property name="build.built-by" value="unknown" />
<jar jarfile="${build.dir}/syndie-cli.jar">
<fileset dir="${build.dir}/cli-obj" />
<path refid="cli.resources.path" />
<manifest>
<attribute name="Class-Path" value="../lib/i2p.jar ../lib/hsqldb.jar" />
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-revision" value="${workspace.version}" />
<attribute name="Main-Class" value="syndie.db.TextUI" />
</manifest>
</jar>
</target>
<target name="dist" depends="pkg" />
<target name="singlejar" depends="jar" description="Combine all jars">
<copy file="${swt.jar}" tofile="${pkgtemp.lib}/swt.jar" />
<copy file="${i2p.jar}" todir="${pkgtemp.lib}" />
<copy file="${hsqldb.jar}" todir="${pkgtemp.lib}" />
<jar jarfile="syndie.jar" index="true">
<manifest>
<attribute name="Main-Class" value="syndie.gui.SWTUI"/>
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-revision" value="${workspace.version}" />
</manifest>
<zipfileset src="${build.dir}/syndie.jar" includes="**" />
<zipgroupfileset dir="${pkgtemp.lib}" includes="*.jar"/>
</jar>
</target>
<target name="run" depends="jar" description="run Syndie with the 'Tabs' interface">
<condition property="run.args" value="">
<not>
<isset property="run.args" />
</not>
</condition>
<echo message="Running Syndie with args ${run.args}" />
<java classname="syndie.gui.SWTUI" fork="true" failonerror="false">
<arg line="${run.args}" />
<classpath>
<path refid="classpath.run" />
</classpath>
</java>
</target>
<target name="run-desktop" depends="jar" description="run Syndie with the 'Desktop' interface">
<condition property="run.args" value="">
<not>
<isset property="run.args" />
</not>
</condition>
<echo message="Running Syndie with args ${run.args}" />
<java classname="syndie.gui.desktop.DesktopMain" fork="true" failonerror="false">
<arg line="${run.args}" />
<classpath>
<path refid="classpath.run" />
</classpath>
</java>
</target>
<target name="-check-for-izpack">
<available property="found.izpack" file="${izpack.dir}/standalone-compiler.jar" type="file" />
<fail unless="found.izpack">The installer targets require izpack! Specify -Dizpack.dir=/path/to/standalone-compiler.jar</fail>
</target>
<target name="-check-launch4j" if="launch4j.available" description="Check if this system can run launch4j">
<condition property="can.create.exe">
<and>
<or>
<os arch="x86" />
<os arch="i386" />
<os arch="i586" />
<os arch="i686" />
<os arch="amd64" />
<os arch="x86_64" />
</or>
<or>
<os name="Linux" />
<os family="windows" />
</or>
</and>
</condition>
</target>
<target name="jars2exe" if="can.create.exe" unless="no.exe" depends="-check-launch4j, stub-jars" description="Wrap jar files into EXEs">
<wrap-to-exe type="-desktop" />
<wrap-to-exe />
</target>
<target name="plugin" depends="buildProperties, jar">
<mkdir dir="plugin/lib" />
<buildnumber file="scripts/build.number" />
<!-- make the update xpi2p and su3 files, both 32 and 64 bit -->
<delete file="plugin/lib/hsqldb.jar.pack" />
<delete file="plugin/lib/swt.jar.pack" />
<copy file="LICENSE" todir="plugin" />
<copy file="src/com/LICENSE.txt" tofile="plugin/LICENSE-jazzy.txt" />
<copy file="LICENSE-EPL-v1.0.html" todir="plugin" />
<copy file="lib/hsqldb_lic.txt" todir="plugin" />
<copy file="scripts/plugin-linux32.config" tofile="plugin/plugin.config" overwrite="true" />
<copy file="scripts/clients-linux.config" tofile="plugin/clients.config" overwrite="true" />
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
<arg value="version=${full.version}-b${build.number}" />
</exec>
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
<arg value="update-only=true" />
</exec>
<exec executable="${java.home}/bin/pack200" failonerror="true">
<arg value="-g" />
<arg value="plugin/lib/syndie.jar.pack" />
<arg value="${build.dir}/syndie.jar" />
</exec>
<!-- include hsqldb.jar in the updater now -->
<exec executable="${java.home}/bin/pack200" failonerror="true">
<arg value="-g" />
<arg value="plugin/lib/hsqldb.jar.pack" />
<arg value="${hsqldb.jar}" />
</exec>
<input message="Enter su3 signing key password:" addproperty="release.password.su3" />
<fail message="You must enter a password." >
<condition>
<equals arg1="${release.password.su3}" arg2=""/>
</condition>
</fail>
<!-- make the linux update xpi2p and su3 files, 32 bit, no SWT -->
<!-- this will fail if no su3 keys exist, as it needs the password twice -->
<exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
<arg value="plugin" />
</exec>
<move file="syndie.xpi2p" tofile="syndie-linux-i386-update.xpi2p" />
<move file="syndie.su3" tofile="syndie-linux-i386-update.su3" />
<!-- make the linux update xpi2p and su3 files, 64 bit, with SWT -->
<!--
- These will not be used until the next update.
- We put an updated swt.jar in the 64-bit updates,
- but NOT the 32-bit one, since old 64-bit linux and mac installs
- will point to the 32-bit linux update.
-->
<copy file="scripts/plugin-linux64.config" tofile="plugin/plugin.config" overwrite="true" />
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
<arg value="version=${full.version}-b${build.number}" />
</exec>
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
<arg value="update-only=true" />
</exec>
<ant dir="swt" target="ensure-lin64-swt" />
<exec executable="${java.home}/bin/pack200" failonerror="true">
<arg value="-g" />
<arg value="plugin/lib/swt.jar.pack" />
<arg value="${swt.lin64}" />
</exec>
<exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
<arg value="plugin" />
</exec>
<move file="syndie.xpi2p" tofile="syndie-linux-x86-64-update.xpi2p" />
<move file="syndie.su3" tofile="syndie-linux-x86-64-update.su3" />
<!-- make the mac update xpi2p and su3 files, 64 bit, with SWT -->
<copy file="scripts/plugin-mac64.config" tofile="plugin/plugin.config" overwrite="true" />
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
<arg value="version=${full.version}-b${build.number}" />
</exec>
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
<arg value="update-only=true" />
</exec>
<ant dir="swt" target="ensure-mac64-swt" />
<exec executable="${java.home}/bin/pack200" failonerror="true">
<arg value="-g" />
<arg value="plugin/lib/swt.jar.pack" />
<arg value="${swt.mac64}" />
</exec>
<exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
<arg value="plugin" />
</exec>
<move file="syndie.xpi2p" tofile="syndie-mac64-update.xpi2p" />
<move file="syndie.su3" tofile="syndie-mac64-update.su3" />
<!-- make the windows update xpi2p, 32 bit, no SWT -->
<delete file="plugin/lib/swt.jar.pack" />
<copy file="scripts/plugin-windows32.config" tofile="plugin/plugin.config" overwrite="true" />
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
<arg value="version=${full.version}-b${build.number}" />
</exec>
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
<arg value="update-only=true" />
</exec>
<copy file="scripts/clients-windows.config" tofile="plugin/clients.config" overwrite="true" />
<exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
<arg value="plugin" />
</exec>
<move file="syndie.xpi2p" tofile="syndie-win32-update.xpi2p" />
<move file="syndie.su3" tofile="syndie-win32-update.su3" />
<!-- make the windows update xpi2p, 64 bit, with SWT -->
<!--
- These will not be used until the next update.
- We put an updated swt.jar in the 64-bit updates,
- but NOT the 32-bit one, since old 64-bit windows installs
- will point to the 32-bit update.
-->
<copy file="scripts/plugin-windows64.config" tofile="plugin/plugin.config" overwrite="true" />
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
<arg value="version=${full.version}-b${build.number}" />
</exec>
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
<arg value="update-only=true" />
</exec>
<ant dir="swt" target="ensure-mac64-swt" />
<exec executable="${java.home}/bin/pack200" failonerror="true">
<arg value="-g" />
<arg value="plugin/lib/swt.jar.pack" />
<arg value="${swt.mac64}" />
</exec>
<exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
<arg value="plugin" />
</exec>
<move file="syndie.xpi2p" tofile="syndie-win64-update.xpi2p" />
<move file="syndie.su3" tofile="syndie-win64-update.su3" />
<!-- Make install xpi2p/su3 -->
<!-- make the 32 bit linux install xpi2p/su3 -->
<ant dir="swt" target="ensure-lin32-swt" />
<copy file="scripts/LICENSE-swt.txt" todir="plugin" />
<copy file="scripts/plugin-linux32.config" tofile="plugin/plugin.config" overwrite="true" />
<copy file="scripts/clients-linux.config" tofile="plugin/clients.config" overwrite="true" />
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
<arg value="version=${full.version}-b${build.number}" />
</exec>
<exec executable="${java.home}/bin/pack200" failonerror="true">
<arg value="-g" />
<arg value="plugin/lib/swt.jar.pack" />
<arg value="${swt.lin32}" />
</exec>
<exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
<arg value="plugin" />
</exec>
<move file="syndie.xpi2p" tofile="syndie-linux-i386.xpi2p" />
<move file="syndie.su3" tofile="syndie-linux-i386.su3" />
<!-- make the 64 bit linux install xpi2p/su3 -->
<ant dir="swt" target="ensure-lin64-swt" />
<copy file="scripts/plugin-linux64.config" tofile="plugin/plugin.config" overwrite="true" />
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
<arg value="version=${full.version}-b${build.number}" />
</exec>
<exec executable="${java.home}/bin/pack200" failonerror="true">
<arg value="-g" />
<arg value="plugin/lib/swt.jar.pack" />
<arg value="${swt.lin64}" />
</exec>
<exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
<arg value="plugin" />
</exec>
<move file="syndie.xpi2p" tofile="syndie-linux-x86-64.xpi2p" />
<move file="syndie.su3" tofile="syndie-linux-x86-64.su3" />
<!-- macs use the linux clients config file -->
<!-- make the 64 bit mac install xpi2p/su3 -->
<ant dir="swt" target="ensure-mac64-swt" />
<copy file="scripts/plugin-mac64.config" tofile="plugin/plugin.config" overwrite="true" />
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
<arg value="version=${full.version}-b${build.number}" />
</exec>
<exec executable="${java.home}/bin/pack200" failonerror="true">
<arg value="-g" />
<arg value="plugin/lib/swt.jar.pack" />
<arg value="${swt.mac64}" />
</exec>
<exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
<arg value="plugin" />
</exec>
<move file="syndie.xpi2p" tofile="syndie-mac64.xpi2p" />
<move file="syndie.su3" tofile="syndie-mac64.su3" />
<!-- make the 32 bit windows install xpi2p/su3 -->
<ant dir="swt" target="ensure-win32-swt" />
<copy file="scripts/plugin-windows32.config" tofile="plugin/plugin.config" overwrite="true" />
<copy file="scripts/clients-windows.config" tofile="plugin/clients.config" overwrite="true" />
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
<arg value="version=${full.version}-b${build.number}" />
</exec>
<exec executable="${java.home}/bin/pack200" failonerror="true">
<arg value="-g" />
<arg value="plugin/lib/swt.jar.pack" />
<arg value="${swt.win32}" />
</exec>
<exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
<arg value="plugin" />
</exec>
<move file="syndie.xpi2p" tofile="syndie-win32.xpi2p" />
<move file="syndie.su3" tofile="syndie-win32.su3" />
<!-- make the 64 bit windows install xpi2p/su3 -->
<ant dir="swt" target="ensure-win64-swt" />
<copy file="scripts/plugin-windows64.config" tofile="plugin/plugin.config" overwrite="true" />
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
<arg value="version=${full.version}-b${build.number}" />
</exec>
<exec executable="${java.home}/bin/pack200" failonerror="true">
<arg value="-g" />
<arg value="plugin/lib/swt.jar.pack" />
<arg value="${swt.win64}" />
</exec>
<exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
<arg value="plugin" />
</exec>
<move file="syndie.xpi2p" tofile="syndie-win64.xpi2p" />
<move file="syndie.su3" tofile="syndie-win64.su3" />
</target>
<target name="-checkForMtn">
<available property="mtn.available" file="_MTN" type="dir" />
</target>
<target name="-getMtnRev" depends="-checkForMtn" if="mtn.available">
<exec executable="mtn" outputproperty="workspace.version" errorproperty="mtn.error1" failifexecutionfails="false">
<arg value="automate" />
<arg value="get_base_revision_id" />
</exec>
</target>
<target name="buildProperties" depends="-getMtnRev, -trimMtnRev, getReleaseNumber, getBuildNumber">
<tstamp>
<format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC" locale="en" />
<format property="files.date" pattern="yyyy/MM/dd" timezone="UTC" locale="en" />
</tstamp>
<!-- default if not set above -->
<property name="workspace.version" value="unknown" />
<property name="full.version" value="${release.number}-${syndie.build.number}" />
<property name="MtnShortHash" value="unknown" />
<condition property="extended.version" value="${full.version}-${MtnShortHash}">
<not>
<or>
<equals arg1="${MtnShortHash}" arg2="" />
<equals arg1="${MtnShortHash}" arg2="unknown" />
</or>
</not>
</condition>
<!-- if not set above we'll set it here -->
<property name="extended.version" value="${full.version}" />
<condition property="syndie.release.version" value="${extended.version}">
<or>
<not>
<equals arg1="${syndie.build.number}" arg2="0" />
</not>
<isset property="with.revision" />
</or>
</condition>
<!-- if not set above we'll set it here -->
<property name="syndie.release.version" value="${release.number}" />
<echo message="Building version ${syndie.release.version} (mtn rev ${workspace.version})" />
</target>
<target name="-trimMtnRev" if="with.revision" description="Shorten MTN rev ID">
<script language="javascript">
<![CDATA[
var MtnRev = project.getProperty("workspace.version");
if (MtnRev != 'unknown' && MtnRev != null) {
echo = project.createTask("echo");
var MtnShortHash = MtnRev.substring(0,8);
project.setProperty("MtnShortHash", MtnShortHash);
echo.setMessage("Trimmed hash: " + MtnShortHash);
echo.perform();
} else {
project.setProperty("MtnShortHash", 'unknown');
}
]]>
</script>
</target>
<target name="getReleaseNumber" description="Extract the Release number from the source">
<loadfile srcfile="src/syndie/Version.java" property="release.number">
<filterchain>
<linecontains>
<contains value="public static final String VERSION"/>
</linecontains>
<tokenfilter>
<replaceregex pattern='.*"([^"]+)-[0-9]+(?:-rc)?";' replace="\1" flags="gi" />
</tokenfilter>
<striplinebreaks/>
<trim/>
<ignoreblank/>
</filterchain>
</loadfile>
<property name="release.number" value="unknown" />
<echo message="Release number is ${release.number}" />
</target>
<target name="getBuildNumber" description="Extract the build number from the source">
<loadfile srcfile="src/syndie/Version.java" property="syndie.build.number">
<filterchain>
<linecontains>
<contains value="public static final String VERSION"/>
</linecontains>
<tokenfilter>
<replaceregex pattern='.*"[^"]+(?:a|b|rc)?-([0-9]+(?:-rc)?)";' replace="\1" flags="gi" />
</tokenfilter>
<striplinebreaks/>
<trim/>
<ignoreblank/>
</filterchain>
</loadfile>
<property name="syndie.build.number" value="unknown" />
<echo message="Build number is ${syndie.build.number}" />
</target>
<target name="stub-jars" depends="jar, preppkg" description="Create manifest-only jars for Syndie">
<make-stub-jar name="-desktop" additional="../lib/swt.jar" type-class="${desktop.class}" />
<make-stub-jar additional="../lib/swt.jar" type-class="${tabs.class}" />
<make-stub-jar name="-cli" type-class="${cli.class}" />
</target>
<!-- use this target from debian/rules -->
<target name="stub-jars-debian" depends="jar, preppkg-debian" description="Create manifest-only jars for Syndie">
<make-stub-jar-debian name="-desktop" additional="${swt.jar}" type-class="${desktop.class}" />
<make-stub-jar-debian additional="${swt.jar}" type-class="${tabs.class}" />
<make-stub-jar-debian name="-cli" type-class="${cli.class}" />
</target>
<target name="preppkg" depends="prep-docs, jar">
<copy file="${swt.jar}" tofile="${pkgtemp.dir}/lib/swt.jar" />
<copy file="${hsqldb.jar}" todir="${pkgtemp.dir}/lib" />
<copy file="${i2p.jar}" todir="${pkgtemp.dir}/lib" />
<copy file="${build.dir}/syndie.jar" todir="${pkgtemp.dir}/lib" />
</target>
<target name="preppkg-debian" depends="prep-docs-debian, jar">
<copy file="${build.dir}/syndie.jar" todir="${pkgtemp.dir}/lib" />
</target>
<target name="prep-docs" depends="prep-docs-debian">
<copy file="lib/hsqldb_lic.txt" todir="${pkgtemp.dir}/doc/licenses" />
<replaceregexp file="${pkgtemp.dir}/doc/LICENSE" byline="true"
match="lib/hsqldb_lic.txt"
replace="licenses/hsqldb_lic.txt">
</replaceregexp>
</target>
<target name="prep-docs-debian">
<copy todir="${pkgtemp.dir}/bin">
<fileset dir="./bin" />
</copy>
<copy todir="${pkgtemp.dir}/doc">
<fileset dir="." includes="CHANGES CREDITS INSTALL README TODO" />
</copy>
<copy todir="${pkgtemp.dir}/doc/web">
<fileset dir="doc/web" />
</copy>
<copy file="LICENSE" todir="${pkgtemp.dir}/doc/"/>
<copy todir="${pkgtemp.dir}/doc/licenses">
<fileset dir="doc/licenses/" excludes="SWT/**" />
</copy>
<replaceregexp file="${pkgtemp.dir}/doc/LICENSE" byline="true"
match="doc/licenses/"
replace="licenses/">
</replaceregexp>
</target>
<target name="prep-swt-licenses" depends="prep-win-licenses, prep-lin-licenses, prep-mac-licenses, prep-common-swt" />
<target name="prep-common-swt">
<copy file="src/com/LICENSE.txt" tofile="${pkgtemp.dir}/doc/licenses/LICENSE-Jazzy-GPL-v2.1.txt" />
<copy todir="${pkgtemp.dir}/doc/licenses/SWT/about_files">
<fileset dir="doc/licenses/SWT/common" />
</copy>
</target>
<target name="prep-win-licenses" depends="prep-common-swt">
<copy file="doc/licenses/SWT/lin/about.html" tofile="${pkgtemp.dir}/doc/licenses/SWT/Windows.html" />
</target>
<target name="prep-lin-licenses" depends="prep-common-swt">
<copy todir="${pkgtemp.dir}/doc/licenses/SWT/about_files">
<fileset dir="doc/licenses/SWT/lin/about_files" />
</copy>
<copy file="doc/licenses/SWT/lin/about.html" tofile="${pkgtemp.dir}/doc/licenses/SWT/Linux.html" />
</target>
<target name="prep-mac-licenses" depends="prep-common-swt">
<copy file="doc/licenses/SWT/mac/about.html" tofile="${pkgtemp.dir}/doc/licenses/SWT/OSX.html" />
</target>
<target name="prep-launch4j-license" if="launch4j.available">
<copy file="${launch4j.dir}/LICENSE.txt" tofile="${pkgtemp.dir}/doc/licenses/License-Launch4j.txt" />
</target>
<target name="pkg" depends="clean, prep-launch4j-license, prep-swt-licenses, stub-jars, jar, preppkg">
<delete dir="${dist.dir}" />
<move todir="${dist.dir}">
<fileset dir="${pkgtemp.dir}" />
</move>
</target>
<target name="pkg-exe" depends="clean, jars2exe, pkg"/>
<target name="source-tarball" depends="buildProperties" description="Generate source tarball">
<!-- will this use the monotonerc file in the current workspace? -->
<fail message="This target cannot be used without Monotone!">
<condition>
<not>
<isset property="mtn.available" />
</not>
</condition>
</fail>
<property name="source.tarball.name" value="${ant.project.name}-${syndie.release.version}.src.tar.bz2" />
<echo message="Checking out fresh copy into ../${ant.project.name}-${syndie.release.version} for tarballing:" />
<delete dir="../${ant.project.name}-${syndie.release.version}" />
<exec executable="mtn" failonerror="true">
<arg value="co" />
<arg value="-b" />
<arg value="i2p.${ant.project.name}" />
<!-- w: is the revision of the current workspace -->
<arg value="-r" />
<arg value="w:" />
<arg value="../${ant.project.name}-${syndie.release.version}" />
</exec>
<delete includeemptydirs="true" quiet="false">
<fileset dir="../${ant.project.name}-${syndie.release.version}/_MTN" />
<fileset dir="../${ant.project.name}-${syndie.release.version}/debian-alt"/>
<fileset dir="../${ant.project.name}-${syndie.release.version}/lib"/>
</delete>
<tar longfile="gnu" destfile="${source.tarball.name}" compression="bzip2">
<tarfileset dir="../${ant.project.name}-${syndie.release.version}" prefix="${ant.project.name}-${syndie.release.version}">
<include name="**/**" />
<exclude name="debian/**"/>
<exclude name="debian-alt/**"/>
<exclude name="lib/**"/>
<exclude name="**/*.sh"/>
</tarfileset>
<tarfileset dir="../${ant.project.name}-${syndie.release.version}" prefix="${ant.project.name}-${syndie.release.version}" filemode="755">
<exclude name="debian/**" />
<include name="**/*.sh" />
</tarfileset>
</tar>
</target>
<target name="debian-binary">
<exec executable="fakeroot" failonerror="true">
<arg value="debian/rules" />
<arg value="clean" />
<arg value="binary" />
</exec>
</target>
<target name="debian-tarball" depends="source-tarball">
<copy verbose="true" file="${source.tarball.name}"
tofile="../${ant.project.name}_${syndie.release.version}.orig.tar.bz2" />
</target>
<target name="sloccount.report" description="Generate 'sloccount' report">
<echo message="Generating sloccount report (this will take awhile)" />
<exec executable="sloccount" failonerror="true">
<arg value="--details"/>
<arg value="--wide"/>
<arg value="${basedir}"/>
<redirector output="sloccount.sc">
<outputfilterchain>
<linecontainsregexp negate="true">
<regexp pattern="(WARNING|Warning:|sloccount\.sc)" />
</linecontainsregexp>
</outputfilterchain>
</redirector>
</exec>
<echo message="sloccount report saved to the file sloccount.sc" />
</target>
<target name="findbugs" depends="jar" description="Analyze source with Findbugs">
<echo message="Starting findbugs, this will take a while..." />
<exec executable="nice" failonerror="true">
<arg value="findbugs"/>
<arg value="-textui"/>
<arg value="-projectName"/>
<arg value="${ant.project.name}"/>
<arg value="-sortByClass"/>
<arg value="-xml"/>
<arg value="-output"/>
<arg value="${ant.project.name}.fba"/>
<arg value="-auxclasspath"/>
<arg value="${swt.jar}:${hsqldb.jar}:${i2p.jar}" />
<arg value="-sourcepath"/>
<arg value="src" />
<!-- start of the files to be analyzed -->
<arg value="${build.dir}/syndie.jar"/>
</exec>
<echo message="Findbugs output stored in ${ant.project.name}.fba" />
<echo message="Now run: findbugs ${ant.project.name}.fba" />
</target>
<target name="javadoc" depends="javadocs" />
<target name="javadocs" depends="buildProperties" description="Generate Javadocs">
<!-- only set the locale if not set elsewhere -->
<property name="javadoc.locale" value="en_US" />
<mkdir dir="./build" />
<mkdir dir="./build/javadoc" />
<javadoc access="package"
destdir="./build/javadoc"
packagenames="*"
use="true"
splitindex="true"
author="true"
version="true"
locale="${javadoc.locale}"
doctitle="Syndie Javadocs for Release ${release.number} Build ${syndie.build.number}"
windowtitle="Syndie Distributed Forums - Java Documentation - Version ${full.version}">
<group title="Syndie" packages="syndie*" />
<group title="Spell Checker" packages="com.swabunga.*" />
<sourcepath>
<pathelement location="src" />
</sourcepath>
<classpath>
<pathelement location="${swt.jar}" />
<pathelement location="${i2p.jar}" />
</classpath>
<!-- These variables are stored in build.properties.
End-users can override by creating the file override.properties -->
<link offline="true" href="${javasedocs.url}" packagelistLoc="resources/package-lists/java/" />
<link offline="true" href="${swtdocs.url}" packagelistLoc="resources/package-lists/swt/" />
<link offline="true" href="${i2pdocs.url}" packagelistLoc="resources/package-lists/i2p/" />
</javadoc>
<echo message="Warning, javadoc embeds timestamps in the output, run with 'TZ=UTC ant javadoc' if you plan to distribute" />
</target>
<target name="clean" description="clean up">
<delete dir="${build.dir}" />
<delete dir="builddep" />
<delete file="sloccount.sc" />
<delete dir="plugin" />
<delete dir="${pkgtemp.dir}" />
<delete file="plugin.zip" />
<delete file="${ant.project.name}.fba" />
<delete dir="pkg-osx" />
<delete file="resources/i2plogo.png" />
</target>
<target name="distclean" depends="clean" description="More throrough clean-up">
<delete file="syndie.xpi2p" />
<delete dir="${dist.dir}" />
<delete quiet="true">
<fileset dir="." includes="syndie-installer* syndie*tar.bz2 *.sha256 *.sig" />
</delete>
<delete file="syndie-installer*.jar" />
<delete file="syndie-installer*.exe" />
<delete file="syndie-update.xpi2p" />
<delete file="syndie-mac64.xpi2p" />
<delete file="syndie-mac64-update.xpi2p" />
<delete file="syndie-win32.xpi2p" />
<delete file="syndie-win32-update.xpi2p" />
<delete file="syndie-win64.xpi2p" />
<delete file="syndie-win64-update.xpi2p" />
<delete file="syndie-linux-i386.xpi2p" />
<delete file="syndie-linux-i386-update.xpi2p" />
<delete file="syndie-linux-x86-64.xpi2p" />
<delete file="syndie-linux-x86-64-update.xpi2p" />
<delete file="syndie-update.su3" />
<delete file="syndie-mac64.su3" />
<delete file="syndie-mac64-update.su3" />
<delete file="syndie-win32.su3" />
<delete file="syndie-win32-update.su3" />
<delete file="syndie-win64.su3" />
<delete file="syndie-win64-update.su3" />
<delete file="syndie-linux-i386.su3" />
<delete file="syndie-linux-i386-update.su3" />
<delete file="syndie-linux-x86-64.su3" />
<delete file="syndie-linux-x86-64-update.su3" />
</target>
<target name="totallyclean" depends="distclean" description="Most thorough clearning">
<delete file="lib/i2p.jar" />
<delete file="lib/swt.jar" />
<ant dir="swt" target="totallyclean" />
</target>
<target name="debug" depends="buildProperties" description="Print properties">
<echoproperties/>
</target>
<target name="delete-windows-files">
<delete failonerror="false" quiet="true">
<fileset dir="${pkgtemp.dir}" includes="**/*.exe" />
</delete>
</target>
<target name="delete-stub-jars">
<delete failonerror="false" quiet="true">
<fileset dir="${pkgtemp.dir}/bin" includes="*.jar" />
</delete>
</target>
<target name="delete-osx-files">
<delete failonerror="false" quiet="true">
<fileset dir="${pkgtemp.dir}/bin" includes="*.command *.sh" />
</delete>
</target>
<target name="delete-linux-files">
<delete failonerror="false" quiet="true">
<fileset dir="${pkgtemp.dir}/bin" includes="*.sh" />
</delete>
</target>
<target name="repack-osx-bundle" if="do.repack">
<repack jarname="pkg-osx/Syndie.app/Contents/MacOS/swt.jar" />
<repack jarname="pkg-osx/Syndie.app/Contents/MacOS/i2p.jar" />
<repack jarname="pkg-osx/Syndie.app/Contents/MacOS/syndie.jar" />
<repack jarname="pkg-osx/Syndie.app/Contents/MacOS/hsqldb.jar" />
</target>
<target name="repack-common" if="do.repack">
<repack jarname="${pkgtemp.dir}/lib/i2p.jar" />
<repack jarname="${pkgtemp.dir}/lib/hsqldb.jar" />
<repack jarname="${pkgtemp.dir}/lib/syndie.jar" />
</target>
<target name="repack-swt" if="do.repack">
<repack jarname="${pkgtemp.dir}/lib/swt.jar" />
</target>
<target name="repack-cli" if="do.repack">
<repack jarname="${pkgtemp.dir}/lib/i2p.jar" />
<repack jarname="${pkgtemp.dir}/lib/hsqldb.jar" />
<repack jarname="${pkgtemp.dir}/bin/syndie-cli.jar" />
</target>
<target name="installer-linux" depends="installer-linux32, installer-linux64" description="Create Linux installers (i386 and x86_64)"/>
<!-- Aliases -->
<target name="installer-lin32" depends="installer-linux32" />
<target name="installer-lin64" depends="installer-linux64" />
<target name="installer-win32" depends="installer-windows32" />
<target name="installer-win64" depends="installer-windows64" />
<target name="installer-mac32" depends="installer-osx32" />
<target name="installer-mac64" depends="installer-osx64" />
<target name="linux-start-scripts">
<echo file="${pkgtemp.dir}/bin/syndie.sh"><![CDATA[#!/bin/sh
java -jar %INSTALL_PATH/bin/syndie.jar "$@" -Dsyndie.dict=/usr/share/dict/words
]]></echo>
<echo file="${pkgtemp.dir}/bin/syndie-desktop.sh"><![CDATA[#!/bin/sh
java -jar %INSTALL_PATH/bin/syndie-desktop.jar "$@" -Dsyndie.dict=/usr/share/dict/words
]]></echo>
<echo file="${pkgtemp.dir}/bin/syndie-cli.sh"><![CDATA[#!/bin/sh
java -jar %INSTALL_PATH/bin/syndie-cli.jar "$@"
]]></echo>
</target>
<target name="installer-linux32" depends="-check-for-izpack, stub-jars, preppkg, delete-windows-files, delete-osx-files, linux-start-scripts" description="Create i386 installer for Linux">
<ant dir="swt" target="ensure-lin32-swt" />
<ant target="repack-common" />
<build-installer os="linux" arch="32" swt="${swt.lin32}" />
</target>
<target name="installer-linux64" depends="-check-for-izpack, stub-jars, preppkg, delete-windows-files, delete-osx-files, linux-start-scripts" description="Create x86_64 installer for Linux">
<ant dir="swt" target="ensure-lin64-swt" />
<ant target="repack-common" />
<build-installer os="linux" arch="64" swt="${swt.lin64}" />
</target>
<target name="installer-windows" depends="installer-windows64-exe, installer-windows32-exe, delete-osx-files" description="Create i386 and x86_64 installers for Windows" />
<target name="installer-windows32-exe" if="can.create.exe" unless="no.exe" depends="-check-launch4j, installer-windows32" description="Create i386 installer for Windows and wrap it into an EXE">
<wrap-installer bits="32" />
</target>
<target name="installer-windows64-exe" if="can.create.exe" unless="no.exe" depends="-check-launch4j, installer-windows64" description="Create x86_64 installer for Windows and wrap it into an EXE">
<wrap-installer bits="64" />
</target>
<target name="installer-windows32" depends="-check-for-izpack, jars2exe, stub-jars, preppkg, delete-osx-files, delete-linux-files" description="Create i386 installer for Windows">
<ant dir="swt" target="ensure-win32-swt" />
<ant target="repack-common" />
<build-installer os="win" arch="32" swt="${swt.win32}" />
</target>
<target name="installer-windows64" depends="-check-for-izpack, jars2exe, stub-jars, preppkg, delete-osx-files, delete-linux-files" description="Create x86_64 installer for Windows">
<ant dir="swt" target="ensure-win64-swt" />
<ant target="repack-common" />
<build-installer os="win" arch="64" swt="${swt.win64}" />
</target>
<!--
The installer-osx* targets create Izpack installers. Also available are the pkg-osx* targets
which create OSX-style .app bundles.
-->
<target name="installer-osx" depends="installer-osx32, installer-osx64" />
<target name="installer-osx32" depends="-check-for-izpack, preppkg, delete-windows-files, delete-linux-files, delete-stub-jars" description="Create i386 installer for OSX">
<echo file="${pkgtemp.dir}/bin/syndie.command"><![CDATA[#!/bin/sh
CP=%INSTALL_PATH/lib/i2p.jar:%INSTALL_PATH/lib/hsqldb.jar:%INSTALL_PATH/lib/swt.jar:%INSTALL_PATH/lib/syndie.jar
java -d32 -XstartOnFirstThread -cp $CP syndie.gui.SWTUI "$@"
]]></echo>
<echo file="${pkgtemp.dir}/bin/syndie-cli.sh"><![CDATA[#!/bin/sh
CP=%INSTALL_PATH/lib/i2p.jar:%INSTALL_PATH/lib/hsqldb.jar:%INSTALL_PATH/lib/syndie.jar
java -d32 -XstartOnFirstThread -cp $CP syndie.db.TextUI "$@"
]]></echo>
<echo file="${pkgtemp.dir}/bin/syndie-desktop.command"><![CDATA[#!/bin/sh
CP=%INSTALL_PATH/lib/i2p.jar:%INSTALL_PATH/lib/hsqldb.jar:%INSTALL_PATH/lib/syndie.jar
java -d32 -XstartOnFirstThread -cp $CP syndie.db.TextUI "$@"
]]></echo>
<ant dir="swt" target="ensure-mac32-swt" />
<ant target="repack-common" />
<build-installer os="osx" arch="32" swt="${swt.mac32}" />
</target>
<target name="installer-osx64" depends="-check-for-izpack, preppkg, delete-windows-files, delete-linux-files, delete-stub-jars" description="Create x86_64 installer for OSX">
<echo file="${pkgtemp.dir}/bin/syndie.command"><![CDATA[#!/bin/sh
CP=%INSTALL_PATH/lib/i2p.jar:%INSTALL_PATH/lib/hsqldb.jar:%INSTALL_PATH/lib/swt.jar:%INSTALL_PATH/lib/syndie.jar
java -d64 -XstartOnFirstThread -cp $CP syndie.gui.SWTUI "$@"
]]></echo>
<echo file="${pkgtemp.dir}/bin/syndie-cli.sh"><![CDATA[#!/bin/sh
CP=%INSTALL_PATH/lib/i2p.jar:%INSTALL_PATH/lib/hsqldb.jar:%INSTALL_PATH/lib/syndie.jar
java -d64 -XstartOnFirstThread -cp $CP syndie.db.TextUI "$@"
]]></echo>
<echo file="${pkgtemp.dir}/bin/syndie-desktop.command"><![CDATA[#!/bin/sh
CP=%INSTALL_PATH/lib/i2p.jar:%INSTALL_PATH/lib/hsqldb.jar:%INSTALL_PATH/lib/syndie.jar
java -d64 -XstartOnFirstThread -cp $CP syndie.db.TextUI "$@"
]]></echo>
<ant dir="swt" target="ensure-mac64-swt" />
<ant target="repack-common" />
<build-installer os="osx" arch="64" swt="${swt.mac64}" />
</target>
<target name="installer-all" depends="installer-linux, installer-windows, installer-osx64" description="Create Windows, Linux and OSX installers" />
<target name="prep-osx" depends="jar, prep-docs, prep-mac-licenses">
<mkdir dir="pkg-osx/Syndie.app/Contents/MacOS" />
<mkdir dir="pkg-osx/Syndie.app/Contents/Resources" />
<copy file="${hsqldb.jar}" todir="pkg-osx/Syndie.app/Contents/MacOS" />
<copy file="${i2p.jar}" todir="pkg-osx/Syndie.app/Contents/MacOS" />
<copy file="${build.dir}/syndie.jar" todir="pkg-osx/Syndie.app/Contents/MacOS" />
<copy file="resources/osx.icns" tofile="pkg-osx/Syndie.app/Contents/syndie.icns" />
<echo file="pkg-osx/Syndie.app/Contents/Info.plist"><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>startsyndie.sh</string>
<key>CFBundleGetInfoString</key>
<string>Syndie ${full.version} for Mac OS X</string>
<key>CFBundleIconFile</key>
<string>syndie.icns</string>
<key>CFBundleIdentifier</key>
<string>syndie.gui.SWTUI</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Syndie</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.102.${syndie.build.number}</string>
<key>CFBundleSignature</key>
<string>synd</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
]]></echo>
<copy todir="pkg-osx/doc">
<fileset dir="pkg-temp/doc" />
</copy>
</target>
<target name="pkg-cli" depends="jar-cli, prep-docs">
<copy file="${build.dir}/syndie-cli.jar" todir="${pkgtemp.dir}/bin" />
<copy file="${hsqldb.jar}" todir="${pkgtemp.dir}/lib" />
<copy file="${i2p.jar}" todir="${pkgtemp.dir}/lib" />
<ant target="repack-cli" />
<echo file="${pkgtemp.dir}/bin/readme.txt">In order to use this headless version of Syndie,
copy i2p.jar to the lib directory, then simply
run "java -jar syndie-cli.jar".
Alternatively, you can run a command like the following:
java -cp path/to/hsqldb.jar:path/to/i2p.jar:path/to/syndie-cli.jar syndie.db.TextUI
</echo>
<tar destfile="syndie-cli-${syndie.release.version}.bin.tar.bz2" compression="bzip2">
<tarfileset dir="${pkgtemp.dir}" prefix="syndie-cli-${syndie.release.version}" filemode="644">
<include name="bin/*" />
<exclude name="bin/*.exe" />
<exclude name="bin/*.sh" />
<exclude name="bin/*.command" />
<include name="lib/hsqldb.jar" />
<include name="doc/*" />
<exclude name="doc/Uninstaller/" />
<include name="doc/licenses/*.txt" />
<exclude name="doc/web" />
</tarfileset>
</tar>
</target>
<!-- The pkg-osx* targets create OSX .app bundles that run Syndie with the tabs interface -->
<target name="pkg-osx" depends="pkg-osx32, pkg-osx64" description="Create both i386 and x86_64 '.app' bundles for OSX" />
<target name="pkg-osx32" depends="prep-osx" description="Create an i386 '.app' bundle for OSX">
<ant dir="swt" target="ensure-mac32-swt" />
<delete file="pkg-osx/Syndie.app/Contents/MacOS/swt.jar" />
<copy file="${swt.mac32}" tofile="pkg-osx/Syndie.app/Contents/MacOS/swt.jar" />
<ant target="repack-osx-bundle" />
<echo file="pkg-osx/Syndie.app/Contents/MacOS/startsyndie.sh"><![CDATA[#!/bin/sh
DIR=`dirname $0`
CP=$DIR/swt.jar:$DIR/hsqldb.jar:$DIR/syndie.jar:$DIR/i2p.jar
exec java -d32 -XstartOnFirstThread -cp $CP syndie.gui.SWTUI
]]></echo>
<tar destfile="syndie-${syndie.release.version}.bin.osx32.tar.bz2" compression="bzip2">
<tarfileset dir="pkg-osx" prefix="syndie-${syndie.release.version}" filemode="644">
<include name="**/**" />
<exclude name="**/*.sh" />
</tarfileset>
<tarfileset dir="pkg-osx" prefix="syndie-${syndie.release.version}" filemode="755">
<include name="**/*.sh" />
</tarfileset>
</tar>
</target>
<target name="pkg-osx64" depends="prep-osx" description="Create an x86_64 '.app' bundle for OSX">
<ant dir="swt" target="ensure-mac64-swt" />
<delete file="pkg-osx/Syndie.app/Contents/MacOS/swt.jar" />
<copy file="${swt.mac64}" tofile="pkg-osx/Syndie.app/Contents/MacOS/swt.jar" />
<ant target="repack-osx-bundle" />
<echo file="pkg-osx/Syndie.app/Contents/MacOS/startsyndie.sh"><![CDATA[#!/bin/sh
DIR=`dirname $0`
CP=$DIR/swt.jar:$DIR/hsqldb.jar:$DIR/syndie.jar:$DIR/i2p.jar
exec java -d64 -XstartOnFirstThread -cp $CP syndie.gui.SWTUI
]]></echo>
<tar destfile="syndie-${syndie.release.version}.bin.osx64.tar.bz2" compression="bzip2">
<tarfileset dir="pkg-osx" prefix="syndie-${syndie.release.version}" filemode="644">
<include name="**/**" />
<exclude name="**/*.sh" />
</tarfileset>
<tarfileset dir="pkg-osx" prefix="syndie-${syndie.release.version}" filemode="755">
<include name="**/*.sh" />
</tarfileset>
</tar>
</target>
<target name="pkg-all" depends="distclean, installer-all, pkg-osx64, source-tarball, pkg-cli" description="Create packages/installers for all supported systems." />
<target name="-check-gpgkey">
<echo message="Sign the files:" />
<input message="Enter GPG key ID (e.g. 0x12345678) for signing:" addproperty="release.gpg.keyid" />
<fail message="You must enter a key ID." >
<condition>
<not>
<isset property="release.gpg.keyid" />
</not>
</condition>
</fail>
</target>
<target name="release" depends="-check-gpgkey, pkg-all, update-site" description="build, sign, and checksum files then update site">
<delete dir="./dist" />
<mkdir dir="./dist" />
<sign-and-sum file="syndie-installer-${syndie.release.version}.bin.linux32.jar" />
<sign-and-sum file="syndie-installer-${syndie.release.version}.bin.linux64.jar" />
<sign-and-sum file="syndie-installer-${syndie.release.version}.bin.win32.exe" />
<sign-and-sum file="syndie-installer-${syndie.release.version}.bin.win64.exe" />
<sign-and-sum file="syndie-installer-${syndie.release.version}.bin.osx64.jar" />
<sign-and-sum file="syndie-cli-${syndie.release.version}.bin.tar.bz2" />
<sign-and-sum file="syndie-${syndie.release.version}.src.tar.bz2" />
<sign-and-sum file="syndie-${syndie.release.version}.bin.osx64.tar.bz2" />
<ant target="-torrent" />
<move todir="./dist">
<fileset dir="." includes="*.exe *.sha256 *.sig *.bz2 *.jar *.torrent"/>
</move>
<echo message="If you're happy with the results, remember to mtn tag w: ${ant.project.name}-${syndie.release.version}" />
</target>
<target name="-torrent" if="i2psnark.jar">
<available property="i2psnark.available" file="${i2psnark.jar}" type="file" />
<fail unless="i2psnark.available">ERROR: -Di2psnark.jar set but ${i2psnark.jar} could not be found!</fail>
<make-torrent file="syndie-cli-${syndie.release.version}.bin.tar.bz2" />
<make-torrent file="syndie-installer-${syndie.release.version}.bin.linux32.jar" />
<make-torrent file="syndie-installer-${syndie.release.version}.bin.linux64.jar" />
<make-torrent file="syndie-installer-${syndie.release.version}.bin.win32.exe" />
<make-torrent file="syndie-installer-${syndie.release.version}.bin.win64.exe" />
<make-torrent file="syndie-installer-${syndie.release.version}.bin.osx64.jar" />
<make-torrent file="syndie-${syndie.release.version}.src.tar.bz2" />
<make-torrent file="syndie-${syndie.release.version}.bin.osx64.tar.bz2" />
</target>
<target name="update-archivesite" depends="buildProperties" if="gpg.key">
<replaceregexp flags="g" byline="false" file="data/archive/index.html"
match="[0-9]\.[0-9]+(a|b|rc)(?:-[0-9]+)?(-[a-z0-9]{8})?"
replace="${syndie.release.version}">
</replaceregexp>
</target>
<target name="update-site" depends="buildProperties, copy-www" if="do.update.site">
<replaceregexp flags="g" byline="false"
match="[0-9]\.[0-9]+(a|b|rc)(?:-[0-9]+)?(-[a-z0-9]{8})?"
replace="${syndie.release.version}">
<fileset dir="doc/web" includes="download.html index.html" />
</replaceregexp>
<replaceregexp file="doc/web/index.html" flags="g" byline="false"
match="\([0-9]{4}/[0-9]{2}/[0-9]{2}\)"
replace="(${files.date})">
</replaceregexp>
<replaceregexp flags="g" byline="false" file="doc/web/download.html">
<regexp pattern="files/(:?.*)?/syndie"/>
<substitution expression="files/${release.number}/syndie" />
</replaceregexp>
<echo>Release date set to ${files.date}. Edit doc/web/index.html is this is incorrect.</echo>
</target>
<target name="copy-www" if="syndie.www">
<copy todir="${syndie.www}" verbose="true" overwrite="true">
<fileset dir="doc/web" includes="index.html download.html" />
</copy>
</target>
<target name="testscripts" description="check PO files, XML, and HTML files for errors">
<exec executable="tests/scripts/checkpo.sh" failonerror="true" />
<exec executable="tests/scripts/checkxml.sh" failonerror="true" />
</target>
</project>
<!-- vim: set ft=xml ts=4 sw=4 et: -->