source: apps/i2pcontrol/build.xml @ 19defbe

Last change on this file since 19defbe was 19defbe, checked in by zzz <zzz@…>, 2 years ago

Debian: Fix build of i2pcontrol

  • Property mode set to 100644
File size: 6.1 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<project basedir="." default="all" name="source">
3    <property name="i2pbase" value="../.."/>
4    <property name="i2plib" value="${i2pbase}/build"/>
5    <property name="jettylib" value="${i2pbase}/apps/jetty/jettylib"/>
6    <property name="wrapperlib" value="${i2pbase}/installer/lib/wrapper/all"/>
7
8    <!--
9         Supports four build options:
10         1) war (jsonrpc.war) for running under the console
11         2) jar (i2pcontrol.jar) for starting and running on its own Jetty instance,
12            no console dependency
13         3) socketJar (i2pcontrol.jar) for running on a ServerSocket (JSON splitting),
14            no Jetty dependency (Work in progress)
15         4) TODO xxxjar with bundled, small non-Jetty server, similar to I2PTunnelHTTPClient?
16     -->
17
18    <path id="cp">
19        <pathelement location="${i2plib}/i2p.jar" />
20        <pathelement location="${i2plib}/router.jar" />
21        <pathelement location="${jettylib}/org.mortbay.jetty.jar" />
22        <pathelement location="${jettylib}/javax.servlet.jar" />
23        <pathelement location="${jettylib}/jetty-servlet.jar" />
24        <pathelement location="${wrapperlib}/wrapper.jar" />
25        <!-- following jar only present for debian builds -->
26        <pathelement location="../../core/java/build/json-simple.jar" />
27    </path>
28
29    <path id="cpSocket">
30        <pathelement location="${i2plib}/i2p.jar" />
31        <pathelement location="${i2plib}/router.jar" />
32        <!-- TODO get rid of wraper dependency also -->
33        <pathelement location="${wrapperlib}/wrapper.jar" />
34        <!-- following jar only present for debian builds -->
35        <pathelement location="../../core/java/build/json-simple.jar" />
36    </path>
37
38    <target name="all" depends="clean, build" />
39    <target name="build" depends="jar" />
40    <condition property="depend.available">
41        <typefound name="depend" />
42    </condition>
43    <target name="builddep" if="depend.available">
44        <depend
45            cache="${i2pbase}/build"
46            srcdir="./java" 
47            classpath="${cp}"
48            destdir="./build/obj" >
49        </depend>
50    </target>
51
52    <property name="javac.compilerargs" value="" />
53    <property name="javac.version" value="1.7" />
54
55    <target name="compile" depends="builddep" >
56        <mkdir dir="./build" />
57        <mkdir dir="./build/obj" />
58        <javac 
59            srcdir="./java" 
60            debug="true" deprecation="on" source="${javac.version}" target="${javac.version}" 
61            includeAntRuntime="false"
62            destdir="./build/obj" 
63            classpath="${cp}">
64            <compilerarg line="${javac.compilerargs}" />
65            <classpath refid="cp"/>
66        </javac>
67    </target>
68
69    <!--
70      More TODO here. jsonrpc2 lib uses MessageContext which depends on servlet
71     -->
72    <target name="compileSocketJar" depends="builddep" >
73        <mkdir dir="./build" />
74        <mkdir dir="./build/obj" />
75        <javac 
76            sourcepath=""
77            srcdir="./java" 
78            debug="true" deprecation="on" source="${javac.version}" target="${javac.version}" 
79            includeAntRuntime="false"
80            destdir="./build/obj" 
81            classpath="${cpSocket}">
82            <compilerarg line="${javac.compilerargs}" />
83            <classpath refid="cpSocket" />
84            <exclude name="**/I2PControlController.java" />
85            <exclude name="**/HostCheckHandler.java" />
86            <exclude name="**/JSONRPC2Servlet.java" />
87        </javac>
88    </target>
89
90    <target name="jar" depends="compile">
91        <jar destfile="build/i2pcontrol.jar" basedir="./build/obj" includes="**/*.class" >
92            <manifest>
93                <attribute name="Implementation-Version" value="${full.version}" />
94                <attribute name="Built-By" value="${build.built-by}" />
95                <attribute name="Build-Date" value="${build.timestamp}" />
96                <attribute name="Base-Revision" value="${workspace.version}" />
97                <attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
98                <attribute name="X-Compile-Source-JDK" value="${javac.version}" />
99                <attribute name="X-Compile-Target-JDK" value="${javac.version}" />
100            </manifest>
101        </jar>
102    </target>   
103
104    <target name="socketJar" depends="compileSocketJar">
105        <jar destfile="build/i2pcontrol.jar" basedir="./build/obj" includes="**/*.class" >
106            <manifest>
107                <attribute name="Implementation-Version" value="${full.version}" />
108                <attribute name="Built-By" value="${build.built-by}" />
109                <attribute name="Build-Date" value="${build.timestamp}" />
110                <attribute name="Base-Revision" value="${workspace.version}" />
111                <attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
112                <attribute name="X-Compile-Source-JDK" value="${javac.version}" />
113                <attribute name="X-Compile-Target-JDK" value="${javac.version}" />
114            </manifest>
115        </jar>
116    </target>   
117
118    <target name="war" depends="compile" >
119        <war destfile="build/jsonrpc.war" webxml="web.xml" >
120            <classes dir="./build/obj" excludes="net/i2p/i2pcontrol/I2PControlController.class net/i2p/i2pcontrol/HostCheckHandler.class net/i2p/i2pcontrol/SocketController*.class" />
121            <manifest>
122                <attribute name="Implementation-Version" value="${full.version}" />
123                <attribute name="Built-By" value="${build.built-by}" />
124                <attribute name="Build-Date" value="${build.timestamp}" />
125                <attribute name="Base-Revision" value="${workspace.version}" />
126                <attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
127                <attribute name="X-Compile-Source-JDK" value="${javac.version}" />
128                <attribute name="X-Compile-Target-JDK" value="${javac.version}" />
129            </manifest>
130        </war>
131    </target>
132
133    <target name="clean">
134        <delete dir="./build" />
135    </target>
136
137    <target name="cleandep" depends="clean">
138    </target>
139
140    <target name="distclean" depends="clean">
141    </target>
142</project>
Note: See TracBrowser for help on using the repository browser.