source: apps/i2ptunnel/java/build.xml @ 93045c2a

Last change on this file since 93045c2a was 93045c2a, checked in by walking <walking@…>, 10 years ago

make windoz msg bundling suck less

  • Property mode set to 100644
File size: 8.3 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<project basedir="." default="all" name="i2ptunnel">
3    <target name="all" depends="clean, build" />
4    <target name="build" depends="builddep, jar, war" />
5    <target name="builddep">
6        <!-- run from top level build.xml to get dependencies built -->
7    </target>
8    <condition property="depend.available">
9        <typefound name="depend" />
10    </condition>
11    <target name="depend" if="depend.available">
12        <depend
13            cache="../../../build"
14            srcdir="./src" 
15            destdir="./build/obj" >
16            <!-- Depend on classes instead of jars where available -->
17            <classpath>
18                <pathelement location="../../../core/java/build/obj" />
19                <pathelement location="../../ministreaming/java/build/obj" />
20            </classpath>
21        </depend>
22    </target>
23    <property name="javac.compilerargs" value="" />
24    <target name="compile" depends="depend">
25        <mkdir dir="./build" />
26        <mkdir dir="./build/obj" />
27        <javac 
28            srcdir="./src" 
29            debug="true" deprecation="on" source="1.5" target="1.5" 
30            destdir="./build/obj" 
31            classpath="../../../core/java/build/i2p.jar:../../ministreaming/java/build/mstreaming.jar" >
32            <compilerarg line="${javac.compilerargs}" />
33        </javac>
34    </target>
35
36    <!-- TODO: Move the web classes from the jar to the war - they are not part of the API
37      -  This will require sponge to rewrite some seedless stuff that uses it.
38     -->
39    <target name="jar" depends="builddep, compile">
40        <jar destfile="./build/i2ptunnel.jar" basedir="./build/obj" includes="**/*.class">
41            <manifest>
42                <attribute name="Main-Class" value="net.i2p.i2ptunnel.I2PTunnel" />
43                <attribute name="Class-Path" value="i2p.jar mstreaming.jar" />
44            </manifest>
45        </jar>
46    </target>
47
48    <target name="bundle" depends="compile, precompilejsp">
49        <!-- Update the messages_*.po files.
50             We need to supply the bat file for windows, and then change the fail property to true -->
51        <exec executable="sh" osfamily="unix" failifexecutionfails="true" >
52            <arg value="./bundle-messages.sh" />
53        </exec>
54        <exec executable="sh" osfamily="mac" failifexecutionfails="true" >
55            <arg value="./bundle-messages.sh" />
56        </exec>
57        <exec executable="sh" osfamily="windows" failifexecutionfails="true" >
58            <arg value="./bundle-messages.sh" />
59        </exec>
60    </target>
61
62    <target name="poupdate" depends="compile, precompilejsp">
63        <!-- Update the messages_*.po files. -->
64        <exec executable="sh" osfamily="unix" failifexecutionfails="true" >
65            <arg value="./bundle-messages.sh" />
66            <arg value="-p" />
67        </exec>
68        <exec executable="sh" osfamily="mac" failifexecutionfails="true" >
69            <arg value="./bundle-messages.sh" />
70            <arg value="-p" />
71        </exec>
72        <exec executable="sh" osfamily="windows" failifexecutionfails="true" >
73            <arg value="./bundle-messages.sh" />
74            <arg value="-p" />
75        </exec>
76    </target>
77
78    <target name="war" depends="precompilejsp, bundle"> 
79        <war destfile="build/i2ptunnel.war" webxml="../jsp/web-out.xml"
80             basedir="../jsp/" excludes="web.xml, web-fragment.xml, web-out.xml, **/*.java, *.jsp">
81        </war>
82    </target>
83
84    <target name="precompilejsp" depends="jar" unless="precompilejsp.uptodate">
85        <delete dir="../jsp/WEB-INF/" />
86        <delete file="../jsp/web-fragment.xml" />
87        <delete file="../jsp/web-out.xml" />
88        <mkdir dir="../jsp/WEB-INF/" />
89        <mkdir dir="../jsp/WEB-INF/classes" />
90        <!-- there are various jspc ant tasks, but they all seem a bit flakey -->
91        <java classname="org.apache.jasper.JspC" fork="true" failonerror="true">
92            <classpath>
93                <pathelement location="../../jetty/jettylib/jasper-compiler.jar" />
94                <pathelement location="../../jetty/jettylib/jasper-runtime.jar" />
95                <pathelement location="../../jetty/jettylib/javax.servlet.jar" />
96                <pathelement location="../../jetty/jettylib/commons-logging.jar" />
97                <pathelement location="../../jetty/jettylib/commons-el.jar" />
98                <pathelement location="../../jetty/jettylib/ant.jar" />
99                <pathelement location="build/i2ptunnel.jar" />
100            </classpath>
101            <arg value="-d" />
102            <arg value="../jsp/WEB-INF/classes" />
103            <arg value="-p" />
104            <arg value="net.i2p.i2ptunnel.jsp" />
105            <arg value="-webinc" />
106            <arg value="../jsp/web-fragment.xml" />
107            <arg value="-webapp" />
108            <arg value="../jsp/" />
109        </java>
110        <javac debug="true" deprecation="on" source="1.5" target="1.5" 
111               destdir="../jsp/WEB-INF/classes/" srcdir="../jsp/WEB-INF/classes" includes="**/*.java">
112            <compilerarg line="${javac.compilerargs}" />
113            <classpath>
114                <pathelement location="../../jetty/jettylib/jasper-runtime.jar" />
115                <pathelement location="../../jetty/jettylib/javax.servlet.jar" />
116                <pathelement location="../../jetty/jettylib/commons-logging.jar" />
117                <pathelement location="../../jetty/jettylib/commons-el.jar" />
118                <pathelement location="build/i2ptunnel.jar" />
119            </classpath>
120        </javac>
121        <copy file="../jsp/web.xml" tofile="../jsp/web-out.xml" />
122        <loadfile property="jspc.web.fragment" srcfile="../jsp/web-fragment.xml" />
123        <replace file="../jsp/web-out.xml">
124            <replacefilter token="&lt;!-- precompiled servlets --&gt;" value="${jspc.web.fragment}" />
125        </replace>
126    </target>
127
128    <uptodate property="precompilejsp.uptodate" targetfile="../jsp/web-out.xml">
129        <srcfiles dir= "../jsp" includes="*.jsp, *.html, web.xml"/>
130    </uptodate>
131
132    <target name="javadoc">
133        <mkdir dir="./build" />
134        <mkdir dir="./build/javadoc" />
135        <javadoc 
136            sourcepath="./src:../../../core/java/src:../../ministreaming/java/src" destdir="./build/javadoc" 
137            packagenames="*" 
138            use="true" 
139            splitindex="true" 
140            windowtitle="I2PTunnel" />
141    </target>
142
143    <target name="compileTest">
144        <mkdir dir="./build" />
145        <mkdir dir="./build/obj" />
146        <javac srcdir="./src:./test" debug="true" source="1.5" target="1.5" deprecation="on" destdir="./build/obj" >
147            <compilerarg line="${javac.compilerargs}" />
148            <classpath>
149                <pathelement location="../../../core/java/build/i2p.jar" />
150                <pathelement location="../../ministreaming/java/build/mstreaming.jar" />
151            </classpath>
152        </javac>
153    </target>
154    <target name="test" depends="clean, compileTest">
155        <junit printsummary="on" fork="yes">
156            <classpath>
157                <pathelement path="${classpath}" />
158                <pathelement location="./build/obj" />
159                <pathelement location="../../../core/java/build/i2p.jar" />
160            </classpath>
161            <batchtest>
162                <fileset dir="./test/">
163                    <include name="**/*Test.java" />
164                </fileset>
165            </batchtest>
166            <formatter type="xml"/>
167        </junit>
168        <mkdir dir="../../../reports/" />
169        <mkdir dir="../../../reports/i2ptunnel/" />
170        <mkdir dir="../../../reports/i2ptunnel/junit/" />
171        <delete>
172            <fileset dir="../../../reports/i2ptunnel/junit">
173                <include name="TEST-*.xml"/>
174            </fileset>
175        </delete>
176        <copy todir="../../../reports/i2ptunnel/junit">
177            <fileset dir=".">
178                <include name="TEST-*.xml"/>
179            </fileset>
180        </copy>
181        <delete>
182            <fileset dir=".">
183                <include name="TEST-*.xml"/>
184            </fileset>
185        </delete>
186    </target>
187
188    <target name="clean">
189        <delete dir="./build" />
190        <delete dir="../jsp/WEB-INF/" />
191        <delete file="../jsp/web-fragment.xml" />
192        <delete file="../jsp/web-out.xml" />
193    </target>
194    <target name="cleandep" depends="clean">
195    </target>
196    <target name="distclean" depends="clean">
197    </target>
198</project>
Note: See TracBrowser for help on using the repository browser.