source: apps/streaming/java/build.xml @ c5f04ee

Last change on this file since c5f04ee was c5f04ee, checked in by zzz <zzz@…>, 9 years ago
  • Don't do 'mtn list changed' if not in a workspace or not needed
  • Property mode set to 100644
File size: 4.3 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<project basedir="." default="all" name="streaming">
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    <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:./test" 
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            includeAntRuntime="false"
31            destdir="./build/obj" 
32            classpath="../../../core/java/build/i2p.jar:../../ministreaming/java/build/mstreaming.jar" >
33            <compilerarg line="${javac.compilerargs}" />
34        </javac>
35    </target>
36    <target name="compileTest" depends="compile">
37        <javac 
38            srcdir="./test" 
39            debug="true" deprecation="on" source="1.5" target="1.5" 
40            includeAntRuntime="false"
41            destdir="./build/obj" 
42            classpath="../../../core/java/build/i2p.jar:../../ministreaming/java/build/mstreaming.jar" >
43            <compilerarg line="${javac.compilerargs}" />
44        </javac>
45    </target>
46
47    <target name="listChangedFiles" depends="jarUpToDate" if="shouldListChanges" >
48        <exec executable="mtn" outputproperty="workspace.changes" errorproperty="mtn.error2" failifexecutionfails="false" >
49            <arg value="list" />
50            <arg value="changed" />
51            <arg value="." />
52        </exec>
53        <!-- \n in an attribute value generates an invalid manifest -->
54        <exec executable="tr" inputstring="${workspace.changes}" outputproperty="workspace.changes.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
55            <arg value="-s" />
56            <arg value="[:space:]" />
57            <arg value="," />
58        </exec>
59    </target>
60
61    <target name="jar" depends="builddep, compile, jarUpToDate, listChangedFiles" unless="jar.uptodate" >
62        <!-- set if unset -->
63        <property name="workspace.changes.tr" value="" />
64        <jar destfile="./build/streaming.jar" basedir="./build/obj" includes="**/*.class" >
65            <manifest>
66                <attribute name="Build-Date" value="${build.timestamp}" />
67                <attribute name="Base-Revision" value="${workspace.version}" />
68                <attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
69            </manifest>
70        </jar>
71    </target>
72
73    <target name="jarUpToDate">
74        <uptodate property="jar.uptodate" targetfile="build/streaming.jar" >
75            <srcfiles dir= "." includes="build/obj/**/*.class" />
76        </uptodate>
77        <condition property="shouldListChanges" >
78            <and>
79                <not>
80                    <isset property="jar.uptodate" />
81                </not>
82                <isset property="mtn.available" />
83            </and>
84        </condition>
85    </target>
86
87    <target name="jarTest" depends="jar, compileTest">
88        <jar destfile="./build/streaming.jar" basedir="./build/obj" includes="**/*Test*.class" update="true" />
89    </target>
90    <target name="javadoc">
91        <mkdir dir="./build" />
92        <mkdir dir="./build/javadoc" />
93        <javadoc 
94            sourcepath="./src:../../../core/java/src:../../ministreaming/java/src" destdir="./build/javadoc" 
95            packagenames="*" 
96            use="true" 
97            splitindex="true" 
98            windowtitle="Streaming" />
99    </target>
100    <target name="clean">
101        <delete dir="./build" />
102    </target>
103    <target name="cleandep" depends="clean">
104    </target>
105    <target name="distclean" depends="clean">
106    </target>
107</project>
Note: See TracBrowser for help on using the repository browser.