Files
i2p.syndie/build.xml

1007 lines
46 KiB
XML
Raw Normal View History

<?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="dist.lib.jar" value="${dist.dir}/syndie.jar" />
<property name="pkgtemp.lib" value="${pkgtemp.dir}/lib" />
<property name="i2p.src.dir" value="../i2p.i2p" />
<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" />
<!-- 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" />
<!-- 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>
<target name="help" depends="usage" />
<target name="usage">
<property name="tab" value=" " />
<echo message="Useful targets:" />
<echo message=" clean: ${tab}Clean up the workspace" />
<echo message=" dist: ${tab}Create ${basedir}/syndie.jar containing dependencies for YOUR system"/>
<echo message=" distclean: ${tab}Clean up all generated files" />
<echo message=" jar: ${tab}Create syndie.jar in build/ without the dependencies"/>
<echo message=" javadocs: ${tab}Generate javadocs 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=" run: ${tab}Run ${ant.project.name} with the 'Tabs' interface" />
<echo message=" run-desktop: ${tab}Run ${ant.project.name} with the alternative 'Desktop' interface" />
</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="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
</manifest>
</jar>
</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.5.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-${full.version}.bin.win@{bits}.jar</jar>
<outfile>syndie-installer-${full.version}.bin.win@{bits}.exe</outfile>
<errTitle>Syndie ${full.version} installer</errTitle>
<chdir>.</chdir>
<icon>doc/web/favicon.ico</icon>
<jre><minVersion>1.5.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-${full.version}.bin.win@{bits}.jar" />
</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="resources/uninstall.ico" todir="${pkgtemp.dir}/Uninstaller" />
<copy tofile="${pkgtemp.dir}/lib/swt.jar" file="@{swt}" />
<izpack output="syndie-installer-${full.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.5</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">
<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="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"/>
<panel classname="SimpleFinishPanel"/>
</panels>
<packs>
<pack name="Base" required="yes">
<description>Base installation files</description>
<fileset dir="pkg-temp" includes="**/*" targetdir="$INSTALL_PATH"/>
<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>
<executable targetfile="$INSTALL_PATH/bin/syndie.jar" type="jar" stage="never" keep="true" failure="warn">
<os family="unix"/>
</executable>
<executable targetfile="$INSTALL_PATH/bin/syndie-cli.jar" type="jar" stage="never" keep="true" failure="warn">
<os family="unix"/>
</executable>
<executable targetfile="$INSTALL_PATH/bin/syndie-desktop.jar" type="jar" stage="never" keep="true" failure="warn">
<os family="unix"/>
</executable>
</pack>
</packs>
</installation>
]]></config>
</izpack>
</sequential>
</macrodef>
<target name="init" depends="buildProperties">
2013-01-11 18:59:32 +00:00
<!-- 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>
<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>
<tstamp>
<format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC" locale="en" />
</tstamp>
<mkdir dir="${dist.dir}" />
<mkdir dir="${build.dir}/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">
<javac srcdir="${src.dir}" destdir="${build.dir}/obj" debug="true" source="1.5" target="1.5"
deprecation="on" includeAntRuntime="false">
<classpath>
<path refid="classpath.build" />
</classpath>
</javac>
</target>
<target name="bundle" depends="compile" description="process the translations">
<!-- Update the messages_*.po files -->
<exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
<arg value="./bundle-messages.sh" />
</exec>
<exec executable="sh" osfamily="mac" failifexecutionfails="true" failonerror="${require.gettext}" >
<arg value="./bundle-messages.sh" />
</exec>
<exec executable="sh" osfamily="windows" failifexecutionfails="false" >
<arg value="./bundle-messages.sh" />
</exec>
</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="./bundle-messages.sh" />
<arg value="-p" />
</exec>
<exec executable="sh" osfamily="mac" failifexecutionfails="true" failonerror="true" >
<arg value="./bundle-messages.sh" />
<arg value="-p" />
</exec>
<exec executable="sh" osfamily="windows" failifexecutionfails="true" failonerror="true" >
<arg value="./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>
<target name="jar-cli" depends="compile,jar" description="Build jar with only the cli in ./build">
<property name="build.built-by" value="unknown" />
<jar jarfile="${build.dir}/syndie-cli.jar">
<zipfileset src="${build.dir}/syndie.jar" excludes="**/syndie/gui/** **/syndie/trac/** **/com/**" />
<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="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">
2010-03-02 00:09:09 +00:00
<mkdir dir="plugin/lib" />
<buildnumber file="scripts/build.number" />
<!-- make the update linux xpi2p, this is for both 32 and 64 bit -->
2010-03-03 00:20:57 +00:00
<delete file="plugin/lib/hsqldb.jar.pack" />
<delete file="plugin/lib/swt.jar.pack" />
2010-03-02 00:09:09 +00:00
<copy file="LICENSE" todir="plugin" />
<copy file="src/com/LICENSE.txt" tofile="plugin/LICENSE-jazzy.txt" />
<copy file="LICENSE-EPL-v1.0.html" tofile="plugin/LICENSE-icons.html" />
2010-03-03 00:20:57 +00:00
<copy file="scripts/plugin-linux.config" tofile="plugin/plugin.config" overwrite="true" />
<copy file="scripts/clients-linux.config" tofile="plugin/clients.config" overwrite="true" />
2010-03-21 15:47:11 +00:00
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
<arg value="version=${full.version}-b${build.number}" />
2010-03-02 00:09:09 +00:00
</exec>
2010-03-21 15:47:11 +00:00
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
2010-03-02 00:09:09 +00:00
<arg value="update-only=true" />
</exec>
2010-03-21 15:47:11 +00:00
<exec executable="pack200" failonerror="true">
2010-03-02 00:09:09 +00:00
<arg value="-g" />
<arg value="plugin/lib/syndie.jar.pack" />
<arg value="${build.dir}/syndie.jar" />
2010-03-02 00:09:09 +00:00
</exec>
2010-03-21 15:47:11 +00:00
<exec executable="scripts/makeplugin.sh" failonerror="true">
2010-03-02 00:09:09 +00:00
<arg value="plugin" />
</exec>
2010-03-03 00:20:57 +00:00
<move file="syndie.xpi2p" tofile="syndie-linux-i386-update.xpi2p" />
<!-- make the windows update xpi2p -->
<copy file="scripts/plugin-windows.config" tofile="plugin/plugin.config" overwrite="true" />
2010-03-21 15:47:11 +00:00
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
2010-03-03 00:20:57 +00:00
<arg value="version=${release.number}-b${build.number}" />
</exec>
2010-03-21 15:47:11 +00:00
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
2010-03-03 00:20:57 +00:00
<arg value="update-only=true" />
</exec>
<copy file="scripts/clients-windows.config" tofile="plugin/clients.config" overwrite="true" />
2010-03-21 15:47:11 +00:00
<exec executable="scripts/makeplugin.sh" failonerror="true">
2010-03-03 00:20:57 +00:00
<arg value="plugin" />
</exec>
<move file="syndie.xpi2p" tofile="syndie-win32-update.xpi2p" />
2010-03-02 00:09:09 +00:00
<!-- make the install xpi2p -->
<copy file="lib/hsqldb_lic.txt" todir="plugin" />
2010-03-05 18:39:14 +00:00
<copy file="scripts/LICENSE-swt.txt" todir="plugin" />
2010-03-03 00:20:57 +00:00
<copy file="scripts/plugin-linux.config" tofile="plugin/plugin.config" overwrite="true" />
<copy file="scripts/clients-linux.config" tofile="plugin/clients.config" overwrite="true" />
2010-03-21 15:47:11 +00:00
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
2010-03-02 00:09:09 +00:00
<arg value="version=${release.number}-b${build.number}" />
</exec>
2010-03-21 15:47:11 +00:00
<exec executable="pack200" failonerror="true">
2010-03-02 00:09:09 +00:00
<arg value="-g" />
<arg value="plugin/lib/hsqldb.jar.pack" />
<arg value="${lib.dir}/hsqldb.jar" />
</exec>
2010-03-21 15:47:11 +00:00
<exec executable="pack200" failonerror="true">
2010-03-02 00:09:09 +00:00
<arg value="-g" />
<arg value="plugin/lib/swt.jar.pack" />
<arg value="${lib.dir}/swt.jar" />
</exec>
2010-03-21 15:47:11 +00:00
<exec executable="scripts/makeplugin.sh" failonerror="true">
2010-03-02 00:09:09 +00:00
<arg value="plugin" />
</exec>
2010-03-03 00:20:57 +00:00
<move file="syndie.xpi2p" tofile="syndie-linux-i386.xpi2p" />
2010-03-08 01:31:12 +00:00
<!-- make the 64 bit linux install xpi2p -->
2010-03-21 15:47:11 +00:00
<exec executable="pack200" failonerror="true">
2010-03-08 01:31:12 +00:00
<arg value="-g" />
<arg value="plugin/lib/swt.jar.pack" />
<arg value="${lib.dir}/swt-linux-x86-64.jar" />
</exec>
2010-03-21 15:47:11 +00:00
<exec executable="scripts/makeplugin.sh" failonerror="true">
2010-03-08 01:31:12 +00:00
<arg value="plugin" />
</exec>
<move file="syndie.xpi2p" tofile="syndie-linux-x86-64.xpi2p" />
2010-03-03 00:20:57 +00:00
<!-- make the windows install xpi2p -->
<copy file="scripts/plugin-windows.config" tofile="plugin/plugin.config" overwrite="true" />
<copy file="scripts/clients-windows.config" tofile="plugin/clients.config" overwrite="true" />
2010-03-21 15:47:11 +00:00
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
2010-03-03 00:20:57 +00:00
<arg value="version=${release.number}-b${build.number}" />
</exec>
2010-03-21 15:47:11 +00:00
<exec executable="pack200" failonerror="true">
2010-03-03 00:20:57 +00:00
<arg value="-g" />
<arg value="plugin/lib/swt.jar.pack" />
<arg value="${lib.dir}/swt-win32.jar" />
</exec>
2010-03-21 15:47:11 +00:00
<exec executable="scripts/makeplugin.sh" failonerror="true">
2010-03-03 00:20:57 +00:00
<arg value="plugin" />
</exec>
<move file="syndie.xpi2p" tofile="syndie-win32.xpi2p" />
2010-03-02 00:09:09 +00:00
</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, getReleaseNumber, getBuildNumber">
<!-- default if not set above -->
<property name="workspace.version" value="unknown" />
<property name="full.version" value="${release.number}-${syndie.build.number}" />
<echo message="Building version ${full.version} (mtn rev ${workspace.version})" />
</target>
<target name="getExtendedVersion" depends="buildProperties, -trimMtnRev" description="Include trimmed MTN rev ID (if available or requested) in the version 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}" />
</target>
<target name="-trimMtnRev" depends="-getMtnRev" 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]+";' 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='.*"[^"]+b-([0-9]+)";' 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>
<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="prep-docs">
<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/licenses"/>
<copy file="lib/hsqldb_lic.txt" todir="${pkgtemp.dir}/doc/licenses" />
</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 todir="${pkgtemp.dir}/doc/licenses/SWT/about_files">
<fileset dir="doc/licenses/SWT/mac/about_files" />
</copy>
<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">
<move todir="${dist.dir}">
<fileset dir="${pkgtemp.dir}" />
</move>
</target>
<target name="pkg-exe" depends="clean, jars2exe, pkg"/>
<target name="source-tarball" depends="getExtendedVersion" 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}-${Extended.Version}.tar.bz2" />
<echo message="Checking out fresh copy into ../${ant.project.name}-${Extended.Version} for tarballing:" />
<delete dir="../${ant.project.name}-${Extended.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}-${Extended.Version}" />
</exec>
<delete includeemptydirs="true" quiet="false">
<fileset dir="../${ant.project.name}-${Extended.Version}/_MTN" />
</delete>
<tar longfile="gnu" destfile="${source.tarball.name}" compression="bzip2">
<tarfileset dir="../${ant.project.name}-${Extended.Version}" prefix="${ant.project.name}-${Extended.Version}">
<include name="**/**" />
<exclude name="debian/**"/>
<exclude name="**/*.sh"/>
</tarfileset>
<tarfileset dir="../${ant.project.name}-${Extended.Version}" prefix="${ant.project.name}-${Extended.Version}" filemode="755">
<exclude name="debian/**" />
<include name="**/*.sh" />
</tarfileset>
</tar>
</target>
2013-01-06 21:31:30 +00:00
<target name="debian-tarball" depends="source-tarball">
<copy verbose="true" file="${source.tarball.name}"
tofile="../${ant.project.name}_${Extended.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">
2013-01-06 21:31:30 +00:00
<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"/>
2013-01-06 21:31:30 +00:00
</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}">
2013-01-07 22:17:48 +00:00
<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}" />
<pathelement location="${hsqldb.jar}" />
</classpath>
</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" />
</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" />
</delete>
<delete file="syndie-installer*.jar" />
<delete file="syndie-installer*.exe" />
<delete file="syndie-update.xpi2p" />
<delete file="syndie-win32.xpi2p" />
<delete file="syndie-win32-update.xpi2p" />
<delete file="syndie-linux-i386.xpi2p" />
<delete file="syndie-linux-i386-update.xpi2p" />
<delete file="syndie-linux-x86-64.xpi2p" />
</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" 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="installer-linux" depends="installer-linux32, installer-linux64, delete-windows-files" description="Create Linux installers (i386 and x86_64)"/>
<target name="installer-linux32" depends="-check-for-izpack, stub-jars, preppkg, delete-windows-files" description="Create i386 installer for Linux">
<ant dir="swt" target="ensure-lin32-swt" />
<build-installer os="linux" arch="32" swt="${swt.lin32}" />
</target>
<target name="installer-linux64" depends="-check-for-izpack, stub-jars, preppkg, delete-windows-files" description="Create x86_64 installer for Linux">
<ant dir="swt" target="ensure-lin64-swt" />
<build-installer os="linux" arch="64" swt="${swt.lin64}" />
</target>
<target name="installer-windows" depends="installer-windows64-exe, installer-windows32-exe" 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" description="Create i386 installer for Windows">
<ant dir="swt" target="ensure-win32-swt" />
<build-installer os="win" arch="32" swt="swt/lib/swt-win32.jar" />
</target>
<target name="installer-windows64" depends="-check-for-izpack, jars2exe, stub-jars, preppkg" description="Create x86_64 installer for Windows">
<ant dir="swt" target="ensure-win64-swt" />
<build-installer os="win" arch="64" swt="swt/lib/swt-win64.jar" />
</target>
<target name="installer-all" depends="installer-linux, installer-windows" description="Create Windows and Linux 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="${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>
2013-01-11 19:52:05 +00:00
<string>1.102.${syndie.build.number}</string>
2013-01-11 20:31:33 +00:00
<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" />
<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 "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-${full.version}.tar.bz2" compression="bzip2">
<tarfileset dir="${pkgtemp.dir}" prefix="syndie-cli-${full.version}" filemode="644">
<include name="bin/*" />
<include name="lib/hsqldb.jar" />
<include name="doc/*" />
<include name="doc/licenses/**" />
<exclude name="doc/web" />
</tarfileset>
</tar>
</target>
<target name="pkg-osx" depends="pkg-osx32, pkg-osx64" description="Create both i386 and x86_64 packages for OSX" />
<target name="pkg-osx32" depends="prep-osx" description="Create an i386 package 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" />
2013-01-11 19:52:05 +00:00
<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
exec java -d32 -XstartOnFirstThread -cp $CP syndie.gui.SWTUI
]]></echo>
<tar destfile="syndie-${full.version}.bin.osx32.tar.bz2" compression="bzip2">
<tarfileset dir="pkg-osx" prefix="syndie-${full.version}" filemode="644">
<include name="**/**" />
<exclude name="**/*.sh" />
</tarfileset>
<tarfileset dir="pkg-osx" prefix="syndie-${full.version}" filemode="755">
<include name="**/*.sh" />
</tarfileset>
</tar>
</target>
<target name="pkg-osx64" depends="prep-osx" description="Create an x86_64 package 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" />
2013-01-11 19:52:05 +00:00
<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
exec java -d64 -XstartOnFirstThread -cp $CP syndie.gui.SWTUI
]]></echo>
<tar destfile="syndie-${full.version}.bin.osx64.tar.bz2" compression="bzip2">
<tarfileset dir="pkg-osx" prefix="syndie-${full.version}" filemode="644">
<include name="**/**" />
<exclude name="**/*.sh" />
</tarfileset>
<tarfileset dir="pkg-osx" prefix="syndie-${full.version}" filemode="755">
<include name="**/*.sh" />
</tarfileset>
</tar>
</target>
<target name="pkg-all" depends="distclean, pkg-cli, installer-linux, installer-windows, pkg-osx" description="Create packags/installers for all supported systems." />
</project>
<!-- vim: set ft=xml ts=4 sw=4 et: -->