2005-10-19 22:02:37 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<project basedir="." default="all" name="i2psnark">
|
|
|
|
<target name="all" depends="clean, build" />
|
2005-12-16 03:00:48 +00:00
|
|
|
<target name="build" depends="builddep, jar, war" />
|
2005-10-19 22:02:37 +00:00
|
|
|
<target name="builddep">
|
2010-11-28 03:56:56 +00:00
|
|
|
<!-- run from top level build.xml to get dependencies built -->
|
2005-10-19 22:02:37 +00:00
|
|
|
</target>
|
2008-11-14 14:48:08 +00:00
|
|
|
<condition property="depend.available">
|
|
|
|
<typefound name="depend" />
|
|
|
|
</condition>
|
|
|
|
<target name="depend" if="depend.available">
|
2008-11-12 17:08:09 +00:00
|
|
|
<depend
|
|
|
|
cache="../../../build"
|
|
|
|
srcdir="./src"
|
|
|
|
destdir="./build/obj" >
|
|
|
|
<!-- Depend on classes instead of jars where available -->
|
|
|
|
<classpath>
|
|
|
|
<pathelement location="../../../core/java/build/obj" />
|
|
|
|
<pathelement location="../../ministreaming/java/build/obj" />
|
|
|
|
<pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
|
|
|
|
<pathelement location="../../jetty/jettylib/javax.servlet.jar" />
|
|
|
|
</classpath>
|
|
|
|
</depend>
|
|
|
|
</target>
|
2011-06-13 14:31:41 +00:00
|
|
|
|
2009-04-26 15:54:51 +00:00
|
|
|
<property name="javac.compilerargs" value="" />
|
2011-06-13 14:31:41 +00:00
|
|
|
<property name="require.gettext" value="true" />
|
|
|
|
|
2008-11-12 17:08:09 +00:00
|
|
|
<target name="compile" depends="depend">
|
2005-10-19 22:02:37 +00:00
|
|
|
<mkdir dir="./build" />
|
|
|
|
<mkdir dir="./build/obj" />
|
|
|
|
<javac
|
|
|
|
srcdir="./src"
|
2008-10-10 17:25:58 +00:00
|
|
|
debug="true" deprecation="on" source="1.5" target="1.5"
|
2005-10-19 22:02:37 +00:00
|
|
|
destdir="./build/obj"
|
2011-02-17 12:47:35 +00:00
|
|
|
includeAntRuntime="false"
|
2009-04-26 15:54:51 +00:00
|
|
|
classpath="../../../core/java/build/i2p.jar:../../jetty/jettylib/org.mortbay.jetty.jar:../../jetty/jettylib/javax.servlet.jar:../../ministreaming/java/build/mstreaming.jar" >
|
|
|
|
<compilerarg line="${javac.compilerargs}" />
|
|
|
|
</javac>
|
2005-10-19 22:02:37 +00:00
|
|
|
</target>
|
2011-02-17 12:47:35 +00:00
|
|
|
|
2011-06-08 20:15:53 +00:00
|
|
|
<target name="listChangedFiles" depends="jarUpToDate" if="shouldListChanges" >
|
2011-02-17 12:47:35 +00:00
|
|
|
<exec executable="mtn" outputproperty="workspace.changes" errorproperty="mtn.error2" failifexecutionfails="false" >
|
|
|
|
<arg value="list" />
|
|
|
|
<arg value="changed" />
|
|
|
|
<arg value=".." />
|
|
|
|
</exec>
|
|
|
|
<!-- \n in an attribute value generates an invalid manifest -->
|
|
|
|
<exec executable="tr" inputstring="${workspace.changes}" outputproperty="workspace.changes.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
|
|
|
|
<arg value="-s" />
|
|
|
|
<arg value="[:space:]" />
|
|
|
|
<arg value="," />
|
|
|
|
</exec>
|
2011-06-08 20:15:53 +00:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="jar" depends="builddep, compile, jarUpToDate, listChangedFiles" unless="jar.uptodate" >
|
|
|
|
<!-- set if unset -->
|
|
|
|
<property name="workspace.changes.tr" value="" />
|
2009-12-10 02:12:18 +00:00
|
|
|
<jar destfile="./build/i2psnark.jar" basedir="./build/obj" includes="**/*.class" excludes="**/I2PSnarkServlet*.class **/messages_*.class">
|
2005-10-19 22:02:37 +00:00
|
|
|
<manifest>
|
|
|
|
<attribute name="Main-Class" value="org.klomp.snark.Snark" />
|
2005-10-19 23:18:29 +00:00
|
|
|
<attribute name="Class-Path" value="i2p.jar mstreaming.jar streaming.jar" />
|
2011-02-17 12:47:35 +00:00
|
|
|
<attribute name="Build-Date" value="${build.timestamp}" />
|
|
|
|
<attribute name="Base-Revision" value="${workspace.version}" />
|
|
|
|
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
2005-10-19 22:02:37 +00:00
|
|
|
</manifest>
|
|
|
|
</jar>
|
2005-12-16 03:00:48 +00:00
|
|
|
</target>
|
2011-02-17 12:47:35 +00:00
|
|
|
|
|
|
|
<target name="jarUpToDate">
|
|
|
|
<uptodate property="jar.uptodate" targetfile="build/i2psnark.jar" >
|
|
|
|
<srcfiles dir= "build/obj" includes="**/*.class" excludes="**/I2PSnarkServlet*.class **/messages_*.class" />
|
|
|
|
</uptodate>
|
2011-06-08 20:15:53 +00:00
|
|
|
<condition property="shouldListChanges" >
|
|
|
|
<and>
|
|
|
|
<not>
|
|
|
|
<isset property="jar.uptodate" />
|
|
|
|
</not>
|
|
|
|
<not>
|
|
|
|
<isset property="wjar.uptodate" />
|
|
|
|
</not>
|
|
|
|
<isset property="mtn.available" />
|
|
|
|
</and>
|
|
|
|
</condition>
|
2011-02-17 12:47:35 +00:00
|
|
|
</target>
|
|
|
|
|
2009-06-15 21:27:38 +00:00
|
|
|
<!-- Ideally we would include
|
|
|
|
- only include the servlet, everything else is in the jar.
|
|
|
|
- However, the wrapper.config classpath in existing installs
|
|
|
|
- does not include i2psnark.jar.
|
|
|
|
- So we must continue to duplicate everything in the war.
|
|
|
|
<classes dir="./build/obj" includes="**/I2PSnarkServlet*.class" />
|
|
|
|
-->
|
2011-06-08 20:15:53 +00:00
|
|
|
<target name="war" depends="jar, bundle, warUpToDate, listChangedFiles" unless="war.uptodate" >
|
|
|
|
<!-- set if unset -->
|
|
|
|
<property name="workspace.changes.tr" value="" />
|
2010-05-25 13:08:34 +00:00
|
|
|
<war destfile="../i2psnark.war" webxml="../web.xml" basedir="../" includes="_icons/*" >
|
2010-02-06 18:44:29 +00:00
|
|
|
<!-- include only the web stuff, as of 0.7.12 the router will add i2psnark.jar to the classpath for the war -->
|
|
|
|
<classes dir="./build/obj" includes="**/web/*.class" />
|
2011-02-17 12:47:35 +00:00
|
|
|
<manifest>
|
|
|
|
<attribute name="Build-Date" value="${build.timestamp}" />
|
|
|
|
<attribute name="Base-Revision" value="${workspace.version}" />
|
2011-03-20 18:28:29 +00:00
|
|
|
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
2011-02-17 12:47:35 +00:00
|
|
|
</manifest>
|
2005-12-16 03:00:48 +00:00
|
|
|
</war>
|
2005-10-19 22:02:37 +00:00
|
|
|
</target>
|
2005-12-18 05:39:52 +00:00
|
|
|
|
2011-02-17 12:47:35 +00:00
|
|
|
<target name="warUpToDate">
|
|
|
|
<uptodate property="war.uptodate" targetfile="../i2psnark.war" >
|
2011-02-24 15:45:18 +00:00
|
|
|
<srcfiles dir= "." includes="build/obj/org/klomp/snark/web/*.class ../_icons/* ../web.xml" />
|
2011-02-17 12:47:35 +00:00
|
|
|
</uptodate>
|
|
|
|
</target>
|
|
|
|
|
2009-12-09 20:54:10 +00:00
|
|
|
<target name="bundle" depends="compile">
|
|
|
|
<!-- Update the messages_*.po files.
|
|
|
|
We need to supply the bat file for windows, and then change the fail property to true -->
|
2011-06-13 14:31:41 +00:00
|
|
|
<exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
|
2009-12-09 20:54:10 +00:00
|
|
|
<arg value="./bundle-messages.sh" />
|
|
|
|
</exec>
|
2011-06-13 14:31:41 +00:00
|
|
|
<exec executable="sh" osfamily="mac" failifexecutionfails="true" failonerror="${require.gettext}" >
|
2009-12-09 20:54:10 +00:00
|
|
|
<arg value="./bundle-messages.sh" />
|
|
|
|
</exec>
|
2011-02-25 16:01:30 +00:00
|
|
|
<!-- multi-lang is optional -->
|
|
|
|
<exec executable="sh" osfamily="windows" failifexecutionfails="false" >
|
2011-02-12 11:30:21 +00:00
|
|
|
<arg value="./bundle-messages.sh" />
|
2009-12-09 20:54:10 +00:00
|
|
|
</exec>
|
|
|
|
</target>
|
|
|
|
|
2010-07-03 13:39:25 +00:00
|
|
|
<target name="poupdate" depends="builddep, compile">
|
2009-12-09 20:54:10 +00:00
|
|
|
<!-- Update the messages_*.po files. -->
|
2011-06-13 14:31:41 +00:00
|
|
|
<exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="true" >
|
2009-12-09 20:54:10 +00:00
|
|
|
<arg value="./bundle-messages.sh" />
|
|
|
|
<arg value="-p" />
|
|
|
|
</exec>
|
2011-06-13 14:31:41 +00:00
|
|
|
<exec executable="sh" osfamily="mac" failifexecutionfails="true" failonerror="true" >
|
2009-12-09 20:54:10 +00:00
|
|
|
<arg value="./bundle-messages.sh" />
|
|
|
|
<arg value="-p" />
|
|
|
|
</exec>
|
2011-06-13 14:31:41 +00:00
|
|
|
<exec executable="sh" osfamily="windows" failifexecutionfails="true" failonerror="true" >
|
2011-02-12 11:30:21 +00:00
|
|
|
<arg value="./bundle-messages.sh" />
|
2009-12-09 20:54:10 +00:00
|
|
|
<arg value="-p" />
|
|
|
|
</exec>
|
|
|
|
</target>
|
|
|
|
|
2005-12-18 05:39:52 +00:00
|
|
|
<target name="standalone" depends="standalone_prep">
|
|
|
|
<zip destfile="i2psnark-standalone.zip">
|
|
|
|
<zipfileset dir="./dist/" prefix="i2psnark/" />
|
|
|
|
</zip>
|
|
|
|
</target>
|
|
|
|
<target name="standalone_prep" depends="war">
|
|
|
|
<delete dir="./dist" />
|
|
|
|
<mkdir dir="./dist" />
|
2009-06-15 15:22:51 +00:00
|
|
|
<copy file="../launch-i2psnark" todir="./dist/" />
|
2005-12-22 12:49:09 +00:00
|
|
|
<mkdir dir="./dist/webapps" />
|
|
|
|
<copy file="../i2psnark.war" tofile="./dist/webapps/i2psnark.war" />
|
2005-12-18 05:39:52 +00:00
|
|
|
<mkdir dir="./dist/lib" />
|
2009-06-15 15:22:51 +00:00
|
|
|
<copy file="./build/i2psnark.jar" tofile="./dist/lib/i2psnark.jar" />
|
2005-12-18 05:39:52 +00:00
|
|
|
<copy file="../../../core/java/build/i2p.jar" tofile="./dist/lib/i2p.jar" />
|
|
|
|
<copy file="../../jetty/jettylib/commons-el.jar" tofile="./dist/lib/commons-el.jar" />
|
|
|
|
<copy file="../../jetty/jettylib/commons-logging.jar" tofile="./dist/lib/commons-logging.jar" />
|
|
|
|
<copy file="../../jetty/jettylib/javax.servlet.jar" tofile="./dist/lib/javax.servlet.jar" />
|
|
|
|
<copy file="../../jetty/jettylib/org.mortbay.jetty.jar" tofile="./dist/lib/org.mortbay.jetty.jar" />
|
|
|
|
<copy file="../../jetty/jettylib/jasper-compiler.jar" tofile="./dist/lib/jasper-compiler.jar" />
|
|
|
|
<copy file="../../jetty/jettylib/jasper-runtime.jar" tofile="./dist/lib/jasper-runtime.jar" />
|
|
|
|
<copy file="../../ministreaming/java/build/mstreaming.jar" tofile="./dist/lib/mstreaming.jar" />
|
|
|
|
<copy file="../../streaming/java/build/streaming.jar" tofile="./dist/lib/streaming.jar" />
|
|
|
|
<copy file="../jetty-i2psnark.xml" tofile="./dist/jetty-i2psnark.xml" />
|
|
|
|
<copy file="../readme-standalone.txt" tofile="./dist/readme.txt" />
|
|
|
|
<mkdir dir="./dist/logs" />
|
|
|
|
|
|
|
|
<zip destfile="i2psnark-standalone.zip">
|
|
|
|
<zipfileset dir="./dist/" prefix="i2psnark/" />
|
|
|
|
</zip>
|
|
|
|
</target>
|
|
|
|
|
2005-10-19 22:02:37 +00:00
|
|
|
<target name="clean">
|
|
|
|
<delete dir="./build" />
|
2005-12-16 03:00:48 +00:00
|
|
|
<delete file="../i2psnark.war" />
|
2005-12-18 05:39:52 +00:00
|
|
|
<delete file="./i2psnark-standalone.zip" />
|
2009-06-15 21:27:38 +00:00
|
|
|
<delete dir="./dist" />
|
2005-10-19 22:02:37 +00:00
|
|
|
</target>
|
|
|
|
<target name="cleandep" depends="clean">
|
|
|
|
</target>
|
|
|
|
<target name="distclean" depends="clean">
|
|
|
|
</target>
|
|
|
|
</project>
|