forked from daisy/pipeline1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-core.xml
466 lines (398 loc) · 15 KB
/
build-core.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
<?xml version="1.0" encoding="utf-8"?>
<project default="all">
<description>Buildfile for the Daisy Pipeline</description>
<!-- ================================================================== -->
<!-- Common properties -->
<!-- ================================================================== -->
<!-- Timestamp format definition -->
<tstamp>
<format property="ISO-TODAY" pattern="yyyyMMdd"/>
</tstamp>
<property name="release.name" value="pipeline-${ISO-TODAY}"/>
<property name="base.dir" value="."/>
<property name="dmfc.src.dir" value="${base.dir}/src"/>
<property name="build.dir" value="${base.dir}/bin"/>
<property name="transformers.dir" value="${base.dir}/transformers"/>
<property name="distribution.dir" value="${base.dir}/dist"/>
<property name="javadoc.dir" value="${base.dir}/doc/api"/>
<!-- ================================================================== -->
<!-- Fileset definitions -->
<!-- ================================================================== -->
<patternset id="patternset.utilJars.2">
<include name="batik-css.jar"/>
<include name="batik-util.jar"/>
<include name="chardet.jar"/>
<include name="commons-cli-1.1.jar"/>
<include name="commons-pool-1.4.jar"/>
<include name="epubcheck-3.0.jar"/>
<include name="icu4j-3_8.jar"/>
<!-- <include name="icu4j-charsets.jar"/> -->
<include name="jaudiotagger.jar"/>
<include name="jl1.0.jar"/>
<include name="junit-4.7.jar"/>
<include name="log4j-1.2.15.jar"/>
<include name="jing.jar"/>
<include name="xml-apis.jar"/>
<include name="sac.jar"/>
<include name="saxon.jar"/>
<include name="saxon8.jar"/>
<include name="saxon8-dom.jar"/>
<include name="serializer.jar"/>
<include name="slf4j-api-1.5.6.jar"/>
<include name="slf4j-log4j12-1.5.6.jar"/>
<include name="stax-api-1.0.1.jar"/>
<include name="tagsoup-1.2.jar"/>
<include name="tritonus_remaining-0.3.6.jar"/>
<include name="tritonus_share-0.3.6.jar"/>
<include name="wstx-lgpl-3.2.8.jar"/>
<include name="xalan.jar"/>
<include name="xercesImpl.jar"/>
<include name="zedval.jar"/>
<include name="brailleUtils-core.jar"/>
<include name="brailleUtils-catalog.jar"/>
<include name="texhyphj.jar"/>
</patternset>
<fileset dir="${base.dir}/lib" id="fileset.utilJars">
<patternset refid="patternset.utilJars.2"/>
</fileset>
<!-- Transformers -->
<fileset dir="${transformers.dir}" id="fileset.transformers">
<patternset refid="patternset.transformers"/>
<exclude name="**/*.java"/>
<exclude name="*.jar"/>
<!-- Jarable... -->
<!--exclude name="int_daisy_validator/**/*.*"/>
<exclude name="uk_rnib_dtbook2xhtml/**/*.*"/-->
</fileset>
<!-- ================================================================== -->
<!-- Path definitions -->
<!-- ================================================================== -->
<path id="path.utilJars">
<fileset dir="${base.dir}/lib">
<patternset refid="patternset.utilJars.2"/>
</fileset>
</path>
<path id="path.classpath">
<dirset dir="${base.dir}">
<include name="transformers"/>
<include name="bin/org/daisy/util"/>
</dirset>
</path>
<path id="path.combined">
<path refid="path.classpath"/>
<path refid="path.utilJars"/>
<path refid="path.build.transformers"/>
<dirset dir="${base.dir}">
<include name="src"/>
</dirset>
</path>
<path id="path.build.transformers">
<path refid="path.utilJars"/>
<pathelement location="${build.dir}"/>
<fileset dir="${base.dir}/transformers">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- ================================================================== -->
<!-- Patternset definitions -->
<!-- ================================================================== -->
<!-- The set of transformers to be included -->
<patternset id="patternset.transformers">
<include name="**/*.*"/>
<exclude name="se_tpb_aligner/**/*.*"/>
<exclude name="int_daisy_filesetEncryptor/**/*.*"/>
<exclude name="uk_rnib_odf2dtbook/**/*.*"/>
<exclude name="se_tpb_speechgenerator/**/*.*"/>
<exclude name="int_daisy_xukCreator/**/*.*"/>
</patternset>
<!-- Util library patternset -->
<patternset id="patternset.util">
<include name="org/daisy/util/**/*.*"/>
</patternset>
<patternset id="patternset.framework">
<include name="**/*.*"/>
<exclude name="org/daisy/util/**/*.*"/>
</patternset>
<!-- Space separated list of required JARs -->
<pathconvert property="property.manifest.jars"
pathsep=" ">
<path refid="path.utilJars"/>
<flattenmapper/>
</pathconvert>
<!-- ================================================================== -->
<!-- Private targets -->
<!-- ================================================================== -->
<!-- - - - - - - - - - - - - - - - - -
target: createDistributionDir
Creates the distribution dirctory.
- - - - - - - - - - - - - - - - - -->
<target name="createDistributionDir">
<mkdir dir="${distribution.dir}"/>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: createJavadocDirs
Creates the distribution dirctory.
- - - - - - - - - - - - - - - - - -->
<target name="createJavadocDirs">
<mkdir dir="${javadoc.dir}"/>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: removeClasses
Cleans up old class files so that the new ones can be built.
- - - - - - - - - - - - - - - - - -->
<target name="removeClasses">
<mkdir dir="${build.dir}"/>
<delete dir="${build.dir}/org">
<fileset dir="${build.dir}" includes="**/*.class"/>
</delete>
<delete>
<fileset dir="${transformers.dir}" includes="**/*.class"/>
</delete>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: compile
Compiles all src classes.
- - - - - - - - - - - - - - - - - -->
<target name="compile" depends="removeClasses">
<mkdir dir="${build.dir}"/>
<javac srcdir="${dmfc.src.dir}"
destdir="${build.dir}"
includes="**/*.java"
debug="true" encoding="UTF-8" target="1.5">
<classpath refid="path.utilJars"/>
</javac>
<javac srcdir="${transformers.dir}"
destdir="${transformers.dir}"
includes="**/*.java"
debug="true" encoding="UTF-8" target="1.5">
<classpath refid="path.build.transformers"/>
</javac>
<copy todir="${build.dir}" failonerror="true" overwrite="false">
<fileset dir="${dmfc.src.dir}">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<!-- ================================================================== -->
<!-- Public targets -->
<!-- ================================================================== -->
<!-- =================================
target: all
Builds a binary release package, source packages and documentation.
================================= -->
<target name="all"
description="Builds a binary release package, source package and documentation."
depends="buildReleaseZip,buildSrcZip,buildJavadoc"/>
<!-- =================================
target: buildSrcZip
Builds a zipfile containing the source distribution.
================================= -->
<target name="buildSrcZip"
description="Builds a zipfile containing the source distribution."
depends="createDistributionDir">
<zip zipfile="${distribution.dir}/${release.name}-src.zip" >
<fileset dir="${base.dir}">
<include name="*.*"/>
<include name="src/**/*.*"/>
<include name="doc/**/*.*"/>
<exclude name="doc/dev_old/**/*.*"/>
<include name="META-INF/**/*.*"/>
<include name="scripts/**/*.*"/>
<include name="licenses/**/*.*"/>
</fileset>
<zipfileset dir="${transformers.dir}" prefix="transformers">
<patternset refid="patternset.transformers"/>
<not>
<filename name="**/*.class"/>
</not>
<not>
<filename name="**/*.exe"/>
</not>
</zipfileset>
</zip>
</target>
<!-- =================================
target: buildJavadoc
================================= -->
<target name="buildJavadoc"
description="Creates three javadoc archives in the distribution folder"
depends="createDistributionDir">
<javadoc destdir="${javadoc.dir}/util"
classpathref="path.combined"
windowtitle="DAISY Utility Library API documentation">
<fileset dir="${base.dir}/src">
<patternset refid="patternset.util"/>
<and>
<filename name="**/*.java"/>
</and>
</fileset>
</javadoc>
<zip zipfile="${distribution.dir}/org.daisy.util-docs-${ISO-TODAY}.zip" >
<fileset dir="${javadoc.dir}/util" includes="**"/>
</zip>
<javadoc destdir="${javadoc.dir}/framework"
classpathref="path.combined"
windowtitle="Daisy Pipeline Framework API documentation">
<fileset dir="${base.dir}/src">
<patternset refid="patternset.framework"/>
<and>
<filename name="**/*.java"/>
</and>
</fileset>
</javadoc>
<zip zipfile="${distribution.dir}/org.daisy.pipeline-framework-docs-${ISO-TODAY}.zip" >
<fileset dir="${javadoc.dir}/framework" includes="**"/>
</zip>
<javadoc destdir="${javadoc.dir}/transformers"
classpathref="path.combined"
windowtitle="Daisy Pipeline Transformer API documentation">
<fileset dir="${base.dir}/transformers">
<patternset refid="patternset.transformers"/>
<and>
<filename name="**/*.java"/>
</and>
</fileset>
</javadoc>
<zip zipfile="${distribution.dir}/org.daisy.pipeline-transformers-docs-${ISO-TODAY}.zip" >
<fileset dir="${javadoc.dir}/transformers" includes="**"/>
</zip>
</target>
<!-- =================================
target: buildUtil
Builds the org.daisy.util.jar utility library
into a separate JAR. The sources are built
into a zip archive.
================================= -->
<target name="buildUtil"
description="Builds the util library in a separate JAR"
depends="createDistributionDir">
<delete file="${distribution.dir}/org.daisy.util.jar"/>
<jar jarfile="${distribution.dir}/org.daisy.util.jar">
<fileset dir="${base.dir}/bin">
<patternset refid="patternset.util"/>
</fileset>
<metainf dir="${base.dir}/META-INF">
<include name="services/**/*.*"/>
</metainf>
<manifest>
<attribute name="Class-Path" value="${property.manifest.jars}"/>
<attribute name="Build-Date" value="${ISO-TODAY}"/>
</manifest>
</jar>
</target>
<!-- =================================
target: buildTransformers
Builds the jarable transformers into separate
JARs.
================================= -->
<target name="buildTransformers"
description="Builds the jarable transformers"
depends="createDistributionDir">
<mkdir dir="${distribution.dir}/transformers"/>
<!-- int_daisy_validator -->
<jar jarfile="${distribution.dir}/transformers/int_daisy_validator.jar">
<fileset dir="${base.dir}/transformers">
<include name="int_daisy_validator/**/*.*"/>
<not>
<filename name="**/*.java"/>
</not>
</fileset>
</jar>
<!-- uk_rnib_dtbook2xhtml -->
<!--jar jarfile="${distribution.dir}/transformers/uk_rnib_dtbook2xhtml.jar">
<fileset dir="${base.dir}/transformers">
<include name="uk_rnib_dtbook2xhtml/**/*.*"/>
<not>
<filename name="**/*.java"/>
</not>
</fileset>
</jar-->
</target>
<!-- =================================
target: buildCoreJar
Builds a jar file containing the pipeline core.
================================= -->
<target name="buildCoreJar"
description="Builds the core JAR"
depends="createDistributionDir, compile">
<jar jarfile="${distribution.dir}/pipeline.jar">
<fileset dir="${base.dir}/bin">
<include name="org/daisy/pipeline/**/*.*"/>
<exclude name="**/*.java"/>
</fileset>
<manifest>
<attribute name="Class-Path" value="lib/org.daisy.util.jar"/>
<attribute name="Build-Date" value="${ISO-TODAY}"/>
</manifest>
</jar>
</target>
<!-- =================================
target: buildJarDist
Builds a zip file containing the jars needed to run the pipeline.
================================= -->
<target name="buildJarDist"
description="Packages the Jars needed to run dmfc"
depends="buildCoreJar, buildUtil">
<zip zipfile="${distribution.dir}/jarpack.zip">
<fileset refid="fileset.utilJars"/>
<fileset dir="${distribution.dir}">
<include name="pipeline.jar"/>
<include name="org.daisy.util.jar"/>
</fileset>
</zip>
</target>
<!-- =====================================================================
target: buildRealeaseZip
Builds a zipfile containing everything needed in a command line release
========================================================================= -->
<target name="buildReleaseZip"
depends="buildCoreJar,buildUtil,createDistributionDir"
description="Builds a zipfile containing everything needed in a command line release">
<zip destfile="${distribution.dir}/${release.name}.zip">
<!-- Pipeline core -->
<zipfileset dir="${distribution.dir}" prefix="${release.name}">
<include name="pipeline.jar"/>
</zipfileset>
<!-- Util library -->
<zipfileset dir="${distribution.dir}" prefix="${release.name}/lib">
<include name="org.daisy.util.jar"/>
</zipfileset>
<!-- Required JARs -->
<zipfileset refid="fileset.utilJars" prefix="${release.name}/lib"/>
<!-- Transformers -->
<zipfileset refid="fileset.transformers" prefix="${release.name}/transformers"/>
<!-- Property files -->
<zipfileset dir="${base.dir}/bin" prefix="${release.name}">
<include name="pipeline.properties"/>
<include name="pipeline.user.properties"/>
</zipfileset>
<!-- Pipeline RMI files -->
<zipfileset dir="${base.dir}/rmi" prefix="${release.name}/rmi">
<include name="**/*.*"/>
</zipfileset>
<!-- Shell scripts -->
<zipfileset dir="${base.dir}/launchers" prefix="${release.name}" filemode="755">
<include name="pipeline.sh"/>
<include name="pipeline.bat"/>
</zipfileset>
<!-- Scripts -->
<zipfileset dir="${base.dir}/scripts" prefix="${release.name}/scripts">
<include name="**/*.*"/>
<exclude name="_dev/**/*.*"/>
</zipfileset>
<!-- Documentation -->
<zipfileset dir="${base.dir}/doc" prefix="${release.name}/doc">
<include name="developer/**/*.*"/>
<include name="enduser/**/*.*"/>
<include name="scripts/**/*.*"/>
<include name="transformers/**/*.*"/>
<include name="*.html"/>
<include name="*.css"/>
</zipfileset>
<!-- Documentation -->
<zipfileset dir="${base.dir}/licenses" prefix="${release.name}/licenses">
<include name="**/*.*"/>
</zipfileset>
</zip>
</target>
</project>