forked from crosswire/jsword
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathcore.xml
456 lines (421 loc) · 20.3 KB
/
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
<project name="core" default="all">
<!--=======================================================================
== To make eclipse recognise this file as an ant file, go to preferences,
== ant and add core.xml to the "Names" field, and then under Workbench,
== "File Associations" add a type "core.xml" with ant as the editor.
=========================================================================-->
<!--=======================================================================
== These are the standard locations that this build file uses.
== This assumes that the build file is in the root of the project.
=========================================================================-->
<property name="release.version" value="1.6"/>
<property name="source.root" value="src"/>
<property name="source.etc" value="etc"/>
<property name="source.jar" value="jar"/>
<property name="source.java" value="${source.root}/main/java"/>
<property name="source.res" value="${source.root}/main/resources"/>
<property name="source.test" value="${source.root}/test"/>
<property name="target.root" value="target"/>
<property name="target.classes" value="${target.root}/classes"/>
<property name="target.jar" value="lib"/>
<property name="target.installed" value="${target.root}/installed"/> <!-- override -->
<property name="test.root" value="${target.root}/test"/>
<property name="test.classes" value="${test.root}/classes"/>
<property name="test.jar" value="${test.root}"/>
<property name="keystore.devfile" value="../jsword/crosswire.keystore"/>
<property name="keystore.file" value="${keystore.devfile}"/>
<property name="keystore.alias" value="jsword"/>
<property name="keystore.pswd" value="p455w0rd"/>
<available file="${source.jar}" type="dir" property="jardir.present"/>
<available file="${source.res}" type="dir" property="resdir.present"/>
<property name="verbose.copy" value="false"/>
<!--=======================================================================
== These jars are built by the various JSword projects.
== It excludes jsword-common-aqua which is treated as an external jar.
=========================================================================-->
<patternset id="internal.built.jars">
<include name="**/bibledesktop-${release.version}.jar"/>
<include name="**/jsword-${release.version}.jar"/>
<include name="**/jsword-common-swing-${release.version}.jar"/>
<include name="**/jsword-${release.version}.jar"/>
</patternset>
<!--=======================================================================
== These jars are necessary for Bible Desktop to be compiled and run.
== The version numbers in jar files is replaced w/ *.
== Note: This only includes files not managed via ivy/maven.
== This way we can upgrade without impacting this ant build file.
=========================================================================-->
<patternset id="external.runtime.jars">
<exclude name="**/*-src.jar"/>
<exclude name="**/*-sources.jar"/>
<exclude name="**/activation*.jar"/>
<exclude name="**/junit*.jar"/>
<include name="**/*.jar"/>
</patternset>
<!--=======================================================================
== This is a path to all of the jars in the target.jar directory
=========================================================================-->
<path id="runtime.jarpath">
<fileset dir="${target.jar}" includes="*.jar"/>
</path>
<!--=======================================================================
== This is a path to all of the jars in the target.jar directory
=========================================================================-->
<path id="test.jarpath">
<fileset dir="${target.jar}" includes="*.jar"/>
<fileset dir="../jsword/jar" includes="**/junit*.jar"/>
</path>
<!--=======================================================================
== This is a path to all non-test source directories.
== These are the ones without "test" in their names.
=========================================================================-->
<patternset id="java.compile">
<include name="**/*.java"/>
</patternset>
<path id="source.path">
<dirset dir="${source.java}" includes="*"/>
</path>
<!--=======================================================================
== This is a path to all test source directories.
== These are the ones with "test" in their names.
=========================================================================-->
<path id="testsource.path">
<dirset dir="${source.test}" includes="*"/>
</path>
<!--=======================================================================
== These are the non-java resource files
== that may appear along side of java files.
=========================================================================-->
<patternset id="java.non.compile">
<include name="**/*"/>
<exclude name="**/*.html"/>
<exclude name="**/*.java"/>
<exclude name="**/*.class"/>
</patternset>
<!--=======================================================================
== These are local copies of DTDs used by ant xslt/style.
== This is necessary to prevent HTTPD 503 responses
== and it is useful to speed up the build.
=========================================================================-->
<xmlcatalog id="commonDTDs">
<dtd
publicId="-//W3C//DTD XHTML 1.0 Strict//EN"
location="../jsword/etc/dtdcatalog/xhtml1-strict.dtd"/>
<dtd
publicId="-//W3C//DTD XHTML 1.0 Transitional//EN"
location="../jsword/etc/dtdcatalog/xhtml1-transitional.dtd"/>
</xmlcatalog>
<!--=======================================================================
== Mark this build with the current timestamp
=========================================================================-->
<target name="init"
description="Prepare for other tasks">
<echo message="Initializing ${ant.project.name}"/>
<tstamp/>
</target>
<!--=======================================================================
== Clean the intermediate files and build everything, test it and
== then install it.
=========================================================================-->
<target name="all"
depends="clean, incremental"
description="Run a full clean/build/test/install cycle">
</target>
<!--=======================================================================
== Build everything that has changed, test it and then install the changes.
=========================================================================-->
<target name="incremental"
depends="build, install"
description="Run a build/test/install cycle">
<!-- broken right now: test, -->
</target>
<!--=======================================================================
== Clean the intermediate files.
== Also invoke a clean on any dependencies, if any.
=========================================================================-->
<target name="clean"
depends="init, clean.dependency"
description="Remove the target directory">
<delete dir="${target.root}"/>
<delete dir="${target.jar}"/>
<antcall target="clean.extra"/>
</target>
<!--=======================================================================
== Do any other needed work after clean.
== By overriding this target in the importing ant build file,
== it will allow for the definition of any other post clean activities.
=========================================================================-->
<target name="clean.extra"
description="Extra stuff to do after calling clean"/>
<!--=======================================================================
== Invoke a clean on any dependencies, if any.
== This target requires the "dependency" property to be set by
== the importing ant build file.
=========================================================================-->
<target name="clean.dependency"
if="dependency"
description="Clean the dependencies">
<echo message="Clean project dependency first: ${dependency}."/>
<ant dir="../${dependency}" target="clean" inheritAll="false"/>
</target>
<!--=======================================================================
== Build all the non-test java files into class files and
== create a jar file for the project with the name project.jar,
== where project is replaced with the name of the project.
== This jar is built to the target.jar directory.
== But first invoke a build on any dependencies, if any.
==
== Also build all test java files into class files in their own directory.
=========================================================================-->
<target name="build"
depends="compile, jar.check"
unless="jar.uptodate"
description="Run a full build">
<jar jarfile="${target.jar}/${ant.project.name}-${release.version}.jar">
<fileset dir="${target.classes}"/>
</jar>
</target>
<target name="jar.check">
<uptodate property="jar.uptodate"
targetfile="${target.jar}/${ant.project.name}-${release.version}.jar">
<srcfiles dir="${target.classes}"/>
</uptodate>
<echo message="jar.uptodate result: ${jar.uptodate}"/>
</target>
<!--=======================================================================
== Invoke a clean on any dependencies, if any.
== This target requires the "dependency" property to be set by
== the importing ant build file.
=========================================================================-->
<target name="build.dependency"
if="dependency"
description="Build the dependencies">
<echo message="Build project dependency first: ${dependency}."/>
<ant dir="../${dependency}" target="build" inheritAll="false"/>
</target>
<!--=======================================================================
== Build all test java files into class files in their own directory.
== But first invoke a testbuild on any dependencies, if any.
==
=========================================================================-->
<target name="test"
depends="test.dependency, testcompile, test.suite"
description="Run a full test build"/>
<target name="test.suite"
description="Run a full test suite"/>
<!--=======================================================================
== Invoke a test on any dependencies, if any.
== This target requires the "dependency" property to be set by
== the importing ant build file.
=========================================================================-->
<target name="test.dependency"
if="dependency"
description="Build the test dependencies">
<echo message="Build project test dependency first: ${dependency}."/>
<ant dir="../${dependency}" target="test" inheritAll="false"/>
</target>
<!--=======================================================================
== Copy all the local 3rd party jars to a single locaton.
=========================================================================-->
<target name="prepare.jars"
if="jardir.present">
<!-- Copy the jars from the std location to the target jar directory -->
<mkdir dir="${target.jar}"/>
<copy verbose="${verbose.copy}" todir="${target.jar}" flatten="true" preservelastmodified="true">
<fileset dir="${source.jar}">
<patternset refid="external.runtime.jars"/>
</fileset>
</copy>
</target>
<!--=======================================================================
== Copy all the resources to a single locaton.
=========================================================================-->
<target name="prepare.resources"
if="resdir.present">
<!-- Copy the resources from the std location to the target classes directory -->
<mkdir dir="${target.classes}"/>
<copy verbose="${verbose.copy}" todir="${target.classes}" flatten="false" failonerror="false" preservelastmodified="true">
<fileset dir="${source.res}" includes="**"/>
</copy>
</target>
<!--=======================================================================
== Copy all the local and external 3rd party jars to a single locaton.
== Also copy the resources to ${target.classes}
== Calls prepare.dependency.
=========================================================================-->
<target name="prepare"
depends="build.dependency, prepare.jars, prepare.resources"
description="Prepare the build by copying needed jars and files.">
<!-- Copy the jars from the std location to the target jar directory -->
<antcall target="prepare.dependency"/>
<antcall target="prepare.extra"/>
</target>
<!--=======================================================================
== Copy external jars of dependent projects, if any.
== This target requires the "dependency.jar" property to be set by
== the importing ant build file.
=========================================================================-->
<target name="prepare.dependency"
if="dependency.jar"
description="Prepare this build from the dependency.">
<mkdir dir="${target.jar}"/>
<copy verbose="${verbose.copy}" todir="${target.jar}" flatten="true" preservelastmodified="true">
<fileset dir="${dependency.jar}">
<include name="**/*.jar"/>
<exclude name="**/*-sources.jar"/>
</fileset>
</copy>
</target>
<!--=======================================================================
== Do any other needed preparation.
== By overriding this target in the importing ant build file,
== it will allow for the definition of any other needed preparation.
=========================================================================-->
<target name="prepare.extra"
description="Prepare extras files.">
<echo message="${ant.project.name} has no extra files to prepare."/>
</target>
<!--=======================================================================
== Compile all the java files under source.path into class files.
== Make sure that all the resources in those directories make it over too.
=========================================================================-->
<target name="compile"
depends="prepare, compile.check"
unless="source.uptodate"
description="Compile the source">
<mkdir dir="${target.classes}"/>
<javac debug="on"
includes="**/*.java"
destdir="${target.classes}"
includeantruntime="false"
source="1.5">
<src refid="source.path"/>
<classpath refid="runtime.jarpath"/>
</javac>
<!-- Copy the adjacent property files to the proper org/crosswire directory.
== The path separator could be either / or \
-->
<copy verbose="${verbose.copy}"
todir="${target.classes}"
includeEmptyDirs="false"
preservelastmodified="true">
<fileset dir="${source.java}">
<patternset refid="java.non.compile"/>
</fileset>
</copy>
<antcall target="compile.extra"/>
</target>
<target name="compile.check">
<uptodate property="source.uptodate"
targetfile="${target.jar}/${ant.project.name}-${release.version}.jar">
<srcfiles dir="${source.java}"/>
<srcfiles dir="${source.root}" includes="resources/**/*.*"/>
</uptodate>
<echo message="source.uptodate result: ${source.uptodate}"/>
</target>
<!--=======================================================================
== Do any other needed compilation.
== By overriding this target in the importing ant build file,
== it will allow for the definition of any other post compilation,
== pre jar activities.
=========================================================================-->
<target name="compile.extra"
description="Compile extras files."/>
<!--=======================================================================
== Compile all the test java files under testsource.path into class files.
== Make sure that all the resources in those directories make it over too.
== At this time a project-test.jar is not being created.
==
== This depends upon build having been completed, but we don't have the
== depends="build" here as an optimization.
=========================================================================-->
<target name="testcompile"
description="Compile the test source">
<mkdir dir="${test.classes}"/>
<javac debug="on"
includes="**/*.java"
destdir="${test.classes}"
source="1.5">
<src refid="testsource.path"/>
<classpath refid="test.jarpath"/>
</javac>
<antcall target="testcompile.extra"/>
</target>
<!--=======================================================================
== Do any other needed test compilation.
== By overriding this target in the importing ant build file,
== it will allow for the definition of any other post compilation.
=========================================================================-->
<target name="testcompile.extra"
description="Compile extras test files."/>
<!--=======================================================================
== Install the built artifacts.
== By overriding this target in the importing ant build file,
== it will allow for the definition of any other needed work.
=========================================================================-->
<target name="install"
depends="install.dependency"
description="Install the built project."/>
<!--=======================================================================
== Invoke an install on any dependencies, if any.
== This target requires the "dependency" property to be set by
== the importing ant build file.
=========================================================================-->
<target name="install.dependency"
if="dependency"
description="Clean the dependencies">
<echo message="Install project dependency first: ${dependency}."/>
<ant dir="../${dependency}"
target="install"
inheritAll="false"/>
</target>
<!--=======================================================================
== A keystore is needed to sign jars.
== It does not need to be build very often and can be shared.
=========================================================================-->
<target name="keygen"
depends="keygen.check"
unless="keygen.uptodate"
description="Generates a key for use in signing the JARs">
<echo message="Generating keystore for signing jars"/>
<genkey alias="${keystore.alias}"
storepass="${keystore.pswd}"
keystore="${keystore.devfile}">
<dname>
<param name="CN" value="JSword Project"/>
<param name="OU" value="Test Builds"/>
<param name="O" value="Crosswire.org"/>
<param name="C" value="UK" />
</dname>
</genkey>
</target>
<target name="keygen.check"
description="Check the keystore is there">
<available
property="keygen.uptodate"
file="${keystore.devfile}"/>
</target>
<!--=======================================================================
== A handy target that can be useful for testing various things. Designed
== to be hacked about before it is run. The main class is done as a property
== so it can be overridden from outside if needed. Main classes that have
== proved useful include:
== org.crosswire.jsword.bibledesktop.Desktop
== org.crosswire.jsword.book.ReadEverything
== abbot.editor.Costello
== org.acm.seguin.tools.install.PrettyPrinterConfigGUI
=========================================================================-->
<property name="exec.main"
value="org.crosswire.bibledesktop.desktop.Desktop"/>
<target name="exec"
description="Test execution">
<java classname="${exec.main}"
fork="true">
<assertions enablesystemassertions="true">
<enable/>
</assertions>
<jvmarg value="-Xmx512m"/>
<classpath refid="runtime.jarpath"/>
</java>
</target>
</project>