source: apps/ministreaming/java/build.xml @ 07caf2e

Last change on this file since 07caf2e was cadedeb0, checked in by zzz <zzz@…>, 9 years ago
  • Build: Add built-by to jars; check for corrupt jars on debug page
  • Property mode set to 100644
File size: 3.7 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="Implementation-Version" value="${full.version}" />
54                <attribute name="Built-By" value="${build.built-by}" />
55                <attribute name="Build-Date" value="${build.timestamp}" />
56                <attribute name="Base-Revision" value="${workspace.version}" />
57                <attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
58            </manifest>
59        </jar>
60    </target>
61
62    <target name="jarUpToDate">
63        <uptodate property="jar.uptodate" targetfile="build/mstreaming.jar" >
64            <srcfiles dir= "." includes="build/obj/**/*.class" />
65        </uptodate>
66        <condition property="shouldListChanges" >
67            <and>
68                <not>
69                    <isset property="jar.uptodate" />
70                </not>
71                <isset property="mtn.available" />
72            </and>
73        </condition>
74    </target>
75
76    <target name="javadoc">
77        <mkdir dir="./build" />
78        <mkdir dir="./build/javadoc" />
79        <javadoc 
80            sourcepath="./src:../../../core/java/src:../../../core/java/test" destdir="./build/javadoc" 
81            packagenames="*" 
82            use="true" 
83            splitindex="true" 
84            windowtitle="I2P ministreaming library" />
85    </target>
86    <target name="clean">
87        <delete dir="./build" />
88    </target>
89    <target name="cleandep" depends="clean">
90    </target>
91    <target name="distclean" depends="clean">
92    </target>
93</project>
Note: See TracBrowser for help on using the repository browser.