-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
378 lines (335 loc) · 17 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- $Id: build.xml,v 1.468 2013/01/05 10:18:50 agoubard Exp $ -->
<project name="xins" default="all" basedir=".">
<!-- import the extra build file that contains targets that does not
work in the release -->
<import file="build-dev.xml" optional="true" />
<!--
Determines the current XINS version by reading this information from
the version file.
By default the version file is '.version.properties'. This can be
overridden by setting the property 'version.file' to the file to read
from instead.
This target fails if the required properties are not set in the file.
-->
<target name="-load-version">
<property name="version.file" value=".version.properties" />
<property file="${version.file}" />
<condition property="version.isset">
<and>
<isset property="version.major" />
<isset property="version.middle" />
</and>
</condition>
<fail unless="version.isset">
Properties 'version.major' and 'version.middle'.
These are normally read from the version properties file.
Please do either of the following:
1) add the missing properties to the file;
2) specify what file to read from instead by setting the 'version.file'
property on the command line;
3) specify the missing properties manually, on the command line.
The current version properties file used is:
${version.file}</fail>
<condition property="dot.version.minor" value="${version.minor}">
<or>
<equals arg1="${version.minor}" arg2="-alpha" />
<equals arg1="${version.minor}" arg2="-beta" />
<equals arg1="${version.minor}" arg2="-rc" />
<equals arg1="${version.minor}" arg2="" />
</or>
</condition>
<property name="dot.version.minor" value=".${version.minor}" />
</target>
<target name="-init" depends="-load-version">
<!-- General project properties -->
<property name="title" value="XINS" />
<property name="name" value="${ant.project.name}" />
<property name="xins_version" value="${version.major}.${version.middle}${dot.version.minor}${version.build}${version.suffix}" />
<property name="package-basename" value="${name}-${xins_version}" />
<property name="xins_vendor" value="Online Breedband B.V." />
<property name="cvs.module" value="${name}" />
<!-- SourceForge-related properties -->
<property name="sf.group" value="71598" />
<property name="sf.package" value="71219" />
<!-- Website-related properties -->
<property name="www.user" value="${sf.user},${name}" />
<property name="www.host" value="web.sourceforge.net" />
<property name="www.dir" value="/home/groups/x/xi/xins/htdocs" />
<property name="www.target" value="${www.user}@${www.host}:${www.dir}" />
<property name="www.url" value="http://www.xins.org/" />
<!-- Java compiler-related properties -->
<property name="javac.targetvm" value="1.5" />
<property name="javac.debug" value="true" />
<property name="javac.deprecation" value="true" />
<property name="javac.includeantruntime" value="true" />
<property name="javac.optimize" value="false" />
<property name="tests.deprecation" value="false" />
<!-- Javadoc-related properties -->
<property name="javadoc.srcdir.j2se" value="${java.home}/src" />
<property name="javadoc.srcdir.xins" value="src/java-common:build/src/java-common:src/java-server-framework:build/src/java-server-framework:src/java-client-framework:build/src/java-client-framework" />
<!-- Unit- and performance-testing-related properties -->
<property name="testclass" value="org.xins.tests.AllTests" />
<property name="perftestclass" value="org.xins.perftests.AllTests" />
</target>
<target name="version" depends="-init">
<echo message="Java ${java.version}" />
<echo message="${ant.version}" />
<echo message="${title} ${xins_version}" />
</target>
<target name="clean" description="Removes all generated files">
<delete dir="build" />
<delete dir="docs/javadoc" />
<delete dir="docs/javadoc-private" />
<delete dir="docs/logdoc" />
<delete dir="docs/xsltdoc" />
<delete dir="src/tests/build" />
</target>
<target name="java-common" depends="logdoc-java-common" description="Compiles the XINS/Java common code">
<copy file="src/java-common/org/xins/common/ant/antlib.xml"
todir="build/classes/java-common/org/xins/common/ant" />
<copy file="src/java-common/org/xins/common/servlet/container/xins.gif"
todir="build/classes/java-common/org/xins/common/servlet/container" />
<antcall target="-build-framework">
<param name="src.side" value="common" />
<param name="side" value="common" />
<param name="type" value="Common" />
</antcall>
</target>
<target name="java-client" depends="java-common, logdoc-java-client" description="Compiles the XINS/Java client framework">
<antcall target="-build-framework" inheritRefs="true">
<param name="src.side" value="client-framework" />
<param name="side" value="client" />
<param name="type" value="Client Framework" />
</antcall>
</target>
<target name="java-server" depends="java-common, java-client, logdoc-java-server" description="Compiles the XINS/Java server framework">
<mkdir dir="build/src/java-server-framework" />
<xslt
in="src/xml/default_resultcodes.xml"
out="build/src/java-server-framework/org/xins/server/DefaultResultCodes.java"
style="src/xslt/java-server-framework/default_resultcodes_to_java.xslt" />
<antcall target="-build-framework" inheritRefs="true">
<param name="src.side" value="server-framework" />
<param name="side" value="server" />
<param name="type" value="Server Framework" />
</antcall>
</target>
<target name="java-tools" depends="java-common, java-client, java-server" description="Compiles the XINS/Java tools and put them in xins-common.jar">
<available property="spring.available" file="lib/spring.jar" />
<antcall target="download-spring" />
<available property="async-http-client.available" file="lib/async-http-client.jar" />
<antcall target="download-async-http-client" />
<javac
destdir="build/classes/java-common"
debug="${javac.debug}"
deprecation="${javac.deprecation}"
includeantruntime="${javac.includeantruntime}"
optimize="${javac.optimize}"
source="${javac.targetvm}"
target="${javac.targetvm}">
<src path="src/java-common" />
<classpath>
<pathelement location="build/xins-client.jar" />
<pathelement location="build/xins-server.jar" />
<fileset dir="lib" includes="*.jar" />
</classpath>
</javac>
<jar destfile="build/xins-common.jar" update="true">
<fileset dir="build/classes/java-common">
<include name="org/xins/common/spring/**" />
</fileset>
</jar>
</target>
<target name="download-spring" unless="spring.available">
<get src="http://repo1.maven.org/maven2/org/springframework/spring/2.0.6/spring-2.0.6.jar" dest="lib/spring.jar" />
</target>
<target name="download-async-http-client" unless="async-http-client.available">
<get src="http://repo1.maven.org/maven2/com/ning/async-http-client/1.7.9/async-http-client-1.7.9.jar" dest="lib/async-http-client.jar" />
</target>
<target name="-build-framework">
<mkdir dir="build/classes/java-${side}" />
<javac
destdir="build/classes/java-${side}"
debug="${javac.debug}"
deprecation="${javac.deprecation}"
includeantruntime="${javac.includeantruntime}"
optimize="${javac.optimize}"
source="${javac.targetvm}"
target="${javac.targetvm}">
<src path="src/java-${src.side}" />
<src path="build/src/java-${src.side}" />
<exclude name="org/xins/common/spring/**" />
<classpath>
<fileset dir="lib" includes="*.jar" />
<fileset dir="build" includes="*.jar" />
</classpath>
</javac>
<manifest file="build/MANIFEST.MF">
<section name="org/xins/${side}/">
<attribute name="Specification-Title" value="XINS/Java ${type}" />
<attribute name="Specification-Version" value="${xins_version}" />
<attribute name="Specification-Vendor" value="${xins_vendor}" />
<attribute name="Implementation-Title" value="XINS/Java ${type}" />
<attribute name="Implementation-Version" value="${xins_version}" />
<attribute name="Implementation-Vendor" value="${xins_vendor}" />
</section>
</manifest>
<jar
destfile="build/xins-${side}.jar"
basedir="build/classes/java-${side}"
manifest="build/MANIFEST.MF" />
</target>
<target name="java" depends="java-common,java-client,java-server,java-tools" description="Compiles the XINS/Java java code (logdoc, common, server and client)"/>
<target name="-prepare-logdoc" depends="-init">
<taskdef resource="org/znerd/logdoc/ant/antlib.xml" classpath="lib/logdoc.jar;lib/znerd-util.jar" />
</target>
<target name="logdoc-html" depends="-init">
<antcall target="-logdoc-html">
<param name="side" value="server"/>
</antcall>
<antcall target="-logdoc-html">
<param name="side" value="client"/>
</antcall>
<antcall target="-logdoc-html">
<param name="side" value="common"/>
</antcall>
</target>
<target name="-logdoc-html" depends="-prepare-logdoc">
<copy file="src/css/logdoc/style.css" todir="build/logdoc/${side}/html" />
<logdoc-doc in="src/logdoc/${side}" out="build/logdoc/${side}/html" />
<copy todir="docs/logdoc/${side}">
<fileset dir="build/logdoc/${side}/html" />
</copy>
</target>
<target name="logdoc-java-server" depends="-prepare-logdoc">
<logdoc-code in="src/logdoc/server" out="build/src/java-server-framework" />
</target>
<target name="logdoc-java-client" depends="-prepare-logdoc">
<logdoc-code in="src/logdoc/client" out="build/src/java-client-framework" />
</target>
<target name="logdoc-java-common" depends="-prepare-logdoc">
<logdoc-code in="src/logdoc/common" out="build/src/java-common" />
</target>
<target name="-jdksrc-avail">
<available
file="${javadoc.srcdir.j2se}"
type="dir"
property="jdksrc.available" />
</target>
<target
name="-javadoc-sourcepath-nojdksrc"
depends="-init,-jdksrc-avail"
unless="jdksrc.available">
<property name="javadoc.sourcepath" value="${javadoc.srcdir.xins}" />
<echo level="verbose" message="JDK source code not available." />
</target>
<target
name="-javadoc-sourcepath-jdksrc"
depends="-jdksrc-avail"
if="jdksrc.available">
<property name="javadoc.sourcepath" value="${javadoc.srcdir.xins}:${javadoc.srcdir.j2se}" />
<echo level="verbose" message="JDK source code available." />
</target>
<target
name="-javadoc-sourcepath"
depends="-javadoc-sourcepath-nojdksrc,-javadoc-sourcepath-jdksrc" />
<target
name="-do-javadoc"
depends="java,-javadoc-sourcepath"
unless="nodocs">
<mkdir dir="${javadoc.destdir}" />
<javadoc
sourcepath="${javadoc.sourcepath}"
destdir="${javadoc.destdir}"
source="1.5"
version="yes"
use="yes"
author="yes"
private="${javadoc.private}"
windowtitle="${javadoc.title}"
doctitle="${javadoc.title}"
bottom="${javadoc.footer}">
<packageset dir="src/java-common" includes="org/xins/**" />
<packageset dir="src/java-server-framework" includes="org/xins/**" />
<packageset dir="src/java-client-framework" includes="org/xins/**" />
<group title="XINS/Java Common Library" packages="org.xins.common*" />
<group title="XINS/Java Client Framework" packages="org.xins.client*" />
<group title="XINS/Java Server Framework" packages="org.xins.server*" />
<classpath>
<fileset dir="lib" includes="*.jar" />
<fileset dir="${ant.home}/lib" includes="*.jar" />
</classpath>
<link offline="true" packagelistloc="src/package-lists/servlet/" href="http://tomcat.apache.org/tomcat-5.5-doc/servletapi/" />
<link offline="true" packagelistloc="src/package-lists/j2se/" href="http://download.oracle.com/javase/6/docs/api/" />
<link offline="true" packagelistloc="src/package-lists/log4j/" href="http://jakarta.apache.org/log4j/docs/api/" />
<link offline="true" packagelistloc="src/package-lists/commons-logging/" href="http://jakarta.apache.org/commons/logging/api/" />
<link offline="true" packagelistloc="src/package-lists/httpclient/" href="http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/" />
<link offline="true" packagelistloc="src/package-lists/httpcore/" href="http://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/" />
<link offline="true" packagelistloc="src/package-lists/xmlenc/" href="http://xmlenc.sourceforge.net/javadoc/0.52/" />
<link offline="true" packagelistloc="src/package-lists/ant/" href="http://xmlenc.sourceforge.net/ant-1.6.2-docs/" />
<link offline="true" packagelistloc="src/package-lists/json/" href="http://www.json.org/javadoc/" />
</javadoc>
</target>
<target
name="javadoc"
depends="javadoc-public,javadoc-private"
description="Generates all Javadoc API documentation"
unless="nodocs" />
<target
name="javadoc-public"
depends="-init"
description="Generates public Javadoc API documentation"
unless="nodocs">
<antcall target="-do-javadoc">
<param name="javadoc.private" value="no" />
<param name="javadoc.destdir" value="docs/javadoc" />
<param name="javadoc.title" value="${title} ${xins_version}" />
<param name="javadoc.footer" value="See <a target="_top" href='${www.url}'>${www.url}</a>." />
</antcall>
</target>
<target
name="javadoc-private"
depends="-init"
description="Generates private Javadoc API documentation"
unless="nodocs">
<antcall target="-do-javadoc">
<param name="javadoc.private" value="yes" />
<param name="javadoc.destdir" value="docs/javadoc-private" />
<param name="javadoc.title" value="${title} ${xins_version}" />
<param name="javadoc.footer" value="See <a target="_top" href='${www.url}'>${www.url}</a>.<br />This Javadoc API documentation set contains private and package private members as well." />
</antcall>
</target>
<target name="all" depends="java-server,javadoc" description="Generates everything" />
<target name="help" description="Print the help of the main targets" depends="-init">
<echo message="XINS ${xins_version}" />
<echo message="" />
<echo message="Main targets:" />
<echo message=" clean : Remove all generated files" />
<echo message=" java : Compile all Java source files" />
<echo message=" javadoc : Generate the Javadoc API docs" />
<echo message=" logdoc-html : Generate the Logdoc HTML pages" />
<echo message=" version : Print the XINS version" />
<echo message="* tests : Run all unit tests" />
<echo message="* release : Create a new XINS release" />
<echo />
<echo message="The targets marked with an asterisk (*) need '-lib lib' to be" />
<echo message="passed on the command line:" />
<echo />
<echo message="Supported options (can change at any time):" />
<echo message="1) -Dforce=true : Skip -dev suffix check on release" />
<echo message="2) -Dmajor.release=true : Skip version update on release" />
<echo message="3) -Dno-upload=true : Skip uploads except FTP uploads" />
<echo message="4) -Dno-ftp=true : Skip FTP upload actions" />
<echo />
<echo message="To create a release the following requirements apply:" />
<echo message="1) CVS module 'xins-docs' must be checked out in parent directory" />
<echo message=" and should be up-to-date;" />
<echo message="2) CVS module 'xins-examples' must be checked out in parent" />
<echo message=" directory and should be up-to-date;" />
<echo message="3) File .sourceforge.properties must exist in home directory and" />
<echo message=" must contain valid sf.user and sf.password properties." />
<echo message="4) The DOCBOOK_XSLT_HOME environment variable must be set and" />
<echo message=" refer to the directory containing the Docbook XSLT files." />
</target>
</project>