forked from I2P_Developers/i2p.i2p

The aging v3.1.x of the java wrapper is being replaced in this checkin with the latest (current) stable release, 3.5.9. There is now only one copy of wrapper.jar, located in wrapper/all. The build.xml scripts have been changed to reflect this new path. All binaries--with the exception of solaris (I don't have SPARC hardware)--have been stripped. FreeBSD x64 is being included in this release. I have only included the x86 macosx wrapper due to not having a system to test the x64 code on. On the plus side, the wrapper is universal (a FAT powerpc & Intel Mac) binary. No more prompting to install Rosetta!
292 lines
15 KiB
XML
292 lines
15 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<project basedir="." default="all" name="routerconsole">
|
|
<target name="all" depends="clean, build" />
|
|
<target name="build" depends="builddep, jar" />
|
|
<target name="builddep">
|
|
<!-- run from top level build.xml to get dependencies built -->
|
|
</target>
|
|
<target name="prepare">
|
|
<!-- run from top level build.xml to get dependencies built -->
|
|
</target>
|
|
<condition property="depend.available">
|
|
<typefound name="depend" />
|
|
</condition>
|
|
<target name="depend" if="depend.available">
|
|
<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="../../../router/java/build/obj" />
|
|
<pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
|
|
<pathelement location="../../jetty/jettylib/javax.servlet.jar" />
|
|
<pathelement location="../../systray/java/build/obj" />
|
|
<pathelement location="../../systray/java/lib/systray4j.jar" />
|
|
<pathelement location="../../desktopgui/build" />
|
|
<pathelement location="../../../installer/lib/wrapper/all/wrapper.jar" />
|
|
<pathelement location="../../jrobin/jrobin-1.5.9.1.jar" />
|
|
</classpath>
|
|
</depend>
|
|
</target>
|
|
<target name="dependVersion">
|
|
<!-- Force the dependency on the RouterVersion as depend doesn't recognize constant changes -->
|
|
<dependset>
|
|
<srcfilelist dir="." files="../../../router/java/build/obj/net/i2p/router/RouterVersion.class" />
|
|
<targetfilelist dir="." files="build/obj/net/i2p/router/web/NewsFetcher.class" />
|
|
<targetfilelist dir="." files="build/obj/net/i2p/router/web/SummaryHelper.class" />
|
|
<targetfilelist dir="." files="build/obj/net/i2p/router/web/UpdateHandler.class" />
|
|
</dependset>
|
|
</target>
|
|
<property name="javac.compilerargs" value="" />
|
|
<target name="compile" depends="prepare, depend, dependVersion">
|
|
<mkdir dir="./build" />
|
|
<mkdir dir="./build/obj" />
|
|
<javac
|
|
srcdir="./src"
|
|
debug="true" deprecation="on" source="1.5" target="1.5"
|
|
includeAntRuntime="false"
|
|
destdir="./build/obj">
|
|
<compilerarg line="${javac.compilerargs}" />
|
|
<classpath>
|
|
<pathelement location="../../../core/java/build/i2p.jar" />
|
|
<pathelement location="../../../router/java/build/router.jar" />
|
|
<pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
|
|
<pathelement location="../../jetty/jettylib/javax.servlet.jar" />
|
|
<pathelement location="../../systray/java/build/systray.jar" />
|
|
<pathelement location="../../systray/java/lib/systray4j.jar" />
|
|
<pathelement location="../../desktopgui/dist/desktopgui.jar" />
|
|
<pathelement location="../../../installer/lib/wrapper/all/wrapper.jar" />
|
|
<pathelement location="../../jrobin/jrobin-1.5.9.1.jar" />
|
|
</classpath>
|
|
</javac>
|
|
</target>
|
|
|
|
<!-- the jar with the latest message classes from the jsps, and the war too -->
|
|
<target name="jar" depends="jar1, war, bundle" />
|
|
|
|
<!-- the jar without the latest message classes from the jsps -->
|
|
<target name="jar1" depends="compile, jarUpToDate" unless="jar.uptodate" >
|
|
<exec executable="mtn" outputproperty="workspace.changes.j" errorproperty="mtn.error2" failifexecutionfails="false" >
|
|
<arg value="list" />
|
|
<arg value="changed" />
|
|
<arg value="." />
|
|
<arg value="../locale" />
|
|
</exec>
|
|
<!-- \n in an attribute value generates an invalid manifest -->
|
|
<exec executable="tr" inputstring="${workspace.changes.j}" outputproperty="workspace.changes.j.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
|
|
<arg value="-s" />
|
|
<arg value="[:space:]" />
|
|
<arg value="," />
|
|
</exec>
|
|
<jar destfile="./build/routerconsole.jar" basedir="./build/obj" includes="**/*.class">
|
|
<manifest>
|
|
<!-- top level installer will rename to jrobin.jar -->
|
|
<!-- DTG added in 0.8.4, not in the classpath for very old installs, before we changed wrapper.config to specify * -->
|
|
<attribute name="Class-Path" value="i2p.jar router.jar jrobin.jar desktopgui.jar" />
|
|
<attribute name="Build-Date" value="${build.timestamp}" />
|
|
<attribute name="Base-Revision" value="${workspace.version}" />
|
|
<attribute name="Workspace-Changes" value="${workspace.changes.j.tr}" />
|
|
</manifest>
|
|
</jar>
|
|
</target>
|
|
|
|
<!-- this is tricky because the message classes go in the jar, not in the war -->
|
|
<target name="bundle" depends="jar1, precompilejsp" >
|
|
<!-- Update the messages_*.po files.
|
|
We need to supply the bat file for windows, and then change the fail property to true -->
|
|
<exec executable="sh" osfamily="unix" failifexecutionfails="true" >
|
|
<arg value="./bundle-messages.sh" />
|
|
</exec>
|
|
<exec executable="sh" osfamily="mac" failifexecutionfails="true" >
|
|
<arg value="./bundle-messages.sh" />
|
|
</exec>
|
|
<!-- multi-lang is optional -->
|
|
<exec executable="sh" osfamily="windows" failifexecutionfails="false" >
|
|
<arg value="./bundle-messages.sh" />
|
|
</exec>
|
|
<!-- jar again to get the latest messages_*.class files -->
|
|
<jar destfile="./build/routerconsole.jar" basedir="./build/obj" includes="**/*.class" update="true" />
|
|
</target>
|
|
|
|
|
|
<target name="jarUpToDate">
|
|
<uptodate property="jar.uptodate" targetfile="build/routerconsole.jar" >
|
|
<srcfiles dir= "build/obj" includes="**/*.class" />
|
|
</uptodate>
|
|
</target>
|
|
|
|
<target name="poupdate" depends="precompilejsp">
|
|
<!-- Update the messages_*.po files.
|
|
We need to supply the bat file for windows, and then change the fail property to true -->
|
|
<exec executable="sh" osfamily="unix" failifexecutionfails="true" >
|
|
<arg value="./bundle-messages.sh" />
|
|
<arg value="-p" />
|
|
</exec>
|
|
<exec executable="sh" osfamily="mac" failifexecutionfails="true" >
|
|
<arg value="./bundle-messages.sh" />
|
|
<arg value="-p" />
|
|
</exec>
|
|
<exec executable="sh" osfamily="windows" failifexecutionfails="true" >
|
|
<arg value="./bundle-messages.sh" />
|
|
<arg value="-p" />
|
|
</exec>
|
|
</target>
|
|
|
|
<!-- does NOT update the message classes, as those go in the jar -->
|
|
<target name="war" depends="precompilejsp, warUpToDate" unless="war.uptodate" >
|
|
<exec executable="mtn" outputproperty="workspace.changes.w" errorproperty="mtn.error2" failifexecutionfails="false" >
|
|
<arg value="list" />
|
|
<arg value="changed" />
|
|
<arg value="../jsp" />
|
|
</exec>
|
|
<!-- \n in an attribute value generates an invalid manifest -->
|
|
<exec executable="tr" inputstring="${workspace.changes.w}" outputproperty="workspace.changes.w.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
|
|
<arg value="-s" />
|
|
<arg value="[:space:]" />
|
|
<arg value="," />
|
|
</exec>
|
|
<!-- Don't include the css in the war, the main build.xml will copy it to docs/themes/console/ -->
|
|
<war destfile="build/routerconsole.war" webxml="../jsp/web-out.xml"
|
|
basedir="../jsp/" excludes="web.xml, *.css, **/*.java, *.jsp, *.jsi, web-fragment.xml, web-out.xml">
|
|
<manifest>
|
|
<attribute name="Build-Date" value="${build.timestamp}" />
|
|
<attribute name="Base-Revision" value="${workspace.version}" />
|
|
<attribute name="Workspace-Changes" value="${workspace.changes.w.tr}" />
|
|
</manifest>
|
|
</war>
|
|
</target>
|
|
|
|
<target name="warUpToDate">
|
|
<uptodate property="war.uptodate" targetfile="build/routerconsole.war" >
|
|
<srcfiles dir= "../jsp" excludes="web.xml, web-fragment.xml, *.css, **/*.java, *.jsp, *.jsi" />
|
|
</uptodate>
|
|
</target>
|
|
|
|
<target name="precompilejsp" depends="jar1" unless="precompilejsp.uptodate">
|
|
<delete dir="../jsp/WEB-INF/" />
|
|
<delete file="../jsp/web-fragment.xml" />
|
|
<delete file="../jsp/web-out.xml" />
|
|
<mkdir dir="../jsp/WEB-INF/" />
|
|
<mkdir dir="../jsp/WEB-INF/classes" />
|
|
|
|
<!-- there are various jspc ant tasks, but they all seem a bit flakey -->
|
|
<!--
|
|
** Usage: jspc <options> <jsp files>
|
|
** where jsp files is
|
|
** -webapp <dir> A directory containing a web-app, whose JSP pages
|
|
** will be processed recursively
|
|
** or any number of
|
|
** <file> A file to be parsed as a JSP page
|
|
** where options include:
|
|
** -help Print this help message
|
|
** -v Verbose mode
|
|
** -d <dir> Output Directory (default -Djava.io.tmpdir)
|
|
** -l Outputs the name of the JSP page upon failure
|
|
** -s Outputs the name of the JSP page upon success
|
|
** -p <name> Name of target package (default org.apache.jsp)
|
|
** -c <name> Name of target class name (only applies to first JSP page)
|
|
** -mapped Generates separate write() calls for each HTML line in the JSP
|
|
** -die[#] Generates an error return code (#) on fatal errors (default 1)
|
|
** -uribase <dir> The uri directory compilations should be relative to
|
|
** (default "/")
|
|
** -uriroot <dir> Same as -webapp
|
|
** -compile Compiles generated servlets
|
|
** -webinc <file> Creates a partial servlet mappings in the file
|
|
** -webxml <file> Creates a complete web.xml in the file
|
|
** -ieplugin <clsid> Java Plugin classid for Internet Explorer
|
|
** -classpath <path> Overrides java.class.path system property
|
|
** -xpoweredBy Add X-Powered-By response header
|
|
** -trimSpaces Trim spaces in template text between actions, directives
|
|
-->
|
|
<java classname="org.apache.jasper.JspC" fork="true" failonerror="true">
|
|
<classpath>
|
|
<pathelement location="../../jetty/jettylib/jasper-compiler.jar" />
|
|
<pathelement location="../../jetty/jettylib/jasper-runtime.jar" />
|
|
<pathelement location="../../jetty/jettylib/javax.servlet.jar" />
|
|
<pathelement location="../../jetty/jettylib/commons-logging.jar" />
|
|
<pathelement location="../../jetty/jettylib/commons-el.jar" />
|
|
<pathelement location="../../jetty/jettylib/ant.jar" />
|
|
<pathelement location="../../systray/java/build/obj" />
|
|
<pathelement location="../../systray/java/lib/systray4j.jar" />
|
|
<pathelement location="../../desktopgui/dist/desktopgui.jar" />
|
|
<pathelement location="../../../installer/lib/wrapper/all/wrapper.jar" />
|
|
<pathelement location="build/routerconsole.jar" />
|
|
<pathelement location="build/" />
|
|
<pathelement location="../../../router/java/build/router.jar" />
|
|
<pathelement location="../../../core/java/build/i2p.jar" />
|
|
</classpath>
|
|
<arg value="-d" />
|
|
<arg value="../jsp/WEB-INF/classes" />
|
|
<arg value="-v" />
|
|
<arg value="-p" />
|
|
<arg value="net.i2p.router.web.jsp" />
|
|
<arg value="-webinc" />
|
|
<arg value="../jsp/web-fragment.xml" />
|
|
<arg value="-webapp" />
|
|
<arg value="../jsp/" />
|
|
</java>
|
|
|
|
<javac debug="true" deprecation="on" source="1.5" target="1.5"
|
|
encoding="UTF-8"
|
|
includeAntRuntime="false"
|
|
destdir="../jsp/WEB-INF/classes/"
|
|
srcdir="../jsp/WEB-INF/classes" includes="**/*.java">
|
|
<compilerarg line="${javac.compilerargs}" />
|
|
<classpath>
|
|
<pathelement location="../../jetty/jettylib/jasper-runtime.jar" />
|
|
<pathelement location="../../jetty/jettylib/javax.servlet.jar" />
|
|
<pathelement location="../../jetty/jettylib/commons-logging.jar" />
|
|
<pathelement location="../../jetty/jettylib/commons-el.jar" />
|
|
<pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
|
|
<pathelement location="../../systray/java/build/obj" />
|
|
<pathelement location="../../systray/java/lib/systray4j.jar" />
|
|
<pathelement location="../../desktopgui/dist/desktopgui.jar" />
|
|
<pathelement location="../../../installer/lib/wrapper/all/wrapper.jar" />
|
|
<pathelement location="build/routerconsole.jar" />
|
|
<pathelement location="build" />
|
|
<pathelement location="../../../router/java/build/router.jar" />
|
|
<pathelement location="../../../core/java/build/i2p.jar" />
|
|
</classpath>
|
|
</javac>
|
|
|
|
<!-- save these so we can run gettext on the generated java files later
|
|
<delete>
|
|
<fileset dir="../jsp/WEB-INF/" includes="**/*.java" />
|
|
<fileset dir="../jsp/WEB-INF/" includes="**/*.jsp" />
|
|
</delete>
|
|
-->
|
|
<copy file="../jsp/web.xml" tofile="../jsp/web-out.xml" />
|
|
<loadfile property="jspc.web.fragment" srcfile="../jsp/web-fragment.xml" />
|
|
<replace file="../jsp/web-out.xml">
|
|
<replacefilter token="<!-- precompiled servlets -->" value="${jspc.web.fragment}" />
|
|
</replace>
|
|
</target>
|
|
|
|
<uptodate property="precompilejsp.uptodate" targetfile="../jsp/web-out.xml">
|
|
<srcfiles dir= "../jsp" includes="**/*.jsp, *.jsi, **/*.html, *.css, susimail/susimail, web.xml"/>
|
|
</uptodate>
|
|
|
|
<target name="javadoc">
|
|
<mkdir dir="./build" />
|
|
<mkdir dir="./build/javadoc" />
|
|
<javadoc
|
|
sourcepath="./src:../../../core/java/src:../../../router/java/src:../../systray/java/src:../../desktopgui/src" destdir="./build/javadoc"
|
|
packagenames="*"
|
|
use="true"
|
|
splitindex="true"
|
|
windowtitle="Router Console" />
|
|
</target>
|
|
<target name="clean">
|
|
<delete dir="./build" />
|
|
<delete dir="../jsp/WEB-INF/" />
|
|
<delete file="../jsp/web-fragment.xml" />
|
|
<delete file="../jsp/web-out.xml" />
|
|
</target>
|
|
<target name="cleandep" depends="clean">
|
|
</target>
|
|
<target name="distclean" depends="clean">
|
|
</target>
|
|
</project>
|