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