source: apps/ministreaming/java/build.xml @ e8712a3

Last change on this file since e8712a3 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: 3.6 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<project basedir="." default="all" name="ministreaming">
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" 
15            destdir="./build/obj" >
16            <!-- Depend on classes instead of jars where available -->
17            <classpath>
18                <pathelement location="../../../core/java/build/obj" />
19            </classpath>
20        </depend>
21    </target>
22    <property name="javac.compilerargs" value="" />
23    <target name="compile" depends="depend">
24        <mkdir dir="./build" />
25        <mkdir dir="./build/obj" />
26        <!-- half of this is deprecated classes so turn deprecation off -->
27        <javac srcdir="./src" debug="true" deprecation="off" source="1.5" target="1.5"
28               includeAntRuntime="false"
29               destdir="./build/obj" classpath="../../../core/java/build/i2p.jar" >
30            <compilerarg line="${javac.compilerargs}" />
31        </javac>
32    </target>
33
34    <target name="listChangedFiles" depends="jarUpToDate" if="shouldListChanges" >
35        <exec executable="mtn" outputproperty="workspace.changes" errorproperty="mtn.error2" failifexecutionfails="false" >
36            <arg value="list" />
37            <arg value="changed" />
38            <arg value="." />
39        </exec>
40        <!-- \n in an attribute value generates an invalid manifest -->
41        <exec executable="tr" inputstring="${workspace.changes}" outputproperty="workspace.changes.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
42            <arg value="-s" />
43            <arg value="[:space:]" />
44            <arg value="," />
45        </exec>
46    </target>
47
48    <target name="jar" depends="compile, jarUpToDate, listChangedFiles" unless="jar.uptodate" >
49        <!-- set if unset -->
50        <property name="workspace.changes.tr" value="" />
51        <jar destfile="./build/mstreaming.jar" basedir="./build/obj" includes="**/*.class" >
52            <manifest>
53                <attribute name="Build-Date" value="${build.timestamp}" />
54                <attribute name="Base-Revision" value="${workspace.version}" />
55                <attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
56            </manifest>
57        </jar>
58    </target>
59
60    <target name="jarUpToDate">
61        <uptodate property="jar.uptodate" targetfile="build/mstreaming.jar" >
62            <srcfiles dir= "." includes="build/obj/**/*.class" />
63        </uptodate>
64        <condition property="shouldListChanges" >
65            <and>
66                <not>
67                    <isset property="jar.uptodate" />
68                </not>
69                <isset property="mtn.available" />
70            </and>
71        </condition>
72    </target>
73
74    <target name="javadoc">
75        <mkdir dir="./build" />
76        <mkdir dir="./build/javadoc" />
77        <javadoc 
78            sourcepath="./src:../../../core/java/src:../../../core/java/test" destdir="./build/javadoc" 
79            packagenames="*" 
80            use="true" 
81            splitindex="true" 
82            windowtitle="I2P ministreaming library" />
83    </target>
84    <target name="clean">
85        <delete dir="./build" />
86    </target>
87    <target name="cleandep" depends="clean">
88    </target>
89    <target name="distclean" depends="clean">
90    </target>
91</project>
Note: See TracBrowser for help on using the repository browser.