forked from solrmarc/solrmarc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
593 lines (546 loc) · 28.7 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
<project name="SolrMarc" default="jar" basedir=".">
<description>
A total rewrite of the SolrMarc project
</description>
<!-- load global properties for this build -->
<property file="build.properties" />
<!-- import other ant scripts -->
<import file="${buildtools.dir}/parser_tasks.xml" optional="false" />
<import file="${buildtools.dir}/ant_extras.xml" optional="false" />
<property name="cobertura.dir" value="${test.dir}/lib/cobertura-2.1.1" />
<path id="cobertura.classpath">
<fileset dir="${cobertura.dir}">
<include name="cobertura-2.1.1.jar" />
<include name="lib/**/*.jar" />
</fileset>
</path>
<taskdef classpathref="cobertura.classpath" resource="tasks.properties" />
<tstamp>
<format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss Z" timezone="GMT" />
</tstamp>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build.dir}"/>
</target>
<target name="precompile" unless="precompile.already.run" description="run jflex and cup to generate javafiles for parser and scanner"
depends="-precompile-cup,-precompile-flex" >
<depend srcDir="${src.dir}" destDir="${build.dir}" closure="true" />
<property name="precompile.already.run" value="true" />
</target>
<!-- start private targets to help with the precompile step -->
<target name="-precompile-flex" unless="flex.uptodate" depends="-precompile-flex-check" >
<jflex file="${src.dir}/org/solrmarc/index/indexer/FullScanner.lex" verbose="true"
outdir="${src.dir}/org/solrmarc/index/indexer/" nobak="true" />
<copy file="${src.dir}/org/solrmarc/index/indexer/FullConditionalScanner.java"
tofile="${src.dir}/org/solrmarc/index/indexer/FullConditionalScanner.java.new" >
<filterset begintoken="private boolean " endtoken=" = true;" recurse="no">
<filter token="zzAtBOL"
value="@SuppressWarnings("unused") private boolean zzAtBOL = true;" />
</filterset>
</copy>
<move file="${src.dir}/org/solrmarc/index/indexer/FullConditionalScanner.java.new"
tofile="${src.dir}/org/solrmarc/index/indexer/FullConditionalScanner.java"/>
</target>
<target name="-precompile-flex-check" >
<uptodate property="flex.uptodate"
srcfile="${src.dir}/org/solrmarc/index/indexer/FullScanner.lex"
targetfile="${src.dir}/org/solrmarc/index/indexer/FullConditionalScanner.java"/>
</target>
<target name="-precompile-cup" unless="cup.uptodate" depends="-precompile-cup-check" >
<cup srcfile="${src.dir}/org/solrmarc/index/indexer/FullConditionalParser.cup"
destdir="${src.dir}"
package="org.solrmarc.index.indexer"
symbols="FullSym"
parser="FullConditionalParser"
/>
<copy file="${src.dir}/org/solrmarc/index/indexer/FullConditionalParser.java"
tofile="${src.dir}/org/solrmarc/index/indexer/FullConditionalParser.java.new" >
<filterset begintoken="({" endtoken="})" recurse="no">
<filter token=""rawtypes""
value="({"rawtypes", "unused", "unchecked", "deprecation"})" />
<filter token=""rawtypes", "unchecked", "unused"" value="({})" />
</filterset>
</copy>
<move file="${src.dir}/org/solrmarc/index/indexer/FullConditionalParser.java.new"
tofile="${src.dir}/org/solrmarc/index/indexer/FullConditionalParser.java"/>
</target>
<target name="-precompile-cup-check" >
<uptodate property="cup.uptodate"
srcfile="${src.dir}/org/solrmarc/index/indexer/FullConditionalParser.cup"
targetfile="${src.dir}/org/solrmarc/index/indexer/FullConditionalParser.java"/>
</target>
<!-- end private targets to help with the precompile step -->
<target name="compile" depends="init,precompile" unless="compile.already.run" description="compile the source">
<!-- Compile the java code from ${src} into ${build} -->
<javac target="${java.compat.version}" source="${java.compat.version}" srcdir="${src.dir}" destdir="${build.dir}"
includeantruntime="false" debug="true" debuglevel="lines,vars,source" updatedProperty="javac_compiled_some" encoding="UTF-8" >
<classpath >
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</classpath>
<classpath >
<fileset dir="${lib.solrj.dir}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
<property name="compile.already.run" value="true" />
</target>
<!-- <target name="-version1" unless="version" >
<mkdir dir="${reports.tests}" />
<get src="https://api.github.com/repos/solrmarc/solrmarc/releases/latest" dest="${reports.tests}/git.release.txt" />
<loadfile srcfile="${reports.tests}/git.release.txt" property="versionstr" >
<filterchain>
<tokenfilter>
<replacestring from="," to=",${line.separator}" />
</tokenfilter>
<linecontains>
<contains value="tag_name"/>
</linecontains>
<tokenfilter>
<replaceregex pattern=".*"tag_name":[ ]*"v([0-9.]*).*" replace="\1" />
</tokenfilter>
<striplinebreaks/>
</filterchain>
</loadfile>
<echo message="versionstr = ${versionstr}" />
</target>
<target name="-version2" unless="version" >
<get src="https://api.github.com/repos/solrmarc/solrmarc/compare/v${versionstr}...master" dest="${reports.tests}/git.commits.txt" />
<loadfile srcfile="${reports.tests}/git.commits.txt" property="versionsuffix" >
<filterchain>
<tokenfilter>
<replacestring from="," to=", ${line.separator}" />
</tokenfilter>
<linecontains>
<contains value="total_commits"/>
</linecontains>
<striplinebreaks/>
<tokenfilter>
<replaceregex pattern=".*"total_commits":[ ]*([1-9][0-9]*).*" replace="-SNAPSHOT-\1" />
<replaceregex pattern=".*"total_commits":[ ]*(0).*" replace="" />
</tokenfilter>
</filterchain>
</loadfile>
<echo message="versionsuffix = ${versionsuffix}" />
<property name="versionsuffix" value="" />
<echo message="versionsuffix = ${versionsuffix}" />
</target>
<target name="version" unless="version" depends="-version1,-version2" description="Get the version number to use from github" >
<property name="version" value="${versionstr}${versionsuffix}" />
<echo message="version = ${version}" />
</target>
-->
<target name="-version1" unless="version" >
<mkdir dir="${dist.dir}/tmp" />
<get src="https://api.github.com/repos/marc4j/marc4j/releases/latest" dest="${dist.dir}/tmp/git.release.txt" />
<loadfile srcfile="${dist.dir}/tmp/git.release.txt" property="versionstr" >
<filterchain>
<tokenfilter>
<replacestring from="," to=",${line.separator}" />
</tokenfilter>
<linecontains>
<contains value="tag_name"/>
</linecontains>
<tokenfilter>
<replaceregex pattern=".*"tag_name":[ ]*"v([0-9.]*).*" replace="\1" />
</tokenfilter>
<striplinebreaks/>
</filterchain>
</loadfile>
<loadresource property="specversion">
<propertyresource name="versionstr"/>
<filterchain>
<tokenfilter>
<filetokenizer/>
<replaceregex pattern="[.][0-9]*$" replace=""/>
</tokenfilter>
</filterchain>
</loadresource>
<echo message="specversion = ${specversion}" />
<echo message="versionstr = ${versionstr}" />
</target>
<target name="-version2" unless="version" >
<get src="https://api.github.com/repos/marc4j/marc4j/compare/${versionstr}...master" dest="${dist.dir}/tmp/git.commits.txt" />
<loadfile srcfile="${dist.dir}/tmp/git.commits.txt" property="versionsuffix" >
<filterchain>
<tokenfilter>
<replacestring from="," to=", ${line.separator}" />
</tokenfilter>
<linecontains>
<contains value="total_commits"/>
</linecontains>
<striplinebreaks/>
<tokenfilter>
<replaceregex pattern=".*"total_commits":[ ]*([1-9][0-9]*).*" replace="-\1-SNAPSHOT" />
<replaceregex pattern=".*"total_commits":[ ]*(0).*" replace="" />
</tokenfilter>
</filterchain>
</loadfile>
<echo message="versionsuffix = ${versionsuffix}" />
<property name="versionsuffix" value="" />
<echo message="versionsuffix = ${versionsuffix}" />
<!-- <delete dir="${dist.dir}/tmp" /> -->
</target>
<available file=".git" type="dir" property="git.present"/>
<target name="git.revision" description="Store git revision in ${repository.version}" if="git.present" unless="version">
<property environment="env"/>
<exec executable="git" outputproperty="git.revision" failifexecutionfails="false" errorproperty="git.not.found">
<arg value="describe"/>
<arg value="--tags"/>
<arg value="--dirty=-SNAPSHOT"/>
<arg value="--always"/>
</exec>
<exec executable="git" outputproperty="git.major.revision" failifexecutionfails="false" errorproperty="git.not.found">
<arg value="describe"/>
<arg value="--tags"/>
<arg value="--abbrev=0"/>
</exec>
<condition property="vversion" value="${git.revision}">
<and>
<isset property="git.revision"/>
<length string="${git.revision}" trim="yes" length="0" when="greater"/>
</and>
</condition>
<condition property="vversionstr" value="${git.major.revision}">
<and>
<isset property="git.major.revision"/>
<length string="${git.major.revision}" trim="yes" length="0" when="greater"/>
</and>
</condition>
<propertyregex property="version" input="${vversion}" regexp="v?([0-9].*)" select="\1" casesensitive="false" />
<propertyregex property="versionstr" input="${vversionstr}" regexp="v?([0-9].*)" select="\1" casesensitive="false" />
</target>
<target name="version" depends="git.revision,-version1,-version2" description="Get the version number to use from github" >
<echo message="git.revision = ${git.revision}" />
<property name="version" value="${versionstr}${versionsuffix}" />
<echo message="version = ${version}" />
<condition property="is.snapshot">
<contains string="${version}" substring="SNAPSHOT" />
</condition>
<echo message="is.snapshot = ${is.snapshot}" />
<property name="jar.name" value="${project.name}-${version}.jar" />
<property name="jar.sources.name" value="${project.name}-${version}-sources.jar" />
<property name="jar.javadoc.name" value="${project.name}-${version}-javadoc.jar" />
<property name="test.jar.name" value="${project.name}_test-${version}.jar" />
</target>
<target name="jar" depends="compile,version" unless="jar.already.run" description="Build custom jar file containing custom code" >
<mkdir dir="${dist.dir}" />
<path id="libjarfiles" >
<fileset dir="${lib.dir}" includes="*.jar" />
</path>
<copy todir="${dist.lib.dir}" flatten="true">
<path refid="libjarfiles"/>
</copy>
<jar destfile="${dist.dir}/${custom.jar.name}_${version}.jar">
<manifest>
<attribute name="Main-Class" value="org.solrmarc.driver.Boot"/>
<attribute name="Version" value="${version}"/>
<attribute name="Built-Date" value="${TODAY}"/>
</manifest>
<fileset dir="${build.dir}" includes="**/*.class" />
</jar>
<echo message="jar built" />
<property name="jar.already.run" value="true" />
</target>
<target name="test-compile" depends="jar" description="compile the source of tests" unless="test.already.compiled" >
<!-- Compile the java code from ${src} into ${build} -->
<mkdir dir="${test.build.dir}" />
<javac target="${java.compat.version}" source="${java.compat.version}" srcdir="${test.src.dir}" destdir="${test.build.dir}"
includeantruntime="false" debug="true" debuglevel="lines,vars,source" encoding="UTF-8" >
<classpath id="test.classpath">
<fileset dir="${dist.dir}">
<include name="${custom.jar.name}_${version}.jar"/>
</fileset>
<fileset dir="${dist.lib.dir}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${lib.solrj.dir}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${test.dir}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${test.dir}/data/lib_local">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
<jar destfile="${test.build.dir}/${custom.jar.name}_tests.jar">
<manifest>
<attribute name="Built-Date" value="${TODAY}"/>
</manifest>
<fileset dir="${test.build.dir}" includes="**/*.class" />
</jar>
<property name="test.already.compiled" value="true" />
</target>
<target name="mixin-compile" depends="jar" description="compile the source of tests" unless="mixin.already.compiled" >
<!-- Compile the java code from ${src} into ${build} -->
<mkdir dir="${test.dir}/data/index_java/bin" />
<javac target="${java.compat.version}" source="${java.compat.version}" srcdir="${test.dir}/data/index_java/src" destdir="${test.dir}/data/index_java/bin"
includeantruntime="false" debug="true" debuglevel="lines,vars,source" encoding="UTF-8" >
<classpath id="test.classpath">
<fileset dir="${dist.dir}">
<include name="${custom.jar.name}_${version}.jar"/>
</fileset>
<fileset dir="${dist.lib.dir}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${lib.solrj.dir}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${test.dir}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${test.dir}/data/lib_local">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
<property name="mixin.already.compiled" value="true" />
</target>
<target name="test" depends="test-compile,mixin-compile" unless="test.already.run" description="run junit tests" >
<mkdir dir="${reports.tests}" />
<junit printsummary="yes" haltonfailure="false">
<classpath>
<fileset dir="${dist.dir}">
<include name="${custom.jar.name}_${version}.jar"/>
</fileset>
<fileset dir="${dist.dir}/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${test.dir}/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${test.build.dir}">
<include name="${custom.jar.name}_tests.jar"/>
</fileset>
<fileset dir="${lib.solrj.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${test.dir}/data/lib_local">
<include name="**/*.jar"/>
</fileset>
<pathelement location="${build}"/>
<pathelement location="${build.tests}"/>
<pathelement path="${java.class.path}"/>
</classpath>
<sysproperty key="test.data.dir" path="${test.dir}/data" />
<sysproperty key="log4j.debug" value="false" />
<formatter type="plain"/>
<batchtest fork="yes" todir="${reports.tests}">
<fileset dir="${test.src.dir}">
<include name="**/*Test*.java"/>
<exclude name="**/ConditionalParserTest.java" />
</fileset>
</batchtest>
</junit>
<property name="test.already.run" value="true" />
</target>
<target name="-coverage-init" unless="already.instrumented" >
<property name="cobertura.datafile" value="${test.dir}/data/cobertura.ser" />
<property name="tmp.cobertura.datafile" value="${instrumented.dir}/cobertura.ser" />
<mkdir dir="${instrumented.dir}" />
<delete file="${cobertura.datafile}" />
<property name="cobertura.jar.dir" location="${test.dir}/lib/cobertura-2.1.1/" />
<path id="cobertura.classpath">
<fileset dir="${cobertura.jar.dir}" includes="**/*.jar" />
<fileset dir="${lib.dir}" includes="**/*.jar" />
</path>
</target>
<target name="-coverage-instrument-check" unless="already.instrumented" depends="-coverage-init" >
<condition property="already.instrumented" >
<and>
<uptodate>
<srcfiles dir="${basedir}" includes="build/**/*.class" >
<exclude name="**/callnum/CallNumber.class" />
<exclude name="**/custom/Mixin.class" />
<exclude name="**/extractor/AbstractValueExtractor.class" />
<exclude name="**/extractor/ExternalMethod.class" />
<exclude name="**/formatter/FieldFormatter.class" />
<exclude name="**/mapping/AbstractValueMapping.class" />
</srcfiles>
<globmapper from="build/*" to="${instrumented.dir}/*" handledirsep="true"/>
</uptodate>
<available file="${tmp.cobertura.datafile}" />
</and>
</condition>
<echo message="already.instrumented=${already.instrumented}" />
</target>
<target name="-coverage-instrument" unless="already.instrumented" depends="-coverage-instrument-check" >
<pathconvert property="marcLib" >
<fileset dir="${lib.dir}" includes="marc4j-*.jar" />
</pathconvert>
<pathconvert property="javaCupLib" >
<fileset dir="${lib.dir}" includes="java-cup-*-runtime.jar" />
</pathconvert>
<pathconvert property="classGraphLib" >
<fileset dir="${lib.dir}" includes="classgraph-*.jar" />
</pathconvert>
<cobertura-instrument todir="${instrumented.dir}" datafile="${tmp.cobertura.datafile}" ignoreTrivial="true" >
<ignore regex="org.apache.log4j.*|ch.qos.logback.*" />
<fileset dir="${build.dir}">
<include name="**/*.class" />
</fileset>
<auxClasspath path="${marcLib};${javaCupLib};${classGraphLib}" />
</cobertura-instrument>
<property name="already.instrumented" value="true" />
</target>
<target name="-coverage-init2" unless="already.coverage.init2" >
<copy file="${tmp.cobertura.datafile}" tofile="${cobertura.datafile}" />
<property name="already.coverage.init2" value="true" />
</target>
<target name="-coverage-junit" depends="-coverage-instrument,-coverage-init2" >
<!-- <property name="testcase" value="org.solrmarc.index.UtilsTests" /> -->
<junit fork="yes" dir="${basedir}" failureProperty="test.failed">
<!--
Specify the name of the coverage data file to use.
The value specified below is the default.
-->
<sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile}" />
<!--
Note the classpath order: instrumented classes are before the
original (uninstrumented) classes. This is important.-->
<classpath location="${instrumented.dir}" />
<classpath location="${build.dir}" />
<classpath>
<fileset dir="${test.dir}/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${test.build.dir}">
<include name="${custom.jar.name}_tests.jar"/>
</fileset>
<fileset dir="${lib.solrj.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${test.dir}/data/lib_local">
<include name="**/*.jar"/>
</fileset>
<pathelement location="${build}"/>
<pathelement location="${build.tests}"/>
<pathelement path="${java.class.path}"/>
</classpath>
<!--
The instrumented classes reference classes used by the
Cobertura runtime, so Cobertura and its dependencies
must be on your classpath.
-->
<classpath refid="cobertura.classpath" />
<sysproperty key="test.data.dir" path="${test.dir}/data" />
<sysproperty key="log4j.debug" value="false" />
<formatter type="xml" />
<test name="${testcase}" todir="${reports.tests}" if="testcase" />
<batchtest todir="${reports.tests}" unless="testcase">
<fileset dir="${test.src.dir}">
<include name="**/*Test*.java" />
<exclude name="**/ConditionalParserTest.java" />
</fileset>
</batchtest>
</junit>
</target>
<!-- this test runs SolrMarc in single threaded mode on a largeish input file, writing the output to a file.
it then runs SolrMarc in multi-threaded mode on the same input, writing the output to a different file.
next it sorts the two files, and compares the results, if the results are not equal, there is a problem
somewhere in the program. -->
<target name="-coverage-main" depends="-coverage-instrument,-coverage-init2" >
<echo message="Run SolrMarc in Single-threaded mode" />
<java classname="org.solrmarc.driver.Boot" fork="yes" output="${reports.tests}/output.singlethread.txt" error="${reports.tests}/stderr.singlethread.txt" >
<classpath location="${instrumented.dir}" />
<classpath location="${build.dir}" />
<classpath refid="cobertura.classpath" />
<sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile}" />
<arg line="IndexDriver -dir ${test.dir}/data -c blacklight_index.properties -debug -u stdout ${test.dir}/data/records/uva_001-200.mrc ${test.dir}/data/records/specTestRecs.xml "/>
<!-- <arg line="IndexDriver -dir ${test.dir}/data -c blacklight_index.properties -debug -u stdout ${test.dir}/data/records/u60.mrc "/> -->
</java>
<echo message="Run SolrMarc in Multi-threaded mode" />
<java classname="org.solrmarc.driver.Boot" fork="yes" output="${reports.tests}/output.multithread.txt" error="${reports.tests}/stderr.multithread.txt" >
<classpath location="${instrumented.dir}" />
<classpath location="${build.dir}" />
<classpath refid="cobertura.classpath" />
<sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile}" />
<sysproperty key="solrmarc.indexer.threadcount" value="4" />
<sysproperty key="solrmarc.indexer.chunksize" value="50" />
<arg line="IndexDriver -dir ${test.dir}/data -c blacklight_index.properties -u stdout ${test.dir}/data/records/uva_001-200.mrc ${test.dir}/data/records/specTestRecs.xml" />
<!-- <arg line="IndexDriver -dir ${test.dir}/data -c blacklight_index.properties -u stdout ${test.dir}/data/records/u60.mrc" /> -->
</java>
<echo message="Sort the output files" />
<copy file="${reports.tests}/output.singlethread.txt" tofile="${reports.tests}/output.singlethread.sort.txt">
<filterchain>
<sortfilter/>
</filterchain>
</copy>
<copy file="${reports.tests}/output.multithread.txt" tofile="${reports.tests}/output.multithread.sort.txt">
<filterchain>
<sortfilter/>
</filterchain>
</copy>
<condition property="multithreadworked" value="true" else="false">
<filesmatch file1="${reports.tests}/output.singlethread.sort.txt"
file2="${reports.tests}/output.multithread.sort.txt"/>
</condition>
<echo message="multithread = ${multithreadworked}" />
</target>
<target name="coverage" depends="jar,test-compile,-coverage-instrument,-coverage-junit,-coverage-main"
description="run tests to determine code coverage" >
<mkdir dir="${reports.tests}/coverage" />
<cobertura-report format="html" destdir="${reports.tests}/coverage" srcdir="${src.dir}" datafile="${cobertura.datafile}"/>
<cobertura-report format="xml" destdir="${reports.tests}/coverage" srcdir="${src.dir}" datafile="${cobertura.datafile}"/>
</target>
<target name="package" depends="jar, test" description="create the build targets for a release" >
<echo message="Building required jars zip file" />
<delete file="${dist.dir}/required_jars_${version}.zip" />
<delete file="${dist.dir}/simple_install_package_${version}.zip" />
<zip file="${dist.dir}/required_jars_${version}.zip" >
<zipfileset dir="${dist.dir}/lib" prefix="lib" includes="*.jar" />
</zip>
<echo message="Building simple install package zip file" />
<copy file="${buildtools.dir}/install_template/how_to_run.txt" tofile="${dist.dir}/how_to_run.txt" overwrite="true" >
<filterchain>
<expandproperties/>
</filterchain>
</copy>
<zip file="${dist.dir}/simple_install_package_${version}.zip" >
<zipfileset dir="${dist.dir}" prefix="" includes="${custom.jar.name}_${version}.jar" />
<zipfileset dir="${buildtools.dir}/install_template" prefix="" includes="**" excludes="how_to_run.txt"/>
<zipfileset dir="${dist.dir}" prefix="" includes="how_to_run.txt" />
<zipfileset dir="${dist.dir}/lib" prefix="lib" includes="*.jar" />
</zip>
<zip file="${dist.dir}/solrj_1.3-4.10.zip" >
<zipfileset dir="${basedir}/lib-solrj" prefix="lib-solrj" includes="**" />
</zip>
</target>
<target name="javadoc" description="Build javadoc">
<mkdir dir="${doc.dir}"/>
<javadoc sourcepath="${src.dir}"
destdir="${doc.dir}"
windowtitle="SolrMarc API"
doctitle="SolrMarc API"
>
<classpath >
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</classpath>
<classpath >
<fileset dir="${lib.solrj.dir}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javadoc>
</target>
<target name="clean" description="clean up">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build.dir}" failonerror="false" />
<delete dir="${dist.dir}" failonerror="false" />
<delete dir="${test.build.dir}" failonerror="false" />
<delete dir="${test.dir}/data/index_java/bin" failonerror="false" />
<delete dir="${reports.tests}" failonerror="false" />
<delete dir="${instrumented.dir}" failonerror="false" />
<delete file="${src.dir}/org/solrmarc/index/indexer/FullConditionalParser.java" failonerror="false" />
<delete file="${src.dir}/org/solrmarc/index/indexer/FullConditionalScanner.java" failonerror="false" />
<delete file="${src.dir}/org/solrmarc/index/indexer/FullSym.java" failonerror="false" />
</target>
</project>