2009-04-13 17:27:02 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
2013-01-08 12:40:40 +00:00
|
|
|
<project name="syndie" default="usage" basedir=".">
|
2009-05-28 21:28:37 +00:00
|
|
|
<description>Builds, tests and runs the project syndie.</description>
|
2013-01-04 21:08:25 +00:00
|
|
|
<!--
|
|
|
|
Include property files so that values can be easily overridden.
|
2013-01-08 01:25:33 +00:00
|
|
|
Users should create an override.properties file to make changes.
|
2013-01-04 21:08:25 +00:00
|
|
|
-->
|
|
|
|
<property file="override.properties"/>
|
|
|
|
<property file="build.properties"/>
|
|
|
|
|
2012-06-03 01:00:56 +00:00
|
|
|
|
2013-01-09 23:51:38 +00:00
|
|
|
<!-- Set some global properties up -->
|
2009-05-28 21:28:37 +00:00
|
|
|
<property name="src.dir" value="src" />
|
2013-01-05 17:04:49 +00:00
|
|
|
<property name="data.dir" value="data" />
|
2009-05-28 21:28:37 +00:00
|
|
|
<property name="build.dir" value="build" />
|
|
|
|
<property name="dist.dir" value="dist" />
|
|
|
|
<property name="lib.dir" value="lib" />
|
2013-01-09 01:20:09 +00:00
|
|
|
<property name="pkgtemp.dir" value="pkg-temp" />
|
2009-05-28 21:28:37 +00:00
|
|
|
<property name="dist.lib.jar" value="${dist.dir}/syndie.jar" />
|
2013-01-09 23:51:38 +00:00
|
|
|
<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="desktop.class" value="syndie.gui.desktop.DesktopMain" />
|
|
|
|
<property name="tabs.class" value="syndie.gui.SWTUI" />
|
|
|
|
<property name="cli.class" value="syndie.db.TextUI" />
|
2012-06-03 01:00:56 +00:00
|
|
|
|
2013-01-04 21:08:25 +00:00
|
|
|
<!-- 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" />
|
2013-01-10 00:07:22 +00:00
|
|
|
<available property="launch4j.available" file="${launch4j.dir}/launch4j.jar" type="file" />
|
2013-01-04 21:08:25 +00:00
|
|
|
|
2013-01-09 23:51:38 +00:00
|
|
|
<!-- Set some classpaths up -->
|
2009-05-28 21:28:37 +00:00
|
|
|
<path id="classpath.build">
|
2013-01-04 21:08:25 +00:00
|
|
|
<pathelement location="${hsqldb.jar}" />
|
|
|
|
<pathelement location="${i2p.jar}" />
|
|
|
|
<pathelement location="${swt.jar}" />
|
2009-05-28 21:28:37 +00:00
|
|
|
</path>
|
|
|
|
<path id="classpath.run">
|
2013-01-09 23:51:38 +00:00
|
|
|
<pathelement location="${build.dir}/syndie.jar" />
|
2009-05-28 21:28:37 +00:00
|
|
|
<path refid="classpath.build" />
|
|
|
|
</path>
|
2012-06-03 01:00:56 +00:00
|
|
|
|
2013-01-09 23:51:38 +00:00
|
|
|
<!-- Set up a fileset for the resources -->
|
2009-05-28 21:28:37 +00:00
|
|
|
<path id="resources.path">
|
2013-01-05 17:04:49 +00:00
|
|
|
<fileset dir="${data.dir}" />
|
2009-05-28 21:28:37 +00:00
|
|
|
</path>
|
2012-06-03 01:00:56 +00:00
|
|
|
|
2013-01-08 12:40:40 +00:00
|
|
|
<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"/>
|
2013-01-09 23:51:38 +00:00
|
|
|
<echo message=" distclean: ${tab}Clean up all generated files" />
|
|
|
|
<echo message=" jar: ${tab}Create syndie.jar in build/ without the dependencies"/>
|
2013-01-08 12:40:40 +00:00
|
|
|
<echo message=" javadocs: ${tab}Generate javadocs for ${ant.project.name}" />
|
2013-01-09 23:51:38 +00:00
|
|
|
<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" />
|
2013-01-08 12:40:40 +00:00
|
|
|
</target>
|
2013-01-09 02:36:17 +00:00
|
|
|
|
2013-01-09 23:51:38 +00:00
|
|
|
<macrodef name="make-stub-jar">
|
|
|
|
<attribute name="type" />
|
|
|
|
<attribute name="type-class" />
|
|
|
|
<attribute name="additional" default=""/>
|
|
|
|
|
|
|
|
<sequential>
|
|
|
|
<jar destfile="${pkgtemp.dir}/Syndie-@{type}.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" />
|
|
|
|
<sequential>
|
|
|
|
<local name="launch4j.config" />
|
|
|
|
<tempfile property="launch4j.config" deleteonexit="true" />
|
2013-01-10 00:07:22 +00:00
|
|
|
<fail unless="launch4j.available">Specify the location of the Launch4J installation directory with -Dlaunch4j.dir=/some/path/to/launch4j.jar</fail>
|
2013-01-09 23:51:38 +00:00
|
|
|
<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}/Syndie-@{type}.jar</jar>
|
|
|
|
<outfile>${pkgtemp.dir}/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>
|
|
|
|
|
2013-01-04 21:08:25 +00:00
|
|
|
<target name="init" depends="buildProperties">
|
2013-01-09 02:36:17 +00:00
|
|
|
<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>
|
2013-01-04 21:08:25 +00:00
|
|
|
<tstamp>
|
|
|
|
<format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC" locale="en" />
|
|
|
|
</tstamp>
|
2009-05-28 21:28:37 +00:00
|
|
|
<mkdir dir="${dist.dir}" />
|
2013-01-09 23:51:38 +00:00
|
|
|
<mkdir dir="${build.dir}/obj" />
|
2009-05-28 21:28:37 +00:00
|
|
|
</target>
|
2012-06-03 01:00:56 +00:00
|
|
|
|
2013-01-07 11:50:55 +00:00
|
|
|
<condition property="depend.available">
|
|
|
|
<typefound name="depend" />
|
|
|
|
</condition>
|
|
|
|
|
|
|
|
<target name="depend" if="depend.available">
|
|
|
|
<depend
|
|
|
|
cache="builddep"
|
2013-01-07 14:40:19 +00:00
|
|
|
srcdir="src"
|
2013-01-09 23:51:38 +00:00
|
|
|
destdir="${build.dir}/obj">
|
2013-01-07 11:50:55 +00:00
|
|
|
<classpath>
|
|
|
|
<path refid="classpath.build" />
|
|
|
|
</classpath>
|
|
|
|
</depend>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="compile" depends="init, depend" description="compile the source">
|
2013-01-09 23:51:38 +00:00
|
|
|
<javac srcdir="${src.dir}" destdir="${build.dir}/obj" debug="true" source="1.5" target="1.5"
|
2013-01-07 19:13:54 +00:00
|
|
|
deprecation="on" includeAntRuntime="false">
|
2009-05-28 21:28:37 +00:00
|
|
|
<classpath>
|
|
|
|
<path refid="classpath.build" />
|
|
|
|
</classpath>
|
|
|
|
</javac>
|
|
|
|
</target>
|
2012-06-03 01:00:56 +00:00
|
|
|
|
2013-01-09 23:51:38 +00:00
|
|
|
<target name="jar" depends="compile" description="Build jar in ./build">
|
2013-01-08 01:25:33 +00:00
|
|
|
<property name="build.built-by" value="unknown" />
|
2013-01-09 23:51:38 +00:00
|
|
|
<jar jarfile="${build.dir}/syndie.jar">
|
|
|
|
<fileset dir="${build.dir}/obj" />
|
2013-01-07 11:50:55 +00:00
|
|
|
<path refid="resources.path" />
|
2013-01-08 01:25:33 +00:00
|
|
|
<manifest>
|
|
|
|
<attribute name="Built-By" value="${build.built-by}" />
|
|
|
|
<attribute name="Build-Date" value="${build.timestamp}" />
|
|
|
|
<attribute name="Base-revision" value="${workspace.version}" />
|
|
|
|
</manifest>
|
2013-01-07 11:50:55 +00:00
|
|
|
</jar>
|
2009-05-28 21:28:37 +00:00
|
|
|
</target>
|
2009-05-23 18:41:24 +00:00
|
|
|
|
2009-05-28 21:28:37 +00:00
|
|
|
<target name="dist" depends="jar" description="Combine all jars">
|
2013-01-09 23:51:38 +00:00
|
|
|
<copy file="${swt.jar}" todir="${pkgtemp.lib}" />
|
|
|
|
<copy file="${i2p.jar}" todir="${pkgtemp.lib}" />
|
|
|
|
<copy file="${hsqldb.jar}" todir="${pkgtemp.lib}" />
|
2009-05-28 21:28:37 +00:00
|
|
|
<jar jarfile="syndie.jar" index="true">
|
|
|
|
<manifest>
|
|
|
|
<attribute name="Main-Class" value="syndie.gui.SWTUI"/>
|
2013-01-08 01:25:33 +00:00
|
|
|
<attribute name="Built-By" value="${build.built-by}" />
|
|
|
|
<attribute name="Build-Date" value="${build.timestamp}" />
|
|
|
|
<attribute name="Base-revision" value="${workspace.version}" />
|
2009-05-28 21:28:37 +00:00
|
|
|
</manifest>
|
2013-01-09 23:51:38 +00:00
|
|
|
<zipfileset src="${build.dir}/syndie.jar" includes="**" />
|
|
|
|
<zipgroupfileset dir="${pkgtemp.lib}" includes="*.jar"/>
|
2009-05-28 21:28:37 +00:00
|
|
|
</jar>
|
|
|
|
</target>
|
2012-06-03 01:00:56 +00:00
|
|
|
|
2013-01-08 11:55:05 +00:00
|
|
|
<target name="run" depends="jar" description="run Syndie with the 'Tabs' interface">
|
2009-05-28 21:28:37 +00:00
|
|
|
<condition property="run.args" value="">
|
|
|
|
<not>
|
|
|
|
<isset property="run.args" />
|
|
|
|
</not>
|
|
|
|
</condition>
|
2013-01-08 01:25:33 +00:00
|
|
|
<echo message="Running Syndie with args ${run.args}" />
|
2009-05-28 21:28:37 +00:00
|
|
|
<java classname="syndie.gui.SWTUI" fork="true" failonerror="false">
|
|
|
|
<arg line="${run.args}" />
|
|
|
|
<classpath>
|
|
|
|
<path refid="classpath.run" />
|
|
|
|
</classpath>
|
|
|
|
</java>
|
|
|
|
</target>
|
2012-06-03 01:00:56 +00:00
|
|
|
|
2013-01-08 11:55:05 +00:00
|
|
|
<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>
|
|
|
|
|
2013-01-10 00:07:22 +00:00
|
|
|
<target name="-check-launch4j" if="launch4j.available" description="Check if this system can run launch4j">
|
2013-01-09 23:51:38 +00:00
|
|
|
<condition property="can.create.exe">
|
|
|
|
<and>
|
|
|
|
<or>
|
|
|
|
<os arch="amd64" />
|
|
|
|
<os arch="x86" />
|
|
|
|
<os arch="i386" />
|
|
|
|
<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 type="Tabs" />
|
|
|
|
<wrap-to-exe type="CLI" />
|
|
|
|
</target>
|
|
|
|
|
2013-01-07 19:13:54 +00:00
|
|
|
<target name="plugin" depends="buildProperties, jar">
|
2010-03-02 00:09:09 +00:00
|
|
|
<mkdir dir="plugin/lib" />
|
|
|
|
<buildnumber file="scripts/build.number" />
|
|
|
|
|
2011-05-28 13:51:44 +00:00
|
|
|
<!-- 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" />
|
2011-05-30 16:16:29 +00:00
|
|
|
<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">
|
2013-01-07 19:13:54 +00:00
|
|
|
<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" />
|
2013-01-09 23:51:38 +00:00
|
|
|
<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>
|
2012-06-03 01:00:56 +00:00
|
|
|
|
2013-01-09 23:51:38 +00:00
|
|
|
<target name="-checkForMtn">
|
2013-01-04 21:08:25 +00:00
|
|
|
<available property="mtn.available" file="_MTN" type="dir" />
|
|
|
|
</target>
|
|
|
|
|
2013-01-09 23:51:38 +00:00
|
|
|
<target name="getMtnRev" depends="-checkForMtn" if="mtn.available">
|
2013-01-07 19:13:54 +00:00
|
|
|
<exec executable="mtn" outputproperty="workspace.version" errorproperty="mtn.error1" failifexecutionfails="false">
|
2013-01-04 21:08:25 +00:00
|
|
|
<arg value="automate" />
|
|
|
|
<arg value="get_base_revision_id" />
|
|
|
|
</exec>
|
|
|
|
</target>
|
|
|
|
|
2013-01-07 19:13:54 +00:00
|
|
|
<target name="buildProperties" depends="getMtnRev, getReleaseNumber, getBuildNumber">
|
2013-01-04 21:08:25 +00:00
|
|
|
<!-- default if not set above -->
|
|
|
|
<property name="workspace.version" value="unknown" />
|
2013-01-07 19:13:54 +00:00
|
|
|
<property name="full.version" value="${release.number}-${syndie.build.number}" />
|
2013-01-04 21:08:25 +00:00
|
|
|
<echo message="Building version ${full.version} (mtn rev ${workspace.version})" />
|
|
|
|
</target>
|
|
|
|
|
2013-01-08 12:19:55 +00:00
|
|
|
<target name="getExtendedVersion" depends="buildProperties, trimMtnRev" description="Include trimmed MTN rev ID (if available) 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>
|
2013-01-04 21:08:25 +00:00
|
|
|
|
2013-01-08 12:19:55 +00:00
|
|
|
<target name="trimMtnRev" depends="getMtnRev" unless="withoutRev" description="Output a shortend 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">
|
2013-01-04 21:08:25 +00:00
|
|
|
<loadfile srcfile="src/syndie/Version.java" property="release.number">
|
|
|
|
<filterchain>
|
|
|
|
<linecontains>
|
|
|
|
<contains value="public static final String VERSION"/>
|
|
|
|
</linecontains>
|
|
|
|
<tokenfilter>
|
2013-01-07 19:13:54 +00:00
|
|
|
<replaceregex pattern='.*"([^"]+)-[0-9]+";' replace="\1" flags="gi" />
|
2013-01-04 21:08:25 +00:00
|
|
|
</tokenfilter>
|
|
|
|
<striplinebreaks/>
|
|
|
|
<trim/>
|
|
|
|
<ignoreblank/>
|
|
|
|
</filterchain>
|
|
|
|
</loadfile>
|
|
|
|
<property name="release.number" value="unknown" />
|
|
|
|
<echo message="Release number is ${release.number}" />
|
|
|
|
</target>
|
2013-01-06 15:44:26 +00:00
|
|
|
|
2013-01-08 12:19:55 +00:00
|
|
|
<target name="getBuildNumber" description="Extract the build number from the source">
|
2013-01-07 19:13:54 +00:00
|
|
|
<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>
|
|
|
|
|
2013-01-09 23:51:38 +00:00
|
|
|
<target name="-stub-jars" depends="jar, preppkg" description="Create manifest-only jars for Syndie">
|
|
|
|
<make-stub-jar type="Desktop" additional="lib/swt.jar" type-class="${desktop.class}" />
|
|
|
|
<make-stub-jar type="Tabs" additional="lib/swt.jar" type-class="${tabs.class}" />
|
|
|
|
<make-stub-jar type="CLI" type-class="${cli.class}" />
|
|
|
|
</target>
|
|
|
|
|
2013-01-09 02:36:17 +00:00
|
|
|
<target name="preppkg" depends="prep-docs">
|
|
|
|
<copy todir="${pkgtemp.dir}/bin">
|
|
|
|
<fileset dir="./bin" />
|
|
|
|
</copy>
|
2013-01-09 23:51:38 +00:00
|
|
|
<copy file="${swt.jar}" todir="${pkgtemp.dir}/lib" />
|
|
|
|
<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" />
|
2013-01-09 02:36:17 +00:00
|
|
|
</target>
|
2013-01-09 01:20:09 +00:00
|
|
|
|
|
|
|
<target name="prep-docs">
|
|
|
|
<copy todir="${pkgtemp.dir}/docs">
|
|
|
|
<fileset dir="." includes="CHANGES CREDITS INSTALL README TODO" />
|
|
|
|
</copy>
|
|
|
|
<copy todir="${pkgtemp.dir}/docs/html">
|
|
|
|
<fileset dir="doc/web" />
|
|
|
|
</copy>
|
2013-01-09 02:36:17 +00:00
|
|
|
<copy file="LICENSE" todir="${pkgtemp.dir}/docs/licenses"/>
|
2013-01-09 03:01:22 +00:00
|
|
|
<copy file="lib/hsqldb_lic.txt" todir="${pkgtemp.dir}/docs/licenses" />
|
2013-01-09 02:36:17 +00:00
|
|
|
<copy file="src/com/LICENSE.txt" tofile="${pkgtemp.dir}/docs/licenses/LICENSE-Jazzy-GPL-v2.1.txt" />
|
2013-01-09 01:20:09 +00:00
|
|
|
</target>
|
|
|
|
|
2013-01-09 23:51:38 +00:00
|
|
|
|
|
|
|
<target name="prep-swt-licenses" depends="prep-win-licenses, prep-lin-licenses, prep-mac-licenses, prep-common-swt" />
|
2013-01-09 02:36:17 +00:00
|
|
|
<target name="prep-common-swt">
|
2013-01-09 01:20:09 +00:00
|
|
|
<copy todir="${pkgtemp.dir}/docs/licenses/SWT/about_files">
|
|
|
|
<fileset dir="doc/licenses/SWT/common" />
|
|
|
|
</copy>
|
|
|
|
</target>
|
|
|
|
|
2013-01-09 02:36:17 +00:00
|
|
|
<target name="prep-win-licenses" depends="prep-common-swt">
|
|
|
|
<copy file="doc/licenses/SWT/lin/about.html" tofile="${pkgtemp.dir}/docs/licenses/SWT/Windows.html" />
|
2013-01-09 01:20:09 +00:00
|
|
|
</target>
|
|
|
|
|
2013-01-09 02:36:17 +00:00
|
|
|
<target name="prep-lin-licenses" depends="prep-common-swt">
|
|
|
|
<copy todir="${pkgtemp.dir}/docs/licenses/SWT/about_files">
|
|
|
|
<fileset dir="doc/licenses/SWT/lin/about_files" />
|
2013-01-09 01:20:09 +00:00
|
|
|
</copy>
|
2013-01-09 02:36:17 +00:00
|
|
|
<copy file="doc/licenses/SWT/lin/about.html" tofile="${pkgtemp.dir}/docs/licenses/SWT/Linux.html" />
|
2013-01-09 01:20:09 +00:00
|
|
|
</target>
|
|
|
|
|
2013-01-09 02:36:17 +00:00
|
|
|
<target name="prep-mac-licenses" depends="prep-common-swt">
|
|
|
|
<copy todir="${pkgtemp.dir}/docs/licenses/SWT/about_files">
|
|
|
|
<fileset dir="doc/licenses/SWT/mac/about_files" />
|
2013-01-09 01:20:09 +00:00
|
|
|
</copy>
|
2013-01-09 02:36:17 +00:00
|
|
|
<copy file="doc/licenses/SWT/mac/about.html" tofile="${pkgtemp.dir}/docs/licenses/SWT/OSX.html" />
|
2013-01-09 01:20:09 +00:00
|
|
|
</target>
|
|
|
|
|
2013-01-10 00:07:22 +00:00
|
|
|
<target name="prep-launch4j-license" if="launch4j.available">
|
2013-01-09 23:51:38 +00:00
|
|
|
<copy file="${launch4j.dir}/LICENSE.txt" tofile="docs/licenses/License-Launch4j.txt" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="pkg" depends="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="-jars2exe, pkg"/>
|
|
|
|
|
2013-01-08 12:19:55 +00:00
|
|
|
<target name="source-tarball" depends="getExtendedVersion" description="Generate source tarball">
|
2013-01-06 18:26:40 +00:00
|
|
|
<!-- 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="tarball.name" value="${ant.project.name}_${Extended.Version}.orig.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="../${tarball.name}" compression="bzip2">
|
2013-01-09 01:20:09 +00:00
|
|
|
<tarfileset dir="../${ant.project.name}-${Extended.Version}" prefix="${ant.project.name}-${Extended.Version}">
|
2013-01-06 18:26:40 +00:00
|
|
|
<include name="**/**" />
|
|
|
|
<exclude name="debian/**"/>
|
|
|
|
<exclude name="**/*.sh"/>
|
|
|
|
</tarfileset>
|
2013-01-09 01:20:09 +00:00
|
|
|
<tarfileset dir="../${ant.project.name}-${Extended.Version}" prefix="${ant.project.name}-${Extended.Version}" filemode="755">
|
2013-01-06 18:26:40 +00:00
|
|
|
<exclude name="debian/**" />
|
|
|
|
<include name="**/*.sh" />
|
|
|
|
</tarfileset>
|
|
|
|
</tar>
|
|
|
|
</target>
|
2013-01-06 21:31:30 +00:00
|
|
|
|
2013-01-08 12:19:55 +00:00
|
|
|
<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 -->
|
2013-01-09 23:51:38 +00:00
|
|
|
<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>
|
2013-01-07 19:13:54 +00:00
|
|
|
|
2013-01-08 12:40:40 +00:00
|
|
|
<target name="javadoc" depends="javadocs" />
|
|
|
|
<target name="javadocs" depends="buildProperties" description="Generate Javadocs">
|
2013-01-07 19:13:54 +00:00
|
|
|
<!-- 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.*" />
|
2013-01-07 19:13:54 +00:00
|
|
|
<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>
|
2013-01-08 12:19:55 +00:00
|
|
|
|
|
|
|
<target name="clean" description="clean up">
|
|
|
|
<delete dir="${build.dir}" />
|
|
|
|
<delete dir="builddep" />
|
|
|
|
<delete file="sloccount.sc" />
|
|
|
|
<delete dir="plugin" />
|
2013-01-09 01:20:09 +00:00
|
|
|
<delete dir="${pkgtemp.dir}" />
|
2013-01-08 12:19:55 +00:00
|
|
|
<delete file="${ant.project.name}.fba" />
|
2013-01-09 01:20:09 +00:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="distclean" depends="clean" description="more throrough clean-up">
|
2013-01-08 12:19:55 +00:00
|
|
|
<delete file="syndie.xpi2p" />
|
2013-01-09 01:20:09 +00:00
|
|
|
<delete dir="${dist.dir}" />
|
|
|
|
<delete file="syndie.jar" />
|
2013-01-08 12:19:55 +00:00
|
|
|
<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>
|
2013-01-09 23:51:38 +00:00
|
|
|
|
|
|
|
<target name="totallyclean" depends="distclean" description="Clean-up even more">
|
|
|
|
<delete file="lib/i2p.jar" />
|
|
|
|
<delete file="lib/swt.jar" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="debug" description="Print properties">
|
2013-01-09 02:36:17 +00:00
|
|
|
<echoproperties/>
|
|
|
|
</target>
|
2013-01-09 23:51:38 +00:00
|
|
|
|
2009-04-13 17:27:02 +00:00
|
|
|
</project>
|
2012-06-03 01:00:56 +00:00
|
|
|
<!-- vim: set ft=xml ts=4 sw=4 et: -->
|