-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
748 lines (721 loc) · 35.8 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
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
<?xml version="1.0"?>
<project default="all" basedir=".">
<property file="build.properties"/>
<property file="build-local.properties"/>
<property environment="env"/>
<property name="Name" value="Barcode4J Library"/>
<property name="name" value="barcode4j"/>
<property name="version" value="${barcode4j-version}"/>
<property name="impl.vendor" value="The Barcode4J Project"/>
<property name="impl.url" value="http://barcode4j.sourceforge.net"/>
<property name="year" value="2000-2010"/>
<property name="build.compiler" value="classic"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="src.java.dir" value="${src.dir}/java"/>
<property name="src.test.java.dir" value="${src.dir}/test/java"/>
<property name="src.conf.dir" value="${src.dir}/conf"/>
<property name="src.test" value="${basedir}/src/test"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="optional.lib.dir" value="${lib.dir}"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="build.test" value="${build.dir}/test"/>
<property name="build.dest" value="${build.dir}/classes"/>
<property name="resource-jar.dir" value="${build.dir}/resource-jars"/>
<property name="dist.dir" value="${basedir}/dist"/>
<property name="docs.dir" value="${build.dir}/javadocs"/>
<property name="fop-0.20.5.ext.dir" value="${src.dir}/fop-0.20.5"/>
<property name="fop-trunk.ext.dir" value="${src.dir}/fop-trunk"/>
<property name="xgc.ext.dir" value="${src.dir}/xmlgraphics-commons"/>
<property name="src.fop-0.20.5.dir" value="${fop-0.20.5.ext.dir}/java"/>
<property name="src.fop-trunk.dir" value="${fop-trunk.ext.dir}/java"/>
<property name="src.xgc.dir" value="${xgc.ext.dir}/java"/>
<property name="build.dest.fop-0.20.5" value="${build.dir}/fop-0.20.5/classes"/>
<property name="build.dest.fop-trunk" value="${build.dir}/fop-trunk/classes"/>
<property name="build.dest.xgc" value="${build.dir}/xgc/classes"/>
<property name="build.dotnet.dir" value="${build.dir}/dotnet"/>
<property name="xalan.dir" value="${src.dir}/xalan"/>
<property name="saxon6.dir" value="${src.dir}/saxon"/>
<property name="saxon8.dir" value="${src.dir}/saxon8"/>
<property name="jdom.dir" value="${src.dir}/jdom"/>
<property name="checkstyle.home" value=""/>
<property name="main.class" value="org.krysalis.barcode4j.cli.Main"/>
<!-- .NET support (using IKVM) -->
<property name="ikvm.dir" value="."/>
<property name="ikvmc" value="${ikvm.dir}/bin/ikvmc.exe"/>
<presetdef name="javac">
<javac debug="${debug}" deprecation="${deprecation}" optimize="${optimize}"
source="${javac.source}" target="${javac.target}" encoding="${encoding}"/>
</presetdef>
<!-- jars -->
<path id="project.classpath">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${optional.lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<path id="test.classpath">
<pathelement location="${build.dest}"/>
<pathelement location="${build.test}/classes"/>
<path refid="project.classpath"/>
</path>
<path id="checkstylepath">
<fileset dir="${checkstyle.home}">
<include name="checkstyle-all-*.jar"/>
</fileset>
</path>
<!-- =================================================================== -->
<!-- Initialization target -->
<!-- =================================================================== -->
<target name="pre-init">
<tstamp/>
<echo message="------------------- ${Name} ${version} [${year}] ----------------"/>
<echo message="See build.properties and build-local.properties for additional build settings"/>
<echo message="${ant.version}"/>
<echo message="VM: ${java.vm.version}, ${java.vm.vendor}"/>
<echo message="JAVA_HOME: ${env.JAVA_HOME}"/>
<tstamp>
<format property="ts" pattern="yyyyMMdd-HHmmss-z"/>
</tstamp>
<path id="bundle-util.classpath">
<fileset dir="${lib.dir}/build-tools">
<include name="**/*.jar"/>
</fileset>
</path>
<taskdef resource="ch/jm/osgi/util/bundle/ant/antlib.xml"
classpathref="bundle-util.classpath" onerror="fail"/>
</target>
<target name="init" depends="pre-init">
<available property="junit.present" classname="junit.framework.TestCase"
classpathref="project.classpath"/>
<condition property="junit.message" value="JUnit Support PRESENT">
<equals arg1="${junit.present}" arg2="true"/>
</condition>
<condition property="junit.message" value="JUnit Support NOT Present - Committers are required to have JUnit working">
<not>
<equals arg1="${junit.present}" arg2="true"/>
</not>
</condition>
<echo message="${junit.message}"/>
<available property="jdk14.present" classname="java.lang.CharSequence"/>
<available property="jdk15.present" classname="java.lang.StringBuilder"/>
<available property="xalan.present" classname="org.apache.xalan.xslt.Process" classpathref="project.classpath"/>
<available property="saxon6.present" classname="com.icl.saxon.TransformerFactoryImpl" classpathref="project.classpath"/>
<condition property="saxon8.present">
<and>
<available classname="net.sf.saxon.TransformerFactoryImpl" classpathref="project.classpath"/>
<available classname="java.lang.CharSequence"/>
</and>
</condition>
<available property="jdom.present" classname="org.jdom.Document" classpathref="project.classpath"/>
<property name="init.fop-0.20.5" value="true"/>
<property name="init.fop-trunk" value="true"/>
<condition property="IKVM.present">
<and>
<available file="${ikvmc}"/>
<isset property="jdk14.present"/>
</and>
</condition>
<condition property="ikvm.message" value="IKVM Support PRESENT">
<isset property="IKVM.present"/>
</condition>
<condition property="ikvm.message" value="IKVM Support NOT PRESENT or DISABLED">
<not>
<isset property="IKVM.present"/>
</not>
</condition>
<echo message="${ikvm.message}"/>
</target>
<target name="init.fop-0.20.5" depends="init" if="init.fop-0.20.5">
<echo message="Home directory for Apache FOP 0.20.5 is set. Will try to compile FOP extension."/>
<path id="fop-0.20.5.classpath">
<path refid="project.classpath"/>
<fileset dir="${lib.dir}/fop-0.20.5">
<include name="*.jar"/>
</fileset>
</path>
</target>
<target name="init.fop-trunk" depends="init" if="init.fop-trunk">
<echo message="Home directory for Apache FOP Trunk is set. Will try to compile FOP extension."/>
<path id="fop-trunk.classpath">
<path refid="project.classpath"/>
<fileset dir="${lib.dir}/fop">
<include name="*.jar"/>
</fileset>
</path>
</target>
<target name="init.xgc" depends="init">
<path id="xgc.classpath">
<path refid="project.classpath"/>
<fileset dir="${lib.dir}/fop">
<include name="*.jar"/>
</fileset>
</path>
</target>
<target name="info.jdk14" unless="jdk14.present">
<echo message="===================================================================="/>
<echo message="Barcode4J requires at least Java 1.4"/>
<echo message="===================================================================="/>
</target>
<target name="info.xalan" depends="init" unless="xalan.present">
<echo message="===================================================================="/>
<echo message="You can enable compilation of the Xalan-J XSLT extension by adding"/>
<echo message="xalan.jar to the lib directory."/>
<echo message="===================================================================="/>
</target>
<target name="info.saxon6" depends="init" unless="saxon6.present">
<echo message="===================================================================="/>
<echo message="You can enable compilation of the SAXON 6.5.x XSLT extension by"/>
<echo message="adding saxon.jar to the lib directory."/>
<echo message="===================================================================="/>
</target>
<target name="info.saxon8" depends="init" unless="saxon8.present">
<echo message="===================================================================="/>
<echo message="You can enable compilation of the SAXON 8.x XSLT extension by adding"/>
<echo message="saxon8.jar to the lib directory. Use JDK >= 1.4."/>
<echo message="===================================================================="/>
</target>
<target name="info.jdom" depends="init" unless="jdom.present">
<echo message="===================================================================="/>
<echo message="You can enable compilation of the JDOM-related sources by adding"/>
<echo message="jdom.jar to the lib directory."/>
<echo message="===================================================================="/>
</target>
<target name="info.ikvm" depends="init" unless="IKVM.present">
<echo message="===================================================================="/>
<echo message="You can enable compilation of .NET binaries by installing IKVM and"/>
<echo message="by specifying the 'ikvm.dir' value in build-local.properties."/>
<echo message="===================================================================="/>
</target>
<!-- =================================================================== -->
<!-- Prepares the build directory -->
<!-- =================================================================== -->
<target name="prepare" depends="init, info.jdk14, init.fop-0.20.5, init.fop-trunk, init.xgc, info.xalan, info.saxon6, info.saxon8, info.jdom, info.ikvm">
<!-- create directories -->
<echo message="Preparing the build directories"/>
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.dest}"/>
<mkdir dir="${resource-jar.dir}"/>
</target>
<!-- =================================================================== -->
<!-- Compiles the source directory -->
<!-- =================================================================== -->
<target name="compile" depends="prepare">
<echo message="Compiling the core sources"/>
<javac srcdir="${src.java.dir}" destdir="${build.dest}">
<classpath refid="project.classpath"/>
</javac>
<copy todir="${build.dest}" >
<fileset dir="${src.java.dir}" casesensitive="yes">
<include name="org/krysalis/barcode4j/impl/code128/*.properties"/>
<include name="org/krysalis/barcode4j/impl/fourstate/*.csv"/>
</fileset>
</copy>
</target>
<target name="compile-xalan" depends="compile" if="xalan.present">
<echo message="Compiling the Apache Xalan-J extension"/>
<javac srcdir="${xalan.dir}/java" destdir="${build.dest}">
<classpath refid="project.classpath"/>
</javac>
</target>
<target name="compile-saxon6" depends="compile" if="saxon6.present">
<echo message="Compiling the SAXON 6.5.x extension"/>
<javac srcdir="${saxon6.dir}/java" destdir="${build.dest}">
<classpath refid="project.classpath"/>
</javac>
</target>
<target name="compile-saxon8" depends="compile" if="saxon8.present">
<echo message="Compiling the SAXON 8.x extension"/>
<javac srcdir="${saxon8.dir}/java" destdir="${build.dest}">
<classpath refid="project.classpath"/>
</javac>
</target>
<target name="compile-jdom" depends="compile" if="jdom.present">
<echo message="Compiling the JDOM-related classes"/>
<javac srcdir="${jdom.dir}/java" destdir="${build.dest}">
<classpath refid="project.classpath"/>
</javac>
</target>
<target name="compile-fop-0.20.5" depends="compile">
<echo message="Compiling the Apache FOP 0.20.5 extension"/>
<mkdir dir="${build.dest.fop-0.20.5}"/>
<javac srcdir="${src.fop-0.20.5.dir}" destdir="${build.dest.fop-0.20.5}">
<classpath>
<path refid="fop-0.20.5.classpath"/>
<pathelement location="${build.dest}"/>
</classpath>
</javac>
</target>
<target name="compile-fop-trunk" depends="compile">
<echo message="Compiling the Apache FOP Trunk extension"/>
<mkdir dir="${build.dest.fop-trunk}"/>
<javac srcdir="${src.fop-trunk.dir}" destdir="${build.dest.fop-trunk}">
<classpath>
<path refid="fop-trunk.classpath"/>
<pathelement location="${build.dest}"/>
</classpath>
</javac>
</target>
<target name="compile-xgc" depends="compile">
<echo message="Compiling the image loader extension for Apache XML Graphics Commons"/>
<mkdir dir="${build.dest.xgc}"/>
<javac srcdir="${src.xgc.dir}" destdir="${build.dest.xgc}">
<classpath>
<path refid="xgc.classpath"/>
<pathelement location="${build.dest}"/>
</classpath>
</javac>
</target>
<target name="compile-all" depends="compile, compile-xalan, compile-saxon6, compile-saxon8, compile-jdom, compile-fop-0.20.5, compile-fop-trunk, compile-xgc" description="Compiles the sources"/>
<!-- =================================================================== -->
<!-- Creates Java docs -->
<!-- =================================================================== -->
<target name="javadocs" depends="prepare" description="Generates Javadocs">
<echo message="Creating java docs"/>
<mkdir dir="${docs.dir}"/>
<javadoc destdir="${docs.dir}" packagenames="org.krysalis.*"
version="true" author="true" use="true"
overview="${src.dir}/documentation/overview.html"
windowtitle="${name} ${version} API"
stylesheetfile="${src.dir}/documentation/resources/stylesheets/javadoc.css">
<classpath refid="project.classpath"/>
<classpath refid="fop-trunk.classpath"/>
<packageset dir="${src.java.dir}" defaultexcludes="yes"/>
<packageset dir="${xalan.dir}/java" defaultexcludes="yes"/>
<packageset dir="${saxon6.dir}/java" defaultexcludes="yes"/>
<packageset dir="${saxon8.dir}/java" defaultexcludes="yes"/>
<packageset dir="${jdom.dir}/java" defaultexcludes="yes"/>
<packageset dir="${src.xgc.dir}" defaultexcludes="yes"/>
<tag name="todo" scope="all" description="TODO:" />
<link href="http://avalon.apache.org/framework/api/"/>
<!--link href="http://www.saxonica.com/documentation/javadoc/"/ doesn't work anymore-->
<doctitle>${name} ${version} API</doctitle>
<bottom><i>Copyright © ${year} Jeremias Maerki. All rights reserved.<i></bottom>
<header><![CDATA[${name} ${version}]]></header>
<footer><![CDATA[${name} ${version}]]></footer>
</javadoc>
</target>
<!-- =================================================================== -->
<!-- Creates the class package -->
<!-- =================================================================== -->
<target name="package-base" depends="compile-all">
<echo message="Creating the jar file ${build.dir}/${name}.jar"/>
<jar jarfile="${build.dir}/${name}.jar">
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
<attribute name="Implementation-Title" value="${Name}"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="${impl.vendor}"/>
<attribute name="Implementation-URL" value="${impl.url}"/>
<attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}])"/>
</manifest>
<metainf dir="${basedir}" includes="LICENSE,NOTICE"/>
<fileset dir="${build.dest}">
<include name="org/krysalis/**"/>
</fileset>
</jar>
<jar jarfile="${build.dir}/${name}-light.jar">
<manifest>
<attribute name="Implementation-Title" value="${Name}"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="${impl.vendor}"/>
<attribute name="Implementation-URL" value="${impl.url}"/>
<attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}])"/>
</manifest>
<metainf dir="${basedir}" includes="LICENSE,NOTICE"/>
<fileset dir="${build.dest}">
<include name="org/krysalis/**"/>
<exclude name="org/krysalis/barcode4j/cli/**"/>
<exclude name="org/krysalis/barcode4j/ant/**"/>
<exclude name="org/krysalis/barcode4j/servlet/**"/>
<exclude name="org/krysalis/barcode4j/xalan/**"/>
<exclude name="org/krysalis/barcode4j/saxon*/**"/>
<exclude name="org/krysalis/barcode4j/BarcodeUtil.class"/>
<exclude name="org/krysalis/barcode4j/impl/ConfigurableBarcodeGenerator.class"/>
<exclude name="org/krysalis/barcode4j/impl/codabar/Codabar.class"/>
<exclude name="org/krysalis/barcode4j/impl/code39/Code39.class"/>
<exclude name="org/krysalis/barcode4j/impl/code128/Code128.class"/>
<exclude name="org/krysalis/barcode4j/impl/code128/EAN128.class"/>
<exclude name="org/krysalis/barcode4j/impl/int2of5/Interleaved2Of5.class"/>
<exclude name="org/krysalis/barcode4j/impl/postnet/POSTNET.class"/>
<exclude name="org/krysalis/barcode4j/impl/fourstate/RoyalMailCBC.class"/>
<exclude name="org/krysalis/barcode4j/impl/fourstate/USPSIntelligentMail.class"/>
<exclude name="org/krysalis/barcode4j/impl/upcean/EAN13.class"/>
<exclude name="org/krysalis/barcode4j/impl/upcean/EAN8.class"/>
<exclude name="org/krysalis/barcode4j/impl/upcean/UPCA.class"/>
<exclude name="org/krysalis/barcode4j/impl/upcean/UPCE.class"/>
<exclude name="org/krysalis/barcode4j/impl/upcean/UPCEAN.class"/>
<exclude name="org/krysalis/barcode4j/impl/pdf417/PDF417.class"/>
<exclude name="org/krysalis/barcode4j/impl/datamatrix/DataMatrix.class"/>
<exclude name="org/krysalis/barcode4j/tools/ConfigurationUtil.class"/>
</fileset>
</jar>
</target>
<target name="osgi" depends="package-base" if="jdk15.present">
<echo message="Adding OSGi metadata..."/>
<convert-jar-to-bundle file="${build.dir}/${name}-light.jar"
descriptor="${basedir}/bundle.xml">
<attribute name="Bundle-Version" value="${barcode4j-version}"/>
<attribute name="Bundle-Vendor" value="${impl.vendor}"/>
<attribute name="Bundle-DocURL" value="${impl.url}"/>
</convert-jar-to-bundle>
<convert-jar-to-bundle file="${build.dir}/${name}.jar"
descriptor="${basedir}/bundle.xml">
<attribute name="Bundle-Version" value="${barcode4j-version}"/>
<attribute name="Bundle-Vendor" value="${impl.vendor}"/>
<attribute name="Bundle-DocURL" value="${impl.url}"/>
</convert-jar-to-bundle>
</target>
<target name="package-fop-0.20.5" depends="compile-all">
<echo message="Creating the jar file ${build.dir}/${name}-fop-ext-0.20.5.jar"/>
<jar jarfile="${build.dir}/${name}-fop-ext-0.20.5.jar">
<manifest>
<attribute name="Implementation-Title" value="${Name}"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="${impl.vendor}"/>
<attribute name="Implementation-URL" value="${impl.url}"/>
<attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}])"/>
</manifest>
<metainf dir="${basedir}" includes="LICENSE,NOTICE"/>
<metainf dir="${fop-0.20.5.ext.dir}/resources">
<include name="**"/>
</metainf>
<fileset dir="${build.dest.fop-0.20.5}">
<include name="org/krysalis/**"/>
</fileset>
</jar>
<jar jarfile="${build.dir}/${name}-fop-ext-0.20.5-complete.jar">
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
<attribute name="Implementation-Title" value="${Name}"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="${impl.vendor}"/>
<attribute name="Implementation-URL" value="${impl.url}"/>
<attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}])"/>
</manifest>
<metainf dir="${basedir}" includes="LICENSE,NOTICE"/>
<metainf dir="${fop-0.20.5.ext.dir}/resources">
<include name="**"/>
</metainf>
<fileset dir="${build.dest.fop-0.20.5}">
<include name="org/krysalis/**"/>
</fileset>
<fileset dir="${build.dest}">
<include name="org/krysalis/**"/>
</fileset>
</jar>
</target>
<target name="package-fop-trunk" depends="compile-all">
<echo message="Creating the jar file ${build.dir}/${name}-fop-ext.jar"/>
<jar jarfile="${build.dir}/${name}-fop-ext.jar">
<manifest>
<attribute name="Implementation-Title" value="${Name}"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="${impl.vendor}"/>
<attribute name="Implementation-URL" value="${impl.url}"/>
<attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}])"/>
</manifest>
<metainf dir="${basedir}" includes="LICENSE,NOTICE"/>
<metainf dir="${fop-trunk.ext.dir}/resources">
<include name="**"/>
</metainf>
<metainf dir="${xgc.ext.dir}/resources">
<include name="**"/>
</metainf>
<fileset dir="${build.dest.fop-trunk}">
<include name="org/krysalis/**"/>
</fileset>
<fileset dir="${build.dest.xgc}">
<include name="org/krysalis/**"/>
</fileset>
</jar>
<jar jarfile="${build.dir}/${name}-fop-ext-complete.jar">
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
<attribute name="Implementation-Title" value="${Name}"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="${impl.vendor}"/>
<attribute name="Implementation-URL" value="${impl.url}"/>
<attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}])"/>
</manifest>
<metainf dir="${basedir}" includes="LICENSE,NOTICE"/>
<metainf dir="${fop-trunk.ext.dir}/resources">
<include name="**"/>
</metainf>
<metainf dir="${xgc.ext.dir}/resources">
<include name="**"/>
</metainf>
<fileset dir="${build.dest.fop-trunk}">
<include name="org/krysalis/**"/>
</fileset>
<fileset dir="${build.dest.xgc}">
<include name="org/krysalis/**"/>
</fileset>
<fileset dir="${build.dest}">
<include name="org/krysalis/**"/>
</fileset>
</jar>
<jar jarfile="${resource-jar.dir}/${name}-fop-ext-resources.jar">
<manifest>
<attribute name="Implementation-Title" value="${Name}"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="${impl.vendor}"/>
<attribute name="Implementation-URL" value="${impl.url}"/>
<attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}])"/>
</manifest>
<metainf dir="${basedir}" includes="LICENSE,NOTICE"/>
<metainf dir="${fop-trunk.ext.dir}/resources">
<include name="**"/>
</metainf>
</jar>
</target>
<target name="package-xgc" depends="compile-all">
<echo message="Creating the jar file ${build.dir}/${name}-xgc.jar"/>
<jar jarfile="${build.dir}/${name}-xgc.jar">
<manifest>
<attribute name="Implementation-Title" value="${Name}"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="${impl.vendor}"/>
<attribute name="Implementation-URL" value="${impl.url}"/>
<attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}])"/>
</manifest>
<metainf dir="${basedir}" includes="LICENSE,NOTICE"/>
<metainf dir="${xgc.ext.dir}/resources">
<include name="**"/>
</metainf>
<fileset dir="${build.dest.xgc}">
<include name="org/krysalis/**"/>
</fileset>
</jar>
<jar jarfile="${resource-jar.dir}/${name}-xgc-resources.jar">
<manifest>
<attribute name="Implementation-Title" value="${Name}"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="${impl.vendor}"/>
<attribute name="Implementation-URL" value="${impl.url}"/>
<attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}])"/>
</manifest>
<metainf dir="${basedir}" includes="LICENSE,NOTICE"/>
<metainf dir="${xgc.ext.dir}/resources">
<include name="**"/>
</metainf>
</jar>
</target>
<target name="package" depends="package-base, package-fop-0.20.5, package-fop-trunk, package-xgc, osgi, package.NET" description="Creates the Barcode JAR packages"/>
<!-- =================================================================== -->
<!-- Creates .NET binaries using IKVM -->
<!-- =================================================================== -->
<macrodef name="ikvm-compile">
<element name="args"/>
<sequential>
<exec executable="${ikvmc}">
<arg value="-exclude:ikvm-excludes.txt"/>
<arg value="-debug"/>
<arg value="-reference:${build.dotnet.dir}/IKVM.*.dll"/>
<args/>
</exec>
</sequential>
</macrodef>
<target name="package.NET" depends="package-base" if="IKVM.present" description="Generates the .NET DLL using IKVM">
<property name="avalon.name" value="avalon-framework-4.2.0"/>
<property name="cli.name" value="commons-cli-1.0"/>
<mkdir dir="${build.dotnet.dir}"/>
<copy todir="${build.dotnet.dir}">
<fileset dir="${ikvm.dir}/bin">
<include name="IKVM.Runtime*.dll"/>
<include name="IKVM.OpenJDK*.dll"/>
<include name="IKVM.AWT*.dll"/>
</fileset>
</copy>
<echo message="=== Avalon DLL ==="/>
<ikvm-compile>
<args>
<arg value="-target:library"/>
<arg value="-version:4.2.0.0"/>
<arg value="-out:${build.dotnet.dir}\${avalon.name}.dll"/>
<arg value="${lib.dir}\${avalon.name}.jar"/>
</args>
</ikvm-compile>
<echo message="=== Commons CLI DLL ==="/>
<ikvm-compile>
<args>
<arg value="-target:library"/>
<arg value="-version:1.0.0.0"/>
<arg value="-out:${build.dotnet.dir}\${cli.name}.dll"/>
<arg value="${lib.dir}\${cli.name}.jar"/>
</args>
</ikvm-compile>
<echo message="=== Barcode4J DLL ==="/>
<ikvm-compile>
<args>
<arg value="-reference:${build.dotnet.dir}\${avalon.name}.dll"/>
<arg value="-reference:${build.dotnet.dir}\${cli.name}.dll"/>
<arg value="-target:library"/>
<arg value="-version:${barcode4j-version.net}"/>
<arg value="-fileversion:${barcode4j-version}"/>
<arg value="-out:${build.dotnet.dir}\${name}-${version}.dll"/>
<arg value="${build.dir}\${name}.jar"/>
</args>
</ikvm-compile>
<echo message="=== Barcode4J EXE ==="/>
<ikvm-compile>
<args>
<arg value="-reference:${build.dotnet.dir}\${name}-${version}.dll"/>
<arg value="-reference:${build.dotnet.dir}\${avalon.name}.dll"/>
<arg value="-reference:${build.dotnet.dir}\${cli.name}.dll"/>
<arg value="-target:exe"/>
<arg value="-version:${barcode4j-version.net}"/>
<arg value="-fileversion:${barcode4j-version}"/>
<arg value="-out:${build.dotnet.dir}\${name}.exe"/>
<arg value="-main:${main.class}"/>
</args>
</ikvm-compile>
</target>
<!-- =================================================================== -->
<!-- Sample web application -->
<!-- =================================================================== -->
<target name="webapp" depends="package" description="Creates the sample webapp found in the example/webapp directory">
<echo message="Creating the WAR file ${build.dir}/${name}.war"/>
<property name="webapp.dir" value="examples/webapp"/>
<property name="build.webapp.dest" value="${build.dir}/webapp/classes"/>
<mkdir dir="${build.webapp.dest}"/>
<path id="webapp.classpath">
<fileset dir="${build.dir}">
<include name="${name}.jar"/>
</fileset>
<path refid="project.classpath"/>
</path>
<javac srcdir="${webapp.dir}/java" destdir="${build.webapp.dest}" debug="${debug}" deprecation="${deprecation}" optimize="${optimize}" encoding="${encoding}">
<classpath refid="webapp.classpath"/>
</javac>
<war warfile="${build.dir}/${name}.war" webxml="${webapp.dir}/conf/web.xml">
<lib dir="${lib.dir}">
<include name="avalon-framework*.jar"/>
<include name="zxing*.jar"/>
</lib>
<lib dir="${build.dir}">
<include name="${name}.jar"/>
</lib>
<classes dir="${build.webapp.dest}"/>
<fileset dir="${webapp.dir}/html"/>
<webinf dir="${webapp.dir}/xml">
<include name="*.xslt"/>
</webinf>
</war>
</target>
<!-- =================================================================== -->
<!-- Tests -->
<!-- =================================================================== -->
<target name="test-init" depends="compile-all">
<mkdir dir="${build.test}/classes"/>
</target>
<target name="test-compile-core" depends="test-init" if="junit.present">
<javac srcdir="${src.test.java.dir}" destdir="${build.test}/classes"
debug="${debug}" deprecation="${deprecation}" optimize="${optimize}"
source="${javac.source}" target="${javac.target}" encoding="${encoding}">
<classpath refid="test.classpath"/>
</javac>
</target>
<target name="test-compile-xalan" if="xalan.present">
<javac srcdir="${xalan.dir}/test/java" destdir="${build.test}/classes"
debug="${debug}" deprecation="${deprecation}" optimize="${optimize}"
source="${javac.source}" target="${javac.target}" encoding="${encoding}">
<classpath refid="test.classpath"/>
</javac>
</target>
<target name="test-compile-saxon6" if="saxon6.present">
<javac srcdir="${saxon6.dir}/test/java" destdir="${build.test}/classes"
debug="${debug}" deprecation="${deprecation}" optimize="${optimize}"
source="${javac.source}" target="${javac.target}" encoding="${encoding}">
<classpath refid="test.classpath"/>
</javac>
</target>
<target name="test-compile-saxon8" if="saxon8.present">
<javac srcdir="${saxon8.dir}/test/java" destdir="${build.test}/classes"
debug="${debug}" deprecation="${deprecation}" optimize="${optimize}"
source="${javac.source}" target="${javac.target}" encoding="${encoding}">
<classpath refid="test.classpath"/>
</javac>
</target>
<target name="test-compile-jdom" if="jdom.present">
<javac srcdir="${jdom.dir}/test/java" destdir="${build.test}/classes"
debug="${debug}" deprecation="${deprecation}" optimize="${optimize}"
source="${javac.source}" target="${javac.target}" encoding="${encoding}">
<classpath refid="test.classpath"/>
</javac>
</target>
<!--target name="test-compile" depends="test-compile-core, test-compile-xalan, test-compile-saxon6, test-compile-saxon8, test-compile-jdom"-->
<target name="test-compile" depends="test-compile-core" if="junit.present">
<antcall target="test-compile-xalan"/>
<antcall target="test-compile-saxon6"/>
<antcall target="test-compile-saxon8"/>
<antcall target="test-compile-jdom"/>
</target>
<target name="test" depends="compile,test-compile" if="junit.present">
<taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
<junit printsummary="yes" haltonfailure="yes">
<!--jvmarg value="-verbose:class"/-->
<sysproperty key="java.awt.headless" value="true"/>
<formatter type="brief" usefile="false"/>
<formatter type="xml" usefile="true"/>
<classpath refid="test.classpath"/>
<batchtest todir="${build.test}">
<fileset dir="${build.test}/classes">
<include name="**/*Test.class" />
<include name="**/*TestCase.class" />
<exclude name="**/Abstract*.class" />
<exclude name="**/XalanExtTest.class" />
</fileset>
</batchtest>
</junit>
<!-- Tests for external bugs separately without haltonfailure -->
<junit printsummary="yes" haltonfailure="no" fork="yes">
<!--jvmarg value="-verbose:class"/-->
<sysproperty key="java.awt.headless" value="true"/>
<formatter type="brief" usefile="false"/>
<classpath refid="test.classpath"/>
<batchtest todir="${build.test}">
<fileset dir="${build.test}/classes">
<include name="**/XalanExtTest.class" />
</fileset>
</batchtest>
</junit>
</target>
<!-- =================================================================== -->
<!-- Default target -->
<!-- =================================================================== -->
<target name="all" depends="test, package, webapp"/>
<!-- =================================================================== -->
<!-- Clean targets -->
<!-- =================================================================== -->
<target name="clean" depends="init" description="Cleans and deletes the build directory">
<delete dir="${build.dir}"/>
<subant target="clean">
<dirset dir="${basedir}" includes="examples/demo-applet"/>
</subant>
</target>
<!-- =================================================================== -->
<!-- Checkstyle -->
<!-- =================================================================== -->
<target name="checkstyle" depends="prepare" description="Runs Checkstyle for a code quality report">
<fail message="Please make sure you've set the checkstyle.home property in your build-local.properties file. You can get Checkstyle from http://checkstyle.sourceforge.net" unless="checkstyle.home"/>
<available property="checkstyle.available" classname="com.puppycrawl.tools.checkstyle.CheckStyleTask" classpathref="checkstylepath"/>
<fail message="Please make sure you've set the checkstyle.home property in your build-local.properties file. You can get Checkstyle from http://checkstyle.sourceforge.net" unless="checkstyle.available"/>
<taskdef name="checkstyle" classname="com.puppycrawl.tools.checkstyle.CheckStyleTask" classpathref="checkstylepath"/>
<checkstyle config="checkstyle.cfg" failonviolation="false">
<fileset dir="${src.java.dir}" includes="**/*.java"/>
<formatter type="plain" toFile="${build.dir}/checkstyle_report.txt"/>
<formatter type="xml" toFile="${build.dir}/checkstyle_report.xml"/>
</checkstyle>
<available property="checkstyle.stylesheet.available" file="checkstyle-noframes.xsl"/>
<antcall target="checkstyle-html"/>
</target>
<target name="checkstyle-html" if="checkstyle.stylesheet.available">
<style in="${build.dir}/checkstyle_report.xml" out="${build.dir}/checkstyle_report.html" style="checkstyle-noframes.xsl"/>
</target>
<!-- =================================================================== -->
<!-- Gump -->
<!-- =================================================================== -->
<target name="gump" depends="test, package, webapp, javadocs"/>
</project>