source: installer/java/build.xml @ 08d1ea8

Last change on this file since 08d1ea8 was 08d1ea8, checked in by zzz <zzz@…>, 4 years ago

Build: Set Java 7 build target for all jars;
embedders (esp. Android) targetting 1.6 must
set javac.version=1.6 in override.properties and set
both bootclasspath variables.

  • Property mode set to 100644
File size: 3.0 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<project basedir="." default="all" name="utility_jars">
3    <target name="all" depends="clean, build" />
4    <target name="build" depends="builddep, jar" />
5    <target name="builddep">
6        <!-- noop, since the core doesnt depend on anything -->
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>
17    </target>
18
19    <!-- only used if not set by a higher build.xml -->
20    <property name="javac.compilerargs" value="" />
21    <property name="javac.classpath" value="" />
22    <property name="javac.version" value="1.7" />
23
24    <target name="compile" depends="depend">
25        <mkdir dir="./build" />
26        <mkdir dir="./build/obj" />
27        <javac srcdir="./src" debug="true" source="${javac.version}" target="${javac.version}" deprecation="on"
28            includeAntRuntime="false"
29            destdir="./build/obj" classpath="${javac.classpath}:../../core/java/build/obj" >
30            <compilerarg line="${javac.compilerargs}" />
31        </javac>
32    </target>
33
34    <target name="listChangedFiles" if="mtn.available" >
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, listChangedFiles">
49        <!-- set if unset -->
50        <property name="workspace.changes.util.tr" value="" />
51        <jar destfile="../../build/utility.jar">
52            <fileset dir="../../core/java/build/obj" includes="**/FileUtil.class"/>
53            <fileset dir="./build/obj" includes="**" />
54            <manifest>
55                <attribute name="Main-Class" value="net.i2p.installer.Main" />
56                <attribute name="Built-By" value="${build.built-by}" />
57                <attribute name="Build-Date" value="${build.timestamp}" />
58                <attribute name="Base-Revision" value="${workspace.version}" />
59                <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
60            </manifest>
61        </jar>
62    </target>
63
64    <target name="clean">
65        <delete dir="./build" />
66    </target>
67    <target name="cleandep" depends="clean">
68        <!-- noop, since the core doesn't depend on anything -->
69    </target>
70    <target name="distclean" depends="clean">
71        <!-- noop, since the core doesn't depend on anything -->
72    </target>
73</project>
74<!--
75vim:fenc=utf-8:ai:si:ts=4:sw=4:et:nu:fdm=indent:fdn=1:
76-->
Note: See TracBrowser for help on using the repository browser.