source: apps/routerconsole/java/build.xml @ 15915afe

Last change on this file since 15915afe was 15915afe, checked in by zzz <zzz@…>, 3 years ago

Remove dup DTDs in javax.servlet.jar
Set InstanceManager? for webapps
Remove InstanceManager? log message
Resolves ticket #1818

  • Property mode set to 100644
File size: 30.3 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<project basedir="." default="all" name="routerconsole">
3    <target name="all" depends="clean, build" />
4    <target name="build" depends="builddep, jar" />
5    <target name="builddep">
6        <!-- run from top level build.xml to get dependencies built -->
7    </target>
8    <target name="prepare">
9        <!-- run from top level build.xml to get dependencies built -->
10    </target>
11    <condition property="no.bundle">
12        <isfalse value="${require.gettext}" />
13    </condition>
14    <condition property="depend.available">
15        <typefound name="depend" />
16    </condition>
17    <target name="depend" if="depend.available">
18        <depend
19            cache="../../../build"
20            srcdir="./src" 
21            destdir="./build/obj" >
22            <!-- Depend on classes instead of jars where available -->
23            <classpath>
24                <pathelement location="../../../core/java/build/obj" />
25                <pathelement location="../../../router/java/build/obj" />
26                <pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
27                <pathelement location="../../jetty/jettylib/jetty-util.jar" />
28                <pathelement location="../../jetty/jettylib/javax.servlet.jar" />
29                <pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
30                <pathelement location="../../systray/java/build/obj" />
31                <pathelement location="../../desktopgui/build" />
32                <pathelement location="../../../installer/lib/wrapper/all/wrapper.jar" />
33                <pathelement location="../../jrobin/java/build/jrobin.jar" />
34            </classpath>
35        </depend>
36    </target>
37    <target name="dependVersion">
38        <!-- Force the dependency on the RouterVersion as depend doesn't recognize constant changes  -->
39        <dependset>
40             <srcfilelist dir="." files="../../../router/java/build/obj/net/i2p/router/RouterVersion.class" />
41             <targetfilelist dir="." files="build/obj/net/i2p/router/web/NewsFetcher.class" />
42             <targetfilelist dir="." files="build/obj/net/i2p/router/web/OldConsoleHelper.class" />
43             <targetfilelist dir="." files="build/obj/net/i2p/router/web/PluginStarter.class" />
44             <targetfilelist dir="." files="build/obj/net/i2p/router/web/SummaryHelper.class" />
45             <targetfilelist dir="." files="build/obj/net/i2p/router/web/UpdateHandler.class" />
46        </dependset>
47    </target>
48
49    <property name="javac.compilerargs" value="" />
50    <property name="javac.version" value="1.7" />
51
52    <target name="compile" depends="prepare, depend, dependVersion">
53        <mkdir dir="./build" />
54        <mkdir dir="./build/obj" />
55        <javac 
56            srcdir="./src" 
57            debug="true" deprecation="on" source="${javac.version}" target="${javac.version}" 
58            includeAntRuntime="false"
59            destdir="./build/obj">
60            <compilerarg line="${javac.compilerargs}" />
61            <classpath>
62                <pathelement location="../../../core/java/build/i2p.jar" />
63                <pathelement location="../../../router/java/build/router.jar" />
64                <pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
65                <pathelement location="../../jetty/jettylib/jetty-http.jar" />
66                <pathelement location="../../jetty/jettylib/jetty-io.jar" />
67                <pathelement location="../../jetty/jettylib/jetty-security.jar" />
68                <pathelement location="../../jetty/jettylib/jetty-servlet.jar" />
69                <pathelement location="../../jetty/jettylib/jetty-servlets.jar" />
70                <pathelement location="../../jetty/jettylib/jetty-util.jar" />
71                <pathelement location="../../jetty/jettylib/jetty-webapp.jar" />
72                <pathelement location="../../jetty/jettylib/javax.servlet.jar" />
73                <pathelement location="../../jetty/jettylib/jasper-runtime.jar" />
74                <pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
75                <pathelement location="../../systray/java/build/systray.jar" />
76                <pathelement location="../../desktopgui/dist/desktopgui.jar" />
77                <pathelement location="../../../installer/lib/wrapper/all/wrapper.jar" />
78                <pathelement location="../../jrobin/java/build/jrobin.jar" />
79            </classpath>
80        </javac>
81    </target>
82
83    <!-- newsxml.jar only (subset of routerconsole, no war) for Android -->
84    <target name="compileNewsOnly" depends="prepare, depend, dependVersion">
85        <mkdir dir="./build" />
86        <mkdir dir="./build/obj" />
87        <javac 
88            srcdir="./src" 
89            includes="net/i2p/router/news/*.java"
90            debug="true" deprecation="on" source="${javac.version}" target="${javac.version}" 
91            includeAntRuntime="false"
92            destdir="./build/obj">
93            <compilerarg line="${javac.compilerargs}" />
94            <classpath>
95                <pathelement location="../../../core/java/build/i2p.jar" />
96                <pathelement location="../../../router/java/build/router.jar" />
97            </classpath>
98        </javac>
99    </target>
100
101    <!-- the jar with the latest message classes from the jsps, and the war too -->
102    <target name="jar" depends="jar1, war, bundle" />
103
104    <!-- the jar without the latest message classes from the jsps -->
105    <target name="listChangedFiles" depends="jarUpToDate" if="shouldListChanges" >
106        <exec executable="mtn" outputproperty="workspace.changes.j" errorproperty="mtn.error2" failifexecutionfails="false" >
107            <arg value="list" />
108            <arg value="changed" />
109            <arg value="." />
110            <arg value="../locale" />
111        </exec>
112        <!-- \n in an attribute value generates an invalid manifest -->
113        <exec executable="tr" inputstring="${workspace.changes.j}" outputproperty="workspace.changes.j.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
114            <arg value="-s" />
115            <arg value="[:space:]" />
116            <arg value="," />
117        </exec>
118    </target>
119
120    <target name="jar1" depends="compile, bundle-news, bundle-countries, jarUpToDate, listChangedFiles" unless="jar.uptodate" >
121        <!-- set if unset -->
122        <property name="workspace.changes.j.tr" value="" />
123        <jar destfile="./build/routerconsole.jar" basedir="./build/obj" includes="**/*.class">
124            <manifest>
125                <!-- DTG added in 0.8.4, not in the classpath for very old installs, before we changed wrapper.config to specify * -->
126                <!-- very old installs don't have i2psnark,jstl,standard in the classpath... not added in WebAppConfiguration any more -->
127                <!-- All new jetty 7 jars should have been in 0.9.6, added in 0.9.7 -->
128                <attribute name="Class-Path" value="i2p.jar router.jar jrobin.jar desktopgui.jar i2psnark.jar jstl.jar standard.jar jetty-continuation.jar jetty-http.jar jetty-io.jar jetty-security.jar jetty-servlet.jar jetty-servlets.jar jetty-util.jar jetty-webapp.jar" />
129                <attribute name="Implementation-Version" value="${full.version}" />
130                <attribute name="Built-By" value="${build.built-by}" />
131                <attribute name="Build-Date" value="${build.timestamp}" />
132                <attribute name="Base-Revision" value="${workspace.version}" />
133                <attribute name="Main-Class" value="net.i2p.router.news.CommandLine" />
134                <attribute name="Workspace-Changes" value="${workspace.changes.j.tr}" />
135                <attribute name="X-Compile-Source-JDK" value="${javac.version}" />
136                <attribute name="X-Compile-Target-JDK" value="${javac.version}" />
137            </manifest>
138        </jar>
139    </target>
140
141    <!-- newsxml.jar only (subset of routerconsole, no war) for Android -->
142    <target name="newsxmljar" depends="compileNewsOnly" >
143        <jar destfile="./build/newsxml.jar" basedir="./build/obj" includes="**/*.class">
144        </jar>
145    </target>
146
147    <!-- this is tricky because the message classes go in the jar, not in the war -->
148    <target name="bundle" depends="jar1, precompilejsp" unless="no.bundle">
149        <mkdir dir="build/messages-src" />
150        <!-- Update the messages_*.po files.
151             We need to supply the bat file for windows, and then change the fail property to true -->
152        <exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
153            <env key="JAVA_HOME" value="${java.home}" />
154            <arg value="./bundle-messages.sh" />
155        </exec>
156        <exec executable="sh" osfamily="mac" failifexecutionfails="true" failonerror="${require.gettext}" >
157            <arg value="./bundle-messages.sh" />
158        </exec>
159                <!-- multi-lang is optional -->
160        <exec executable="sh" osfamily="windows" failifexecutionfails="false" >
161            <arg value="./bundle-messages.sh" />
162        </exec>
163        <javac source="${javac.version}" target="${javac.version}" 
164               includeAntRuntime="false"
165               srcdir="build/messages-src" destdir="build/obj">
166            <compilerarg line="${javac.compilerargs}" />
167        </javac>
168        <!-- jar again to get the latest messages_*.class files -->
169        <jar destfile="./build/routerconsole.jar" basedir="./build/obj" includes="**/*.class" update="true" />
170    </target>
171
172    <target name="jarUpToDate">
173        <uptodate property="jar.uptodate" targetfile="build/routerconsole.jar" >
174            <srcfiles dir= "build/obj" includes="**/*.class" />
175        </uptodate>
176        <condition property="shouldListChanges" >
177            <and>
178                <not>
179                    <isset property="jar.uptodate" />
180                </not>
181                <isset property="mtn.available" />
182            </and>
183        </condition>
184    </target>
185
186    <target name="poupdate" depends="precompilejsp">
187        <!-- Update the messages_*.po files.
188             We need to supply the bat file for windows, and then change the fail property to true -->
189        <exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="true" >
190            <arg value="./bundle-messages.sh" />
191            <arg value="-p" />
192        </exec>
193        <exec executable="sh" osfamily="mac" failifexecutionfails="true" failonerror="true" >
194            <arg value="./bundle-messages.sh" />
195            <arg value="-p" />
196        </exec>
197        <exec executable="sh" osfamily="windows" failifexecutionfails="true" failonerror="true" >
198            <arg value="./bundle-messages.sh" />
199            <arg value="-p" />
200        </exec>
201    </target>
202
203    <target name="bundle-news" unless="no.bundle">
204        <mkdir dir="build/messages-news-src" />
205        <exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
206            <env key="JAVA_HOME" value="${java.home}" />
207            <arg value="./bundle-messages-news.sh" />
208        </exec>
209        <exec executable="sh" osfamily="mac" failifexecutionfails="true" failonerror="${require.gettext}" >
210            <arg value="./bundle-messages-news.sh" />
211        </exec>
212        <exec executable="sh" osfamily="windows" failifexecutionfails="false" >
213            <arg value="./bundle-messages-news.sh" />
214        </exec>
215        <javac source="${javac.version}" target="${javac.version}" 
216               includeAntRuntime="false"
217               srcdir="build/messages-news-src" destdir="build/obj">
218            <compilerarg line="${javac.compilerargs}" />
219        </javac>
220    </target>
221
222    <target name="bundle-countries" unless="no.bundle">
223        <mkdir dir="build/messages-countries-src" />
224        <exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
225            <env key="JAVA_HOME" value="${java.home}" />
226            <arg value="./bundle-messages-countries.sh" />
227        </exec>
228        <exec executable="sh" osfamily="mac" failifexecutionfails="true" failonerror="${require.gettext}" >
229            <arg value="./bundle-messages-countries.sh" />
230        </exec>
231        <exec executable="sh" osfamily="windows" failifexecutionfails="false" >
232            <arg value="./bundle-messages-countries.sh" />
233        </exec>
234        <javac source="${javac.version}" target="${javac.version}" 
235               includeAntRuntime="false"
236               srcdir="build/messages-countries-src" destdir="build/obj">
237            <compilerarg line="${javac.compilerargs}" />
238        </javac>
239    </target>
240
241    <target name="extractProxyTags">
242        <java classname="net.i2p.util.TranslateReader" fork="true" failonerror="true">
243            <classpath>
244                <pathelement location="../../../build/i2p.jar" />
245            </classpath>
246            <arg value="tag" />
247            <arg value="../../../installer/resources/initialNews/initialNews.xml" />
248            <arg value="build/News.java" />
249        </java>
250    </target>
251
252    <target name="poupdate-news" depends="extractProxyTags">
253        <exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="true" >
254            <arg value="./bundle-messages-news.sh" />
255            <arg value="-p" />
256        </exec>
257        <exec executable="sh" osfamily="mac" failifexecutionfails="true" failonerror="true" >
258            <arg value="./bundle-messages-news.sh" />
259            <arg value="-p" />
260        </exec>
261        <exec executable="sh" osfamily="windows" failifexecutionfails="true" failonerror="true" >
262            <arg value="./bundle-messages-news.sh" />
263            <arg value="-p" />
264        </exec>
265    </target>
266
267    <target name="poupdate-countries" depends="extractProxyTags">
268        <exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="true" >
269            <arg value="./bundle-messages-countries.sh" />
270            <arg value="-p" />
271        </exec>
272        <exec executable="sh" osfamily="mac" failifexecutionfails="true" failonerror="true" >
273            <arg value="./bundle-messages-countries.sh" />
274            <arg value="-p" />
275        </exec>
276        <exec executable="sh" osfamily="windows" failifexecutionfails="true" failonerror="true" >
277            <arg value="./bundle-messages-countries.sh" />
278            <arg value="-p" />
279        </exec>
280    </target>
281
282    <target name="listChangedFiles2" depends="warUpToDate" if="shouldListChanges2" >
283        <exec executable="mtn" outputproperty="workspace.changes.w" errorproperty="mtn.error2" failifexecutionfails="false" >
284            <arg value="list" />
285            <arg value="changed" />
286            <arg value="../jsp" />
287        </exec>
288        <!-- \n in an attribute value generates an invalid manifest -->
289        <exec executable="tr" inputstring="${workspace.changes.w}" outputproperty="workspace.changes.w.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
290            <arg value="-s" />
291            <arg value="[:space:]" />
292            <arg value="," />
293        </exec>
294    </target>
295
296    <!-- does NOT update the message classes, as those go in the jar -->
297    <target name="war" depends="precompilejsp, warUpToDate, listChangedFiles2" unless="war.uptodate" >
298        <!-- set if unset -->
299        <property name="workspace.changes.w.tr" value="" />
300        <!-- Don't include the css in the war, the main build.xml will copy it to docs/themes/console/ -->
301        <war destfile="build/routerconsole.war" webxml="../jsp/web-out.xml"
302             basedir="../jsp/" excludes="web.xml, *.css, **/*.java, *.jsp, *.jsi, web-fragment.xml, web-out.xml">
303            <manifest>
304                <attribute name="Implementation-Version" value="${full.version}" />
305                <attribute name="Built-By" value="${build.built-by}" />
306                <attribute name="Build-Date" value="${build.timestamp}" />
307                <attribute name="Base-Revision" value="${workspace.version}" />
308                <attribute name="Workspace-Changes" value="${workspace.changes.w.tr}" />
309                <attribute name="X-Compile-Source-JDK" value="${javac.version}" />
310                <attribute name="X-Compile-Target-JDK" value="${javac.version}" />
311            </manifest>
312        </war>
313    </target>
314
315    <target name="warUpToDate">
316        <uptodate property="war.uptodate" targetfile="build/routerconsole.war" >
317            <srcfiles dir= "../jsp" excludes="web.xml, web-fragment.xml, *.css, **/*.java, *.jsp, *.jsi" />
318        </uptodate>
319        <condition property="shouldListChanges" >
320            <and>
321                <not>
322                    <isset property="jar.uptodate" />
323                </not>
324                <isset property="mtn.available" />
325            </and>
326        </condition>
327    </target>
328
329    <target name="precompilejsp" depends="jar1" unless="precompilejsp.uptodate">
330        <delete dir="../jsp/WEB-INF/" />
331        <delete file="../jsp/web-fragment.xml" />
332        <delete file="../jsp/web-out.xml" />
333        <mkdir dir="../jsp/WEB-INF/" />
334        <mkdir dir="../jsp/WEB-INF/classes" />
335
336        <!-- there are various jspc ant tasks, but they all seem a bit flakey -->
337        <!--
338           **     Usage: jspc <options> <jsp files>
339           **     where jsp files is
340           **         -webapp <dir>      A directory containing a web-app, whose JSP pages
341           **                            will be processed recursively
342           **     or any number of
343           **         <file>             A file to be parsed as a JSP page
344           **     where options include:
345           **         -help              Print this help message
346           **         -v                 Verbose mode
347           **         -d <dir>           Output Directory (default -Djava.io.tmpdir)
348           **         -l                 Outputs the name of the JSP page upon failure
349           **         -s                 Outputs the name of the JSP page upon success
350           **         -p <name>          Name of target package (default org.apache.jsp)
351           **         -c <name>          Name of target class name (only applies to first JSP page)
352           **         -mapped            Generates separate write() calls for each HTML line in the JSP
353           **         -die[#]            Generates an error return code (#) on fatal errors (default 1)
354           **         -uribase <dir>     The uri directory compilations should be relative to
355           **                            (default "/")
356           **         -uriroot <dir>     Same as -webapp
357           **         -compile           Compiles generated servlets
358           **         -webinc <file>     Creates a partial servlet mappings in the file
359           **         -webxml <file>     Creates a complete web.xml in the file
360           **         -ieplugin <clsid>  Java Plugin classid for Internet Explorer
361           **         -classpath <path>  Overrides java.class.path system property
362           **         -xpoweredBy        Add X-Powered-By response header
363           **         -trimSpaces        Trim spaces in template text between actions, directives
364        -->
365        <java classname="org.apache.jasper.JspC" fork="true" failonerror="true">
366            <classpath>
367                <pathelement location="../../jetty/jettylib/jasper-runtime.jar" />
368                <pathelement location="../../jetty/jettylib/javax.servlet.jar" />
369
370                <!-- following jars only present for debian builds -->
371                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
372                <pathelement location="../../jetty/jettylib/tomcat-api.jar" />
373                <pathelement location="../../jetty/jettylib/jasper-el.jar" />
374                <pathelement location="../../jetty/jettylib/tomcat-util.jar" />
375                <pathelement location="../../jetty/jettylib/tomcat-util-scan.jar" />
376
377                <pathelement location="../../jetty/jettylib/commons-logging.jar" />
378                <pathelement location="../../jetty/jettylib/commons-el.jar" />
379                <pathelement location="../../jetty/jettylib/jetty-util.jar" />
380                <pathelement location="${ant.home}/lib/ant.jar" />
381                <pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
382                <pathelement location="../../systray/java/build/obj" />
383                <pathelement location="../../desktopgui/dist/desktopgui.jar" />
384                <pathelement location="../../../installer/lib/wrapper/all/wrapper.jar" />
385                <pathelement location="build/routerconsole.jar" />
386                <pathelement location="build/" />
387                <pathelement location="../../../router/java/build/router.jar" />
388                <pathelement location="../../../core/java/build/i2p.jar" />
389            </classpath>
390            <arg value="-d" />
391            <arg value="../jsp/WEB-INF/classes" />
392            <arg value="-v" />
393            <arg value="-p" />
394            <arg value="net.i2p.router.web.jsp" />
395            <arg value="-webinc" />
396            <arg value="../jsp/web-fragment.xml" />
397            <arg value="-webapp" />
398            <arg value="../jsp/" />
399        </java>
400       
401        <javac debug="true" deprecation="on" source="${javac.version}" target="${javac.version}" 
402               encoding="UTF-8"
403               includeAntRuntime="false"
404               destdir="../jsp/WEB-INF/classes/" 
405               srcdir="../jsp/WEB-INF/classes" includes="**/*.java">
406            <compilerarg line="${javac.compilerargs}" />
407            <classpath>
408                <pathelement location="../../jetty/jettylib/jasper-runtime.jar" />
409                <pathelement location="../../jetty/jettylib/javax.servlet.jar" />
410
411                <!-- following jars only present for debian builds -->
412                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
413                <pathelement location="../../jetty/jettylib/tomcat-api.jar" />
414                <pathelement location="../../jetty/jettylib/tomcat-util.jar" />
415                <pathelement location="../../jetty/jettylib/tomcat-util-scan.jar" />
416
417                <pathelement location="../../jetty/jettylib/commons-logging.jar" />
418                <pathelement location="../../jetty/jettylib/commons-el.jar" />
419                <pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
420                <pathelement location="../../jetty/jettylib/jetty-util.jar" />
421                <pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
422                <pathelement location="../../systray/java/build/obj" />
423                <pathelement location="../../desktopgui/dist/desktopgui.jar" />
424                <pathelement location="../../../installer/lib/wrapper/all/wrapper.jar" />
425                <pathelement location="build/routerconsole.jar" />
426                <pathelement location="build" />
427                <pathelement location="../../../router/java/build/router.jar" />
428                <pathelement location="../../../core/java/build/i2p.jar" />
429            </classpath>
430        </javac>
431
432        <!-- save these so we can run gettext on the generated java files later
433        <delete>
434            <fileset dir="../jsp/WEB-INF/" includes="**/*.java" />
435            <fileset dir="../jsp/WEB-INF/" includes="**/*.jsp" />
436        </delete>
437        -->
438        <copy file="../jsp/web.xml" tofile="../jsp/web-out.xml" />
439        <loadfile property="jspc.web.fragment" srcfile="../jsp/web-fragment.xml" />
440        <replace file="../jsp/web-out.xml">
441            <replacefilter token="&lt;!-- precompiled servlets --&gt;" value="${jspc.web.fragment}" />
442        </replace>
443    </target>
444
445    <uptodate property="precompilejsp.uptodate" targetfile="../jsp/web-out.xml">
446        <srcfiles dir= "../jsp" includes="**/*.jsp, *.jsi, **/*.html, *.css, susimail/susimail, web.xml"/>
447        <!-- so the version is right on logs.jsp -->
448        <srcfiles dir= "../../../router/java/src/net/i2p/router" includes="RouterVersion.java"/>
449    </uptodate>
450
451    <target name="javadoc">
452        <mkdir dir="./build" />
453        <mkdir dir="./build/javadoc" />
454        <javadoc 
455            sourcepath="./src:../../../core/java/src:../../../router/java/src:../../systray/java/src:../../desktopgui/src" destdir="./build/javadoc" 
456            packagenames="*" 
457            use="true" 
458            splitindex="true" 
459            windowtitle="Router Console" />
460    </target>
461
462    <!-- scala paths -->
463    <target name="scala.init">
464        <property name="scala-library.jar" value="${scalatest.libs}/scala-library.jar" />
465        <property name="scala-xml.jar" value="${scalatest.libs}/scala-xml.jar" />
466        <property name="scalactic.jar" value="${scalatest.libs}/scalactic.jar" />
467        <property name="scalatest.jar" value="${scalatest.libs}/scalatest.jar" />
468        <property name="mockito.home" value="${ant.home}/lib" />
469        <taskdef resource="scala/tools/ant/antlib.xml">
470            <classpath>
471                <pathelement location="${scalatest.libs}/scala-compiler.jar" />
472                <pathelement location="${scalatest.libs}/scala-reflect.jar" />
473                <pathelement location="${scala-library.jar}" />
474            </classpath>
475        </taskdef>
476    </target>
477
478    <!-- unit tests -->
479    <target name="builddepscalatest">
480        <ant dir="../../../router/java/" target="jar" />
481        <ant dir="../../../router/java/" target="jarScalaTest" />
482    </target>
483    <target name="scalatest.compileTest" depends="builddepscalatest, compile, scala.init">
484        <mkdir dir="./build" />
485        <mkdir dir="./build/obj_scala" />
486        <scalac srcdir="./test/scalatest" destdir="./build/obj_scala" deprecation="on" >
487            <classpath>
488                <pathelement location="${scala-library.jar}" />
489                <pathelement location="${scalactic.jar}" />
490                <pathelement location="${scalatest.jar}" />
491                <pathelement location="${mockito.home}/byte-buddy.jar" />
492                <pathelement location="${mockito.home}/objenesis.jar" />
493                <pathelement location="${mockito.home}/mockito-core.jar" />
494                <pathelement location="../../../core/java/build/i2pscalatest.jar" />
495                <pathelement location="../../../router/java/build/routerscalatest.jar" />
496                <pathelement location="./build/obj" />
497            </classpath>
498        </scalac>
499    </target>
500    <!-- preparation of code coverage tool of choice -->
501    <target name="prepareClover" depends="compile" if="with.clover">
502        <taskdef resource="clovertasks"/>
503        <mkdir dir="../../../reports/apps/routerconsole/clover" />
504        <clover-setup initString="../../../reports/apps/routerconsole/clover/coverage.db"/>
505    </target>
506    <target name="prepareCobertura" depends="compile" if="with.cobertura">
507        <taskdef classpath="${with.cobertura}" resource="tasks.properties" onerror="report" />
508        <mkdir dir="./build/obj_cobertura" />
509        <delete file="./cobertura.ser" />
510        <cobertura-instrument todir="./build/obj_cobertura">
511            <fileset dir="./build/obj">
512                <include name="**/*.class"/>
513                <exclude name="**/*Test.class" />
514            </fileset>
515        </cobertura-instrument>
516    </target>
517    <target name="prepareTest" depends="prepareClover, prepareCobertura" />
518    <!-- end preparation of code coverage tool -->
519    <target name="scalatest.test" depends="clean, scalatest.compileTest, prepareTest">
520        <mkdir dir="../../../reports/apps/routerconsole/scalatest/" />
521        <delete>
522            <fileset dir="../../../reports/apps/routerconsole/scalatest">
523                <include name="TEST-*.xml"/>
524            </fileset>
525        </delete>
526        <taskdef name="scalatest" classname="org.scalatest.tools.ScalaTestAntTask">
527            <classpath>
528                <pathelement location="${classpath}" />
529                <pathelement location="${scala-library.jar}" />
530                <pathelement location="${scala-xml.jar}" />
531                <pathelement location="${scalactic.jar}" />
532                <pathelement location="${scalatest.jar}" />
533                <pathelement location="./build/obj_cobertura" />
534                <pathelement location="./build/obj" />
535                <pathelement location="${with.clover}" />
536                <pathelement location="${with.cobertura}" />
537            </classpath>
538        </taskdef>
539        <scalatest runpath="./build/obj_scala" fork="yes" maxmemory="384M">
540            <tagsToExclude>
541                SlowTests
542            </tagsToExclude>
543            <reporter type="stdout" />
544            <reporter type="junitxml" directory="../../../reports/apps/routerconsole/scalatest/" />
545        </scalatest>
546        <!-- fetch the real hostname of this machine -->
547        <exec executable="hostname" outputproperty="host.name"/>
548        <!-- set if unset -->
549        <property name="host.fakename" value="i2ptester" />
550        <!-- replace hostname that junit inserts into reports with fake one -->
551        <replace dir="../../../reports/apps/routerconsole/scalatest/" token="${host.name}" value="${host.fakename}"/>
552    </target>
553    <target name="test" depends="scalatest.test"/>
554    <!-- test reports -->
555    <target name="scalatest.report">
556        <junitreport todir="../../../reports/apps/routerconsole/scalatest">
557            <fileset dir="../../../reports/apps/routerconsole/scalatest">
558                <include name="TEST-*.xml"/>
559            </fileset>
560            <report format="frames" todir="../../../reports/apps/routerconsole/html/scalatest"/>
561        </junitreport>
562    </target>
563    <target name="clover.report" depends="test" if="with.clover">
564        <clover-report>
565            <current outfile="../../../reports/apps/routerconsole/html/clover">
566                <format type="html"/>
567            </current>
568        </clover-report>
569    </target>
570    <target name="cobertura.report" depends="test" if="with.cobertura">
571        <mkdir dir="../../../reports/apps/routerconsole/cobertura" />
572        <cobertura-report format="xml" srcdir="./src" destdir="../../../reports/apps/routerconsole/cobertura" />
573        <mkdir dir="../../../reports/apps/routerconsole/html/cobertura" />
574        <cobertura-report format="html" srcdir="./src" destdir="../../../reports/apps/routerconsole/html/cobertura" />
575        <delete file="./cobertura.ser" />
576    </target>
577    <target name="test.report" depends="scalatest.report, clover.report, cobertura.report"/>
578    <!-- end test reports -->
579    <target name="fulltest" depends="cleandep, test, test.report" />
580    <!-- end unit tests -->
581
582    <target name="clean">
583        <delete dir="./build" />
584        <delete dir="../jsp/WEB-INF/" />
585        <delete file="../jsp/web-fragment.xml" />
586        <delete file="../jsp/web-out.xml" />
587    </target>
588    <target name="cleandep" depends="clean">
589    </target>
590    <target name="distclean" depends="clean">
591    </target>
592</project>
Note: See TracBrowser for help on using the repository browser.