source: apps/sam/java/build.xml @ fd91927c

Last change on this file since fd91927c was fd91927c, checked in by zzz <zzz@…>, 9 years ago
  • Build:
    • Add includeAntRuntime=false to all javac targets
    • Add build date, mtn rev, and changed file list to all manifests
    • Add unless=uptodate to all jar and war targets (bob and dtg still todo)
  • Property mode set to 100644
File size: 4.1 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<project basedir="." default="all" name="sam">
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                <pathelement location="../../ministreaming/java/build/obj" />
20                <pathelement location="../../streaming/java/build/obj" />
21            </classpath>
22        </depend>
23    </target>
24    <property name="javac.compilerargs" value="" />
25    <target name="compile" depends="depend">
26        <mkdir dir="./build" />
27        <mkdir dir="./build/obj" />
28        <javac 
29            srcdir="./src" 
30            debug="true" deprecation="on" source="1.5" target="1.5" 
31            includeAntRuntime="false"
32            destdir="./build/obj" 
33            classpath="../../../core/java/build/i2p.jar:../../ministreaming/java/build/mstreaming.jar:../../streaming/java/build/streaming.jar" >
34            <compilerarg line="${javac.compilerargs}" />
35        </javac>
36    </target>
37    <target name="compileTest" depends="compile">
38        <javac 
39            srcdir="./test" 
40            debug="true" deprecation="on" source="1.5" target="1.5" 
41            includeAntRuntime="false"
42            destdir="./build/obj" 
43            classpath="../../../core/java/build/i2p.jar:../../ministreaming/java/build/mstreaming.jar:../../streaming/java/build/streaming.jar" >
44            <compilerarg line="${javac.compilerargs}" />
45        </javac>
46    </target>
47
48    <target name="jar" depends="compile, jarUpToDate" unless="jar.uptodate" >
49        <exec executable="mtn" outputproperty="workspace.changes" errorproperty="mtn.error2" failifexecutionfails="false" >
50            <arg value="list" />
51            <arg value="changed" />
52            <arg value="." />
53        </exec>
54        <!-- \n in an attribute value generates an invalid manifest -->
55        <exec executable="tr" inputstring="${workspace.changes}" outputproperty="workspace.changes.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
56            <arg value="-s" />
57            <arg value="[:space:]" />
58            <arg value="," />
59        </exec>
60        <jar destfile="./build/sam.jar" basedir="./build/obj" includes="**/*.class">
61            <manifest>
62                <attribute name="Main-Class" value="net.i2p.sam.SAMBridge" />
63                <attribute name="Class-Path" value="i2p.jar mstreaming.jar streaming.jar" />
64                <attribute name="Build-Date" value="${build.timestamp}" />
65                <attribute name="Base-Revision" value="${workspace.version}" />
66                <attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
67            </manifest>
68        </jar>
69    </target>
70
71    <target name="jarUpToDate">
72        <uptodate property="jar.uptodate" targetfile="build/sam.jar" >
73            <srcfiles dir= "build/obj" includes="**/*.class" />
74        </uptodate>
75    </target>
76
77    <target name="jarTest" depends="jar, compileTest">
78        <jar destfile="./build/sam.jar" basedir="./build/obj" includes="**/*Test*.class" update="true" />
79    </target>
80    <target name="javadoc">
81        <mkdir dir="./build" />
82        <mkdir dir="./build/javadoc" />
83        <javadoc 
84            sourcepath="./src:../../../core/java/src:../../ministreaming/java/src:../../streaming/java/src" destdir="./build/javadoc" 
85            packagenames="*" 
86            use="true" 
87            splitindex="true" 
88            windowtitle="SAMBridge" />
89    </target>
90    <target name="clean">
91        <delete dir="./build" />
92    </target>
93    <target name="cleandep" depends="clean">
94    </target>
95    <target name="distclean" depends="clean">
96    </target>
97</project>
Note: See TracBrowser for help on using the repository browser.