-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.xml
592 lines (477 loc) · 21 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
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
<!--
This is an ant build file compatible with ant version 1.3.
All generated files are created under ${build} directory
-->
<project name="XmlPull_V1" default="compile" basedir=".">
<!-- set global properties for this build -->
<property name="name" value="XmlPull"/>
<property name="year" value="2005"/>
<property name="version" value="1_1_3_4b"/>
<property name="xmlpull_version" value="xmlpull_${version}"/>
<property name="xmlpull_tag" value="XMLPULL_${version}"/>
<property name="copyright"
value="This XmlPull V1 API is free, enjoy! <a href='http://www.xmlpull.org/'>http://www.xmlpull.org/</a>" />
<property name="debug" value="on"/>
<property name="deprecation" value="off"/>
<property name="doc" value="doc"/>
<property name="src" value="src/java"/>
<property name="src_api" value="${src}/api"/>
<property name="src_tests" value="${src}/tests"/>
<property name="src_tests_xml" value="src/xml/tests"/>
<property name="src_samples" value="${src}/samples"/>
<property name="build" value="build"/>
<property name="build_dist" value="${build}/dist"/>
<property name="build_lib" value="${build}/lib"/>
<property name="build_classes" value="${build}/classes"/>
<property name="build_tests" value="${build}/tests"/>
<property name="build_tests_xml" value="${build_tests}/org/xmlpull/v1/tests/xml"/>
<property name="build_samples" value="${build}/samples"/>
<property name="build_apidoc" value="${doc}/api"/>
<property name="build_javadoc" value="${doc}/api_impl"/>
<property name="apidoc_packages" value="org.xmlpull.v1.*"/>
<property name="api_sourcepath" value="${src_api}"/>
<property name="javadoc_packages" value="org.xmlpull.v1.*"/>
<property name="dist" value="${build}/dist/${xmlpull_version}"/>
<property name="lite_suffix" value="src"/>
<property name="full_suffix" value="all"/>
<property name="dist_lite" value="${build}/dist/${xmlpull_version}_${lite_suffix}"/>
<property name="dist_full" value="${build}/dist/${xmlpull_version}_${full_suffix}"/>
<property name="dist_lite_zip" value="${dist_lite}.zip"/>
<property name="dist_full_zip" value="${dist_full}.zip"/>
<property name="dist_lite_tar" value="${dist_lite}.tar"/>
<property name="dist_full_tar" value="${dist_full}.tar"/>
<property name="dist_lite_tgz" value="${dist_lite}.tgz"/>
<property name="dist_full_tgz" value="${dist_full}.tgz"/>
<property name="jar" value="${build_lib}/${xmlpull_version}.jar"/>
<property name="tests_jar" value="${build_lib}/xmlpull-tests_${version}.jar"/>
<!-- ======================================== -->
<!-- ADDONS -->
<property name="build_addons" value="${build}/addons"/>
<property name="build_addons_tests" value="${build_addons}/tests"/>
<property name="src_addons" value="addons/java"/>
<property name="build_dom2_builder" value="${build_addons}/dom2_builder"/>
<property name="src_dom2_builder" value="${src_addons}/dom2_builder/src"/>
<property name="jar_dom2_builder" value="${build_lib}/${xmlpull_version}-dom2_builder.jar"/>
<property name="build_sax2" value="${build_addons}/sax2_driver"/>
<property name="lib_sax2" value="${src_addons}/sax2_driver/lib"/>
<property name="jar_sax2" value="${build_lib}/${xmlpull_version}-sax2.jar"/>
<property name="src_sax2" value="${src_addons}/sax2_driver/src"/>
<property name="build_parser_pool" value="${build_addons}/parser_pool"/>
<property name="src_parser_pool" value="${src_addons}/parser_pool/src"/>
<property name="jar_parser_pool" value="${build_lib}/${xmlpull_version}-parser_pool.jar"/>
<property name="build_util" value="${build_addons}/util"/>
<property name="src_util" value="${src_addons}/util/src"/>
<property name="jar_util" value="${build_lib}/${xmlpull_version}-util.jar"/>
<property name="build_wrapper" value="${build_addons}/wrapper"/>
<property name="src_wrapper" value="${src_addons}/wrapper/src"/>
<property name="src_wrapper_tests" value="${src_addons}/wrapper/tests"/>
<property name="jar_wrapper" value="${build_lib}/${xmlpull_version}-wrapper.jar"/>
<property name="build_xmlrpc" value="${build_addons}/xmlrpc"/>
<property name="src_xmlrpc" value="${src_addons}/xmlrpc/src"/>
<property name="jar_xmlrpc" value="${build_lib}/${xmlpull_version}-xmlrpc.jar"/>
<property name="website" value="../xmlpull-website/v1"/>
<patternset id="all_source_files">
<exclude name="**/*-"/>
<exclude name="**/*~"/>
<exclude name="**/*.mcp"/>
<exclude name="**/*_Data/**"/>
</patternset>
<!-- =================================================================== -->
<!-- Preparing build environment -->
<!-- =================================================================== -->
<target name="clean">
<delete dir="${build_addons}"/>
<delete dir="${build_classes}"/>
<delete dir="${build_lib}"/>
<delete dir="${build_tests}"/>
<delete dir="${build_samples}"/>
<delete file="${dist_zip}"/>
<delete file="${dist_tgz}"/>
</target>
<target name="prepare">
<mkdir dir="${build}"/>
<mkdir dir="${build_dist}"/>
<mkdir dir="${build_lib}"/>
<mkdir dir="${build_tests}"/>
<mkdir dir="${build_classes}"/>
<touch file="${build_classes}/${xmlpull_tag}_VERSION"/>
<touch file="${build_tests}/${xmlpull_tag}_VERSION_TESTS"/>
<available property="junit_present" classname="junit.framework.TestCase" />
<uptodate property="build_notRequired" targetfile="${jar}">
<srcfiles dir="${src_api}" includes="**/*.java"/>
</uptodate>
<uptodate property="build_tests_jar_notRequired" targetfile="${tests_jar}">
<srcfiles dir="${src_tests}" includes="**/*.java"/>
</uptodate>
</target>
<target name="check_junit" unless="junit_present" depends="prepare">
<echo message="Warning: JUnit dependencies were not resolved."/>
</target>
<target name="require_junit" unless="junit_present" depends="prepare">
<fail message="ERROR: JUnit library must be present to compile this target (see http://www.junit.org)."/>
</target>
<target name="dependencies" depends="prepare,check_junit"/>
<!-- =================================================================== -->
<!-- Compilation tasks -->
<!-- =================================================================== -->
<target name="api" depends="prepare">
<javac debug="${debug}" deprecation="${deprecation}" target="1.1"
srcdir="${src_api}" destdir="${build_classes}" classpath="${build_classes}"/>
</target>
<target name="jar" unless="build_notRequired" depends="api">
<mkdir dir="${build_lib}"/>
<jar jarfile="${jar}">
<fileset dir="${build_classes}"/>
</jar>
</target>
<target name="xmlpull" depends="jar"/>
<target name="samples" depends="xmlpull">
<mkdir dir="${build_samples}"/>
<javac debug="${debug}" deprecation="${deprecation}" target="1.1"
srcdir="${src_samples}" destdir="${build_samples}"
classpath="${build_classes}"/>
</target>
<target name="compile" depends="xmlpull,tests,samples"/>
<target name="all" depends="clean,compile"/>
<!-- =================================================================== -->
<!-- ADDONS -->
<!-- =================================================================== -->
<target name="dom2_builder" depends="api">
<mkdir dir="${build_dom2_builder}"/>
<javac debug="${debug}" deprecation="${deprecation}" target="1.1"
srcdir="${src_dom2_builder}" destdir="${build_dom2_builder}"
classpath="${build_classes}"/>
<jar jarfile="${jar_dom2_builder}">
<fileset dir="${build_dom2_builder}"/>
</jar>
</target>
<target name="parser_pool" depends="api">
<mkdir dir="${build_parser_pool}"/>
<javac debug="${debug}" deprecation="${deprecation}" target="1.1"
srcdir="${src_parser_pool}" destdir="${build_parser_pool}"
classpath="${build_classes}"/>
<jar jarfile="${jar_parser_pool}">
<fileset dir="${build_parser_pool}"/>
</jar>
</target>
<target name="sax2" depends="api">
<mkdir dir="${build_sax2}"/>
<javac debug="${debug}" deprecation="${deprecation}" target="1.1"
srcdir="${src_sax2}" destdir="${build_sax2}">
<classpath>
<pathelement location="${build_classes}" />
<fileset dir="${lib_sax2}">
<include name="*.jar"/>
</fileset>
</classpath>
</javac>
<jar jarfile="${jar_sax2}">
<fileset dir="${build_sax2}"/>
</jar>
</target>
<target name="util" depends="api">
<mkdir dir="${build_util}"/>
<javac debug="${debug}" deprecation="${deprecation}" target="1.1"
srcdir="${src_util}" destdir="${build_util}" classpath="${build_classes}"/>
<jar jarfile="${jar_util}">
<fileset dir="${build_util}"/>
</jar>
</target>
<target name="wrapper" depends="require_junit,util">
<mkdir dir="${build_wrapper}"/>
<javac debug="${debug}" deprecation="${deprecation}" target="1.1"
srcdir="${src_wrapper}" destdir="${build_wrapper}" classpath="${build_classes}:${build_util}"/>
<jar jarfile="${jar_wrapper}">
<fileset dir="${build_wrapper}"/>
</jar>
</target>
<target name="wrapper_tests" depends="require_junit,wrapper">
<mkdir dir="${build_addons_tests}"/>
<javac debug="${debug}" deprecation="${deprecation}" target="1.1"
srcdir="${src_wrapper_tests}" destdir="${build_wrapper}"
classpath="${build_classes}:${build_util}:${build_wrapper}"/>
</target>
<target name="xmlrpc" depends="api">
<mkdir dir="${build_xmlrpc}"/>
<javac debug="${debug}" deprecation="${deprecation}" target="1.1"
srcdir="${src_xmlrpc}" destdir="${build_xmlrpc}" classpath="${build_classes}"/>
<jar jarfile="${jar_xmlrpc}">
<fileset dir="${build_xmlrpc}"/>
</jar>
</target>
<target name="addons" depends="prepare,sax2,util,wrapper,xmlrpc,parser_pool,dom2_builder"/>
<target name="addons_tests" depends="addons,wrapper_tests"/>
<!-- =================================================================== -->
<!-- JUnit automatic tests -->
<!-- =================================================================== -->
<path id="test-classpath">
<pathelement location="${build_classes}" />
<pathelement path="${java.class.path}" />
</path>
<target name="tests_junit" if="junit_present" depends="xmlpull,check_junit">
<mkdir dir="${build_tests}"/>
<javac debug="${debug}" deprecation="${deprecation}"
srcdir="${src_tests}"
destdir="${build_tests}">
<classpath refid="test-classpath" />
</javac>
<mkdir dir="${build_tests_xml}"/>
<copy todir="${build_tests_xml}">
<fileset dir="${src_tests_xml}">
<include name="**/*.xml"/>
</fileset>
</copy>
</target>
<target name="tests_jar" unless="build_tests_jar_notRequired" depends="tests_junit">
<mkdir dir="${build_lib}"/>
<jar jarfile="${tests_jar}">
<fileset dir="${build_tests}"/>
</jar>
</target>
<target name="tests" depends="tests_jar"/>
<target name="junit" if="junit_present" depends="tests">
<java classname="org.xmlpull.v1.tests.PackageTests" fork="yes">
<!--arg value="foo_argument_1" /-->
<!--arg value="samples/list.xml" /-->
<classpath>
<path refid="test-classpath" />
<pathelement location="${build_tests}" />
</classpath>
</java>
<!--junit haltonfailure="yes" fork="yes">
<classpath>
<path refid="test-classpath" />
<pathelement location="${build_tests}" />
</classpath>
<formatter type="plain" usefile="false" />
<test name="org.xmlpull.v1.tests.PackageTests" />
</junit-->
</target>
<!-- =================================================================== -->
<!-- Creates the API documentation -->
<!-- =================================================================== -->
<target name="apidoc" depends="xmlpull">
<delete dir="${build_apidoc}"/>
<mkdir dir="${build_apidoc}"/>
<javadoc packagenames="${apidoc_packages}"
public="yes"
sourcepath="${api_sourcepath}"
destdir="${build_apidoc}"
author="true"
version="true"
use="true"
windowtitle="${name} ${version} API"
doctitle="${name}"
bottom="${copyright}"
stylesheetfile="${doc}/javadoc_stylesheet.css"
/>
</target>
<!-- =================================================================== -->
<!-- Creates the JAVADOC documentation -->
<!-- =================================================================== -->
<target name="javadoc" depends="xmlpull">
<delete dir="${build_javadoc}"/>
<mkdir dir="${build_javadoc}"/>
<javadoc packagenames="${javadoc_packages}"
sourcepath="${api_sourcepath}"
destdir="${build_javadoc}"
author="true"
version="true"
use="true"
windowtitle="${name} ${version} Implementation API"
doctitle="Implementation ${name}"
bottom="${copyright}"
stylesheetfile="${doc}/javadoc_stylesheet.css"
/>
</target>
<!-- =================================================================== -->
<!-- Creates the XMLPULL distribution -->
<!-- =================================================================== -->
<target name="dist_lite" depends="compile, apidoc">
<delete dir="${dist}"/>
<delete file="${dist_lite_zip}"/>
<mkdir dir="${dist}"/>
<mkdir dir="${dist}/build"/>
<copy todir="${dist}/build">
<fileset dir="${build}">
<include name="lib/${xmlpull_version}*.jar"/>
<include name="lib/xmlpull-tests_${version}*.jar"/>
<include name="classes/**"/>
<include name="samples/**"/>
<include name="tests/**"/>
</fileset>
</copy>
<copy todir="${dist}">
<fileset dir="${build}/lib">
<include name="${xmlpull_version}*.jar"/>
</fileset>
</copy>
<!-- sources should be copied after build to make it newer -->
<mkdir dir="${dist}/src"/>
<mkdir dir="${dist}/${src_samples}"/>
<copy todir="${dist}/${src_samples}">
<fileset dir="${src_samples}">
<!--include name="**"/-->
<!--exclude name="**/stuff/**"/-->
</fileset>
</copy>
<mkdir dir="${dist}/${src_tests}"/>
<copy todir="${dist}/${src_tests}">
<fileset dir="${src_tests}">
<!--include name="**"/-->
<!--exclude name="**/stuff/**"/-->
</fileset>
</copy>
<mkdir dir="${dist}/${src_tests_xml}"/>
<copy todir="${dist}/${src_tests_xml}">
<fileset dir="${src_tests_xml}">
<!--include name="**"/-->
<!--exclude name="**/stuff/**"/-->
</fileset>
</copy>
<mkdir dir="${dist}/${src_api}"/>
<copy todir="${dist}/${src_api}">
<fileset dir="${src_api}">
<patternset refid="all_source_files"/>
</fileset>
</copy>
<mkdir dir="${dist}/${src_addons}"/>
<copy todir="${dist}/${src_addons}">
<fileset dir="${src_addons}">
<patternset refid="all_source_files"/>
</fileset>
</copy>
<mkdir dir="${dist}/${doc}"/>
<copy todir="${dist}/${doc}">
<fileset dir="${doc}">
<exclude name="**/*impl*/**"/>
</fileset>
</copy>
<copy file="LICENSE.txt" tofile="${dist}/LICENSE.txt"/>
<copy file="LICENSE_TESTS.txt" tofile="${dist}/LICENSE_TESTS.txt"/>
<copy file="README.html" tofile="${dist}/README.html"/>
<!--copy file="README.txt" tofile="${dist}/README.txt"/-->
<copy file="build.xml" tofile="${dist}/build.xml"/>
<copy todir="${dist}">
<fileset dir=".">
<include name="*.sh"/>
<include name="*.bat"/>
</fileset>
</copy>
<fixcrlf srcdir="${dist}"
eol="lf" eof="remove"
includes="**/*.html,**/*.txt,**/*.sh"
/>
<fixcrlf srcdir="${dist}"
eol="crlf"
includes="**/*.bat"
/>
<mkdir dir="${dist}/lib"/>
<copy todir="${dist}/lib">
<fileset dir="lib">
<exclude name="**/*.jar"/>
<exclude name="**/impl_*/**"/>
</fileset>
<fileset dir="lib">
<include name="**/README.txt"/>
</fileset>
</copy>
<chmod perm="a+x" dir="${dist}"
includes="**/*.sh" />
<zip zipfile="${dist_lite_zip}" basedir="${build}/dist"
includes="${xmlpull_version}/**"
excludes="${xmlpull_version}/build/**,${xmlpull_version}/doc/api/**"/>
<tar tarfile="${dist_lite_tar}"
longfile="gnu">
<tarfileset dir="${build}/dist" mode="755" username="aslom" group="ewww">
<include name="${xmlpull_version}/**/*.sh"/>
<exclude name="${xmlpull_version}/build/**"/>
<exclude name="${xmlpull_version}/doc/api/**"/>
</tarfileset>
<tarfileset dir="${build}/dist" username="aslom" group="ewww">
<include name="${xmlpull_version}/**"/>
<exclude name="${xmlpull_version}/**/*.sh"/>
<exclude name="${xmlpull_version}/build/**"/>
<exclude name="${xmlpull_version}/doc/api/**"/>
</tarfileset>
</tar>
<gzip zipfile="${dist_lite_tgz}" src="${dist_lite_tar}" />
<delete file="${dist_lite_tar}"/>
</target>
<target name="dist_lib" depends="dist_lite">
<mkdir dir="${dist}/lib"/>
<copy todir="${dist}/lib">
<fileset dir="lib">
<exclude name="**/*impl_*/*"/>
</fileset>
</copy>
<delete file="${dist_full_zip}"/>
<zip zipfile="${dist_full_zip}" basedir="${build}/dist"
includes="${xmlpull_version}/**"/>
<!--tar tarfile="${dist_full_tar}" basedir="${build}/dist"
longfile="gnu"
includes="${xmlpull_version}/**" /-->
<tar tarfile="${dist_full_tar}"
longfile="gnu">
<tarfileset dir="${build}/dist" mode="755" username="aslom" group="ewww">
<include name="${xmlpull_version}/**/*.sh"/>
</tarfileset>
<tarfileset dir="${build}/dist" username="aslom" group="ewww">
<include name="${xmlpull_version}/**"/>
<exclude name="${xmlpull_version}/**/*.sh"/>
</tarfileset>
</tar>
<gzip zipfile="${dist_full_tgz}" src="${dist_full_tar}" />
<delete file="${dist_full_tar}"/>
</target>
<target name="dist" depends="dist_lib"/>
<!-- =================================================================== -->
<!-- Copy docs and downloads to XMLPULL website -->
<!-- =================================================================== -->
<target name="website_doc" depends="apidoc">
<mkdir dir="${website}"/>
<delete dir="${website}/${doc}"/>
<mkdir dir="${website}/${doc}"/>
<copy todir="${website}/${doc}">
<fileset dir="${doc}">
<exclude name="**/*impl*/**"/>
</fileset>
</copy>
</target>
<target name="website_download" depends="dist,website_doc">
<delete dir="${website}/download"/>
<mkdir dir="${website}/download"/>
<copy file="${doc}/README_DOWNLOAD.html" tofile="${website}/download/README.html"/>
<!-- get JAR files for easy download by people -->
<copy todir="${website}/download">
<fileset dir="${build}/lib">
<include name="${xmlpull_version}*.jar"/>
<include name="xmlpull-tests_${version}*.jar"/>
</fileset>
</copy>
<copy todir="${website}/download">
<fileset dir="${build}/dist">
<include name="${xmlpull_version}_*.*"/>
</fileset>
</copy>
<!--gunzip src="${dist_full_tgz}" dest="${website}/download/unpacked.tar"/>
<untar src="${website}/download/unpacked.tar" dest="${website}/download"/>
<delete file="${website}/unpacked.tar"/>
<move file="${website}/download/${xmlpull_version}" todir="${website}/download/unpacked"/-->
<mkdir dir="${website}/download/unpacked"/>
<copy todir="${website}/download/unpacked">
<fileset dir="${dist}"/>
</copy>
</target>
<target name="website" depends="website_download"/>
<target name="run" depends="samples">
<java classname="SampleToRunFromANT" fork="yes">
<arg value="foo_argument_1" />
<!--arg value="samples/list.xml" /-->
<classpath>
<path refid="test-classpath" />
<pathelement location="${build_samples}" />
</classpath>
</java>
</target>
</project>