-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.xml
575 lines (481 loc) · 25.3 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="solrmarc" default="dist_site" basedir="." >
<property file="build.properties" />
<!-- Continuous Integration properties -->
<property name="cobertura.jar.dir" location="${test.lib.dir}/cobertura-1.9.4.1" />
<property name="cobertura.core.data.file" value="${core.instr.dir}/cobertura.ser" />
<property name="cobertura.site.data.file" value="${site.instr.dir}/cobertura.ser" />
<!-- ************ CORE non-test targets ********** -->
<target name="clean_core" description="remove the build directories for CORE">
<delete dir="${core.build.dir}" />
</target>
<target name="init_core" description="create (empty) generated directories for core code">
<mkdir dir="${core.build.dir}" />
</target>
<path id="core.classpath" description="classes and jars needed to build CORE code)">
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
<fileset dir="${solrj.lib.dir}" >
<include name="*.jar" />
</fileset>
</path>
<target name="compile_core" depends="init_core" description="Compile CORE source code into the build directory">
<javac destdir="${core.build.dir}" srcdir="${core.src.dir}"
target="${java.compat.version}"
source="${java.compat.version}"
debug="true" debuglevel="lines,vars,source"
encoding="utf-8" includeAntRuntime="false">
<include name="**/*.java" />
<classpath refid="core.classpath" />
</javac>
</target>
<target name="jar_core" depends="compile_core" description="Build custom jar file containing CORE code and log4j.properties" >
<jar destfile="${core.build.dir}/${core.jar.name}.jar">
<fileset dir="${core.build.dir}" includes="**/*.class" excludes="test/**"/>
<fileset file="${core.log4j.props}" />
<fileset dir="${core.basedir}" includes="${trans.map.dir}/**" />
</jar>
</target>
<!-- ************ CORE TEST targets ********** -->
<target name="test_clean_core" description="remove the directories generated for CORE testing">
<delete dir="${core.test.build.dir}" />
<delete dir="${test.solr.data.dir}" />
<delete dir="${test.solr.run.dir}" />
<delete file="${test.jetty.dir}/webapps/solr.war"/>
<delete dir="${test.jetty.dir}/solr-webapp"/>
<delete dir="${core.instr.dir}" />
<delete file="${cobertura.core.data.file}" />
<delete dir="${core.coverage.dir}" />
</target>
<target name="test_init_core" description="create (empty) generated directories for CORE TEST code">
<mkdir dir="${core.test.build.dir}" />
</target>
<path id="test.core.build.classpath" description="classes and jars needed to build CORE TEST code">
<fileset dir="${test.lib.dir}">
<include name="**/*.jar" />
</fileset>
<pathelement location="${core.build.dir}"/>
<path refid="core.classpath" />
</path>
<target name="test_compile_core" depends="compile_core,test_init_core" description="Compile CORE TEST source code into the test build directory">
<javac destdir="${core.test.build.dir}" srcdir="${core.test.src.dir}"
target="${java.compat.version}"
source="${java.compat.version}"
debug="true" debuglevel="lines,vars,source"
encoding="utf-8" includeAntRuntime="false">
<include name="**/*.java" />
<classpath refid="test.core.build.classpath" />
</javac>
</target>
<path id="test.core.run.classpath" description="classes and jars needed to run CORE TEST code">
<pathelement location="${core.test.build.dir}"/>
<fileset dir="${test.solr.run.dir}/lib">
<include name="*.jar" />
</fileset>
<path refid="test.core.build.classpath" />
</path>
<target name="core_setup_test_jetty">
<echo message="solr path for CORE testing: ${test.solr.run.dir}" />
<!-- set up jetty with solr files, including war, configuration, jars ... -->
<mkdir dir="${test.jetty.dir}/logs" />
<mkdir dir="${test.solr.run.dir}" />
<copy todir="${test.solr.run.dir}">
<fileset dir="${core.test.solr.orig.dir}" includes="**/solr.xml,**/conf/**,**/lib/**"/>
</copy>
<!-- copy over the war file -->
<copy file="${core.solr.war.path}" tofile="${test.jetty.dir}/webapps/solr.war" failonerror="false" />
</target>
<target name="test_core" depends="clean_test,test_compile_core,core_setup_test_jetty" description="run tests for CORE code">
<!-- if no core test class is defined, call the Util Unit test -->
<property name="core.test.class" value="org.solrmarc.tools.UtilUnitTests" />
<junit showoutput="yes" printsummary="yes" fork="yes" forkmode="perBatch" haltonfailure="on">
<classpath refid="test.core.run.classpath" />
<formatter type="plain" usefile="false" />
<sysproperty key="test.config.file" value="${core.test.config.file}" />
<sysproperty key="test.data.path" value="${core.test.data.path}" />
<sysproperty key="solrmarc.use_binary_request_handler" value="${core.test.use_binary_request_handler}" />
<sysproperty key="solrmarc.use_streaming_proxy" value="${core.test.use_streaming_proxy}" />
<sysproperty key="test.solr.log.level" value="${test.solr.log.level}" />
<sysproperty key="test.solrmarc.log.level" value="${test.solrmarc.log.level}" />
<sysproperty key="test.jetty.port" value="${test.jetty.port}" />
<sysproperty key="test.jetty.dir" value="${test.jetty.dir}" />
<sysproperty key="test.solr.url" value="${test.solr.url}" />
<sysproperty key="test.solr.path" value="${test.solr.run.dir}" />
<test name="${core.test.class}" />
<!--
<test name="${core.test.class}" />
<batchtest>
<fileset dir="${core.test.build.dir}" includes="**/tools/*Test*.class" />
</batchtest>
-->
</junit>
</target>
<!-- ************ CORE continuous integration targets ********** -->
<path id="cobertura.classpath">
<fileset dir="${cobertura.jar.dir}">
<include name="cobertura.jar" />
<include name="lib/**/*.jar" />
</fileset>
</path>
<!-- Load cobertura custom ant tasks -->
<taskdef classpathref="cobertura.classpath" resource="tasks.properties" />
<!-- NOTE: this should be used only after a fresh CORE compile -->
<target name="instrument_core">
<delete dir="${core.instr.dir}" />
<delete file="${cobertura.core.data.file}" />
<mkdir dir="${core.instr.dir}" />
<cobertura-instrument todir="${core.instr.dir}" datafile="${cobertura.core.data.file}">
<fileset dir="${core.build.dir}">
<include name="**/*.class" />
<exclude name="**/test/**" />
<exclude name="**/testUtils/*.class" />
<exclude name="**/*Test*" />
</fileset>
</cobertura-instrument>
</target>
<target name="test_core_coverage" depends="test_clean_core,test_compile_core,instrument_core,core_setup_test_jetty"
description="run tests for CORE and capture code coverage" >
<delete dir="${core.coverage.dir}" />
<mkdir dir="${core.coverage.dir}"/>
<path id="instrumented.classpath">
<pathelement location="${core.instr.dir}" />
<path refid="test.core.run.classpath" />
<path refid="cobertura.classpath" />
</path>
<echo message="test class = ${core.coverage.test.class}" />
<junit showoutput="yes" printsummary="yes" fork="yes" haltonfailure="on">
<formatter type="plain" usefile="false" />
<classpath refid="instrumented.classpath" />
<!-- name of the coverage data file to use. It must be the same
as the coverage data file generated during instrumentation. -->
<sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.core.data.file}" />
<sysproperty key="test.config.file" value="${core.test.config.file}" />
<sysproperty key="test.data.path" value="${core.test.data.path}" />
<sysproperty key="solrmarc.use_binary_request_handler" value="${core.test.use_binary_request_handler}" />
<sysproperty key="solrmarc.use_streaming_proxy" value="${core.test.use_streaming_proxy}" />
<sysproperty key="test.solr.log.level" value="${test.solr.log.level}" />
<sysproperty key="test.solrmarc.log.level" value="${test.solrmarc.log.level}" />
<sysproperty key="test.jetty.port" value="${test.jetty.port}" />
<sysproperty key="test.jetty.dir" value="${test.jetty.dir}" />
<sysproperty key="test.solr.url" value="${test.solr.url}" />
<sysproperty key="test.solr.path" value="${test.solr.run.dir}" />
<test name="${core.coverage.test.class}" />
</junit>
<!-- hudson cobertura plugin uses xml report and html reports are handy -->
<cobertura-report format="xml" destdir="${core.coverage.dir}" srcdir="${core.src.dir}" datafile="${cobertura.core.data.file}"/>
<cobertura-report format="html" destdir="${core.coverage.dir}" srcdir="$core.src.dir}" datafile="${cobertura.core.data.file}"/>
</target>
<target name="javadoc_core" description="generate javadoc for CORE code">
<path id="core.docs.srcpath">
<pathelement location="${core.src.dir}"/>
<pathelement location="${core.test.src.dir}"/>
</path>
<javadoc
destdir="${core.javadoc.dir}"
sourcepathref="core.docs.srcpath"
classpathref="test.core.build.classpath"
author="true"
version="true"
use="true"
windowtitle="SolrMarc CORE from Stanford Fork"
>
<doctitle><![CDATA[<h1>SolrMarc CORE API (from Stanford Fork)</h1>]]></doctitle>
<package name="org.solrmarc.*" />
<group title="Core Packages" packages="org.solrmarc.index,org.solrmarc.marc,org.solrmarc.solr,org.solrmarc.tools"/>
<group title="Test Utility Classes" packages="org.solrmarc.testUtils*"/>
<group title="Core Test Classes" packages="org.solrmarc.A*,org.solrmarc.tools.*Test*"/>
<link href="http://docs.oracle.com/javase/6/docs/api/" />
<link href="http://marc4j.tigris.org/doc/apidoc" />
<link href="http://logging.apache.org/log4j/1.2/apidocs" />
<link href="http://www.beanshell.org/javadoc" />
<link href="http://lucene.apache.org/solr/api" />
</javadoc>
</target>
<target name="clean_core_all" depends="test_clean_core,clean_core" />
<target name="ci_core" depends="clean_core_all,test_core_coverage,javadoc_core" description="CORE Continuous Integration: javadoc and tests with coverage" />
<!-- ************ SITE basic build targets ********** -->
<target name="clean_site" description="remove the build directories for SITE">
<delete dir="${site.build.dir}" />
<delete dir="${site.dist.dir}" />
</target>
<target name="init_site" depends="init_core" description="create (empty) generated directories for site AND core code">
<mkdir dir="${site.build.dir}" />
</target>
<path id="site.classpath" description="classes and jars needed to build SITE code">
<fileset dir="${site.lib.dir}">
<include name="*.jar" />
</fileset>
<pathelement location="${core.build.dir}"/>
<path refid="core.classpath" />
</path>
<target name="compile_site" depends="compile_core,init_site" description="Compile SITE AND CORE source code into the build directory">
<javac destdir="${site.build.dir}" srcdir="${site.src.dir}"
target="${java.compat.version}"
source="${java.compat.version}"
debug="true" debuglevel="lines,vars,source"
encoding="utf-8" includeAntRuntime="false">
<include name="**/*.java" />
<classpath refid="site.classpath" />
</javac>
</target>
<!--
<target name="jar_site" depends="jar_core,compile_site" description="Build custom jar file containing SITE code" >
<jar destfile="${site.build.dir}/${site.jar.name}.jar">
-->
<!-- SITE classes, etc. -->
<!--
<fileset dir="${site.build.dir}" includes="**/*.class" excludes="test/**"/>
<fileset file="${site.log4j.props}" />
<fileset dir="${site.basedir}" includes="*.properties,${trans.map.dir}/**" />
<manifest>
<attribute name="Default-Config-File" value="${site.config.file.name}"/>
<attribute name="Class-Path" value=". ${core.jar.name}.jar"/>
<attribute name="Main-Class" value="org.solrmarc.marc.MarcImporter"/>
</manifest>
</jar>
</target>
-->
<target name="dist_site" depends="clean,jar_core,compile_site"
description="Copy necessary files to the SITE dist directory to make a runnable instance of SITE SolrMarc">
<!-- copy jars of SolrMarc code to SITE (dist) directory -->
<mkdir dir="${site.dist.dir}" />
<copy todir="${site.dist.dir}">
<fileset file="${core.build.dir}/${core.jar.name}.jar" />
</copy>
<!-- FIXME: should be able to have config props and trans maps in jar, no? -->
<!-- copy .properties and translation maps to SITE (dist) directory -->
<copy todir="${site.dist.dir}">
<fileset dir="${site.basedir}" includes="*.properties" />
<fileset file="${site.log4j.props}" />
</copy>
<mkdir dir="${site.dist.dir}/${trans.map.dir}" />
<copy todir="${site.dist.dir}/${trans.map.dir}" >
<fileset dir="${core.basedir}/${trans.map.dir}" includes="*.properties" />
</copy>
<copy todir="${site.dist.dir}/${trans.map.dir}" overwrite="true" >
<fileset dir="${site.basedir}/${trans.map.dir}" includes="*.properties" />
</copy>
<!-- copy jars used by SolrMarc to SITE (dist)/lib directory -->
<mkdir dir="${site.dist.dir}/lib" />
<copy todir="${site.dist.dir}/lib" flatten="yes">
<fileset dir="${site.lib.dir}" includes="*.jar" />
<!-- jars from solrmarc lib dir, including solrj-lib dir -->
<fileset dir="${lib.dir}" includes="**/*.jar" />
</copy>
<!-- copy SITE scripts to SITE (dist)/bin directory -->
<!-- not for Stanford
<mkdir dir="${site.dist.script.dir}" />
<copy todir="${site.dist.script.dir}">
<fileset dir="${site.scripts.dir}" includes="**" />
</copy>
<chmod dir="${site.dist.script.dir}/" perm="755" includes="*"/>
-->
<!-- copy CORE scripts to SITE (dist)/bin/(core) directory -->
<mkdir dir="${site.dist.script.dir}/${core.basedir}" />
<copy todir="${site.dist.script.dir}/${core.basedir}">
<fileset dir="${core.scripts.dir}" includes="**" />
</copy>
<chmod dir="${site.dist.script.dir}/${core.basedir}" perm="755" includes="*"/>
<!-- FIXME: there's probably a more elegant way to get the manifest classpath, but I couldn't figure it out -->
<!-- flesh out the manifest Class-Path in the SITE jar with jars in dist -->
<property name="canonical.path" location="${site.dist.dir}" /> <!-- ensures path is "canonical" -->
<fileset id="dist.top.level.jars" dir="${canonical.path}" includes="*.jar"/>
<fileset id="dist.lib.jars" dir="${canonical.path}/lib" includes="*.jar"/>
<path id="dist.jar.classpath" location="${site.dist.dir}">
<fileset refid="dist.top.level.jars"/>
<fileset refid="dist.lib.jars"/>
</path>
<!-- convert lib folder to string property for use in manifest classpath-->
<pathconvert property="manifest.classpath" pathsep=" ">
<path refid="dist.jar.classpath" />
<map from="${canonical.path}" to="." />
</pathconvert>
<!-- FIXME: there should be a way to just update the manifest classpath for the existing jar, but I'm having trouble -->
<!--
<jar update="true" destfile="${site.build.dir}/${site.jar.name}.jar" filesetmanifest="merge">
<manifest>
<attribute name="Class-Path" value="${manifest.classpath}"/>
</manifest>
</jar>
-->
<!-- create jar with jars from dist classpath in manifest -->
<jar destfile="${site.dist.dir}/${site.jar.name}.jar">
<!-- SITE classes, etc. -->
<fileset dir="${site.build.dir}" includes="**/*.class" excludes="test/**"/>
<fileset file="${site.log4j.props}" />
<fileset dir="${site.basedir}" includes="*.properties,${trans.map.dir}/**" />
<manifest>
<attribute name="Config-Properties-File" value="${site.config.file.name}"/>
<attribute name="Class-Path" value="${manifest.classpath}"/>
<attribute name="Main-Class" value="org.solrmarc.marc.MarcImporter"/>
</manifest>
</jar>
<echo message="" />
<echo message="*** ALERT *** ALERT *** ALERT *** ALERT *** ALERT *** ALERT ***" />
<echo message="!!! Make sure the Solr instance used for indexing has correct conf, lib, etc. files before running code out of dist. !!!" />
<echo message="!!! Make sure the Solr instance used for indexing has desired (or empty) index before running code out of dist. !!!" />
<echo message="*** ALERT *** ALERT *** ALERT *** ALERT *** ALERT *** ALERT ***" />
</target>
<!-- ************ SITE TEST targets ********** -->
<target name="test_clean_site" description="remove the directories generated for SITE testing">
<delete dir="$site.test.build.dir}" />
<delete dir="${site.test.solr.data.dir}" />
<delete dir="${site.test.solr.run.dir}" />
<delete file="${test.jetty.dir}/webapps/solr.war"/>
<delete dir="${test.jetty.dir}/solr-webapp"/>
<delete dir="${site.instr.dir}" />
<delete file="${cobertura.site.data.file}" />
<delete dir="${site.coverage.dir}" />
</target>
<target name="test_init_site" depends="test_init_core" description="create (empty) generated directories for SITE and CORE TEST code">
<mkdir dir="${site.test.build.dir}" />
</target>
<path id="test.site.build.classpath" description="classes and jars needed to build SITE TEST code">
<fileset dir="${site.test.lib.dir}">
<include name="solr/lib/*.jar" />
</fileset>
<pathelement location="${site.build.dir}"/>
<path refid="site.classpath" />
<path refid="test.core.run.classpath" />
</path>
<target name="test_compile_site" depends="test_compile_core,compile_site,test_init_site" description="Compile SITE and CORE TEST source code into the test build directory">
<!-- FIXME: it makes NO SENSE that this mkdir is needed -->
<mkdir dir="${site.test.solr.run.dir}/lib" />
<javac destdir="${site.test.build.dir}" srcdir="${site.test.src.dir}"
target="${java.compat.version}"
source="${java.compat.version}"
debug="true" debuglevel="lines,vars,source"
encoding="utf-8" includeAntRuntime="false">
<include name="**/*.java" />
<classpath refid="test.site.build.classpath" />
</javac>
</target>
<path id="test.site.run.classpath" description="classes and jars needed to run SITE TEST code">
<pathelement location="${site.test.build.dir}"/>
<path refid="test.site.build.classpath" />
<path refid="test.core.run.classpath" />
</path>
<target name="site_setup_test_jetty" description="set up jetty with site solr war, conf, lib etc">
<echo message="solr path for SITE testing: ${test.solr.run.dir}" />
<!-- set up jetty with solr files, including war, configuration, jars ... -->
<mkdir dir="${site.test.jetty.dir}/logs" />
<mkdir dir="${site.test.solr.run.dir}" />
<copy todir="${site.test.solr.run.dir}">
<fileset dir="${core.test.solr.orig.dir}" includes="**/solr.xml,**/conf/**,**/lib/**"/>
</copy>
<copy todir="${site.test.solr.run.dir}" overwrite="true">
<fileset dir="${site.test.solr.orig.dir}" includes="**/solr.xml,**/conf/**,**/lib/**"/>
</copy>
<copy file="${site.test.solr.orig.dir}/conf/solrconfig-test.xml" tofile="${site.test.solr.run.dir}/conf/solrconfig.xml" overwrite="true"/>
<!-- copy over the war file -->
<copy file="${site.solr.war.path}" tofile="${test.jetty.dir}/webapps/solr.war" failonerror="false" />
</target>
<target name="test_site" depends="clean_test,test_compile_site,site_setup_test_jetty" description="run tests for SITE code">
<junit showoutput="yes" printsummary="yes" fork="yes" forkmode="once" haltonfailure="on" maxmemory="512m">
<classpath refid="test.site.run.classpath" />
<formatter type="plain" usefile="false" />
<sysproperty key="test.config.file" value="${site.test.config.file}" />
<sysproperty key="test.data.path" value="${site.test.data.path}" />
<sysproperty key="solrmarc.use_binary_request_handler" value="${site.test.use_binary_request_handler}" />
<sysproperty key="solrmarc.use_streaming_proxy" value="${site.test.use_streaming_proxy}" />
<sysproperty key="test.solr.log.level" value="${test.solr.log.level}" />
<sysproperty key="test.solrmarc.log.level" value="${test.solrmarc.log.level}" />
<sysproperty key="test.jetty.port" value="${site.test.jetty.port}" />
<sysproperty key="test.jetty.dir" value="${site.test.jetty.dir}" />
<sysproperty key="test.solr.url" value="${site.test.solr.url}" />
<sysproperty key="test.solr.path" value="${site.test.solr.run.dir}" />
<test name="${site.test.class}" />
</junit>
</target>
<!-- ************ SITE continuous integration targets ********** -->
<!-- NOTE: this should be used only after a fresh SITE compile -->
<target name="instrument_site">
<delete dir="${site.instr.dir}" />
<delete file="${cobertura.site.data.file}" />
<mkdir dir="${site.instr.dir}" />
<cobertura-instrument todir="${site.instr.dir}" datafile="${cobertura.site.data.file}">
<fileset dir="${site.build.dir}">
<include name="**/*.class" />
<exclude name="**/*Test*" />
</fileset>
</cobertura-instrument>
</target>
<target name="test_site_coverage" depends="clean_test,test_compile_site,instrument_site,site_setup_test_jetty"
description="run tests for SITE and capture code coverage" >
<delete dir="${site.coverage.dir}" />
<mkdir dir="${site.coverage.dir}"/>
<path id="instrumented.classpath">
<pathelement location="${site.instr.dir}" />
<path refid="test.site.run.classpath" />
<path refid="cobertura.classpath" />
</path>
<echo message="test class = ${site.coverage.test.class} " />
<junit showoutput="yes" printsummary="yes" fork="yes" forkmode="once" haltonfailure="on" maxmemory="512m">
<formatter type="plain" usefile="false" />
<classpath refid="instrumented.classpath" />
<!-- name of the coverage data file to use. It must be the same
as the coverage data file generated during instrumentation. -->
<sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.site.data.file}" />
<sysproperty key="test.config.file" value="${site.test.config.file}" />
<sysproperty key="test.data.path" value="${site.test.data.path}" />
<sysproperty key="solrmarc.use_binary_request_handler" value="${site.test.use_binary_request_handler}" />
<sysproperty key="solrmarc.use_streaming_proxy" value="${site.test.use_streaming_proxy}" />
<sysproperty key="test.solr.log.level" value="${test.solr.log.level}" />
<sysproperty key="test.solrmarc.log.level" value="${test.solrmarc.log.level}" />
<sysproperty key="test.jetty.port" value="${site.test.jetty.port}" />
<sysproperty key="test.jetty.dir" value="${site.test.jetty.dir}" />
<sysproperty key="test.solr.url" value="${site.test.solr.url}" />
<sysproperty key="test.solr.path" value="${site.test.solr.run.dir}" />
<test name="${site.coverage.test.class}" />
</junit>
<!-- hudson cobertura plugin uses xml report and html reports are handy -->
<cobertura-report format="xml" destdir="${site.coverage.dir}" srcdir="${site.src.dir}" datafile="${cobertura.site.data.file}"/>
<cobertura-report format="html" destdir="${site.coverage.dir}" srcdir="${site.src.dir}" datafile="${cobertura.site.data.file}"/>
</target>
<target name="javadoc_site" description="generate javadoc for SITE code">
<path id="site.docs.srcpath">
<pathelement location="${site.src.dir}"/>
</path>
<javadoc destdir="${site.javadoc.dir}"
sourcepathref="site.docs.srcpath"
classpathref="test.site.build.classpath"
author="true"
version="true"
use="true"
windowtitle="SearchWorks SITE from Stanford SolrMarc Fork"
>
<doctitle><![CDATA[<h1>SolrMarc SearchWorks SITE API (from Stanford Fork)</h1>]]></doctitle>
<package name="edu.stanford.*" />
<group title="Stanford SearchWorks Packages" packages="edu.stanford,edu.stanford.enumValues,edu.stanford.marcUtils"/>
<link href="http://docs.oracle.com/javase/6/docs/api/" />
<link href="http://marc4j.tigris.org/doc/apidoc" />
<link href="http://logging.apache.org/log4j/1.2/apidocs" />
<link href="http://lucene.apache.org/solr/api" />
</javadoc>
</target>
<target name="ci_site" depends="clean_all,test_site_coverage,javadoc_site" description="SITE Continuous Integration: javadoc and tests with coverage" />
<!-- ************ SITE EXTERNAL JETTY targets ***** -->
<target name="ext_setup_test_jetty" description="set up jetty with site solr war, conf, lib etc for external testing">
<echo message="solr path for SITE testing: ${test.solr.run.dir}" />
<!-- set up jetty with solr files, including war, configuration, jars ... -->
<mkdir dir="${site.test.jetty.dir}/logs" />
<mkdir dir="${site.test.solr.run.dir}" />
<copy todir="${site.test.solr.run.dir}">
<fileset dir="${core.test.solr.orig.dir}" includes="**/solr.xml,**/conf/**,**/lib/**"/>
</copy>
<copy todir="${site.test.solr.run.dir}" overwrite="true">
<fileset dir="${site.test.solr.orig.dir}" includes="**/solr.xml,**/conf/**,**/lib/**"/>
</copy>
<copy file="${site.test.solr.orig.dir}/conf/solrconfig-ext-test.xml" tofile="${site.test.solr.run.dir}/conf/solrconfig.xml" overwrite="true"/>
<!-- copy over the war file -->
<copy file="${site.solr.war.path}" tofile="${test.jetty.dir}/webapps/solr.war" failonerror="false" />
</target>
<target name="ext_setup" depends="dist_site,ext_setup_test_jetty" description="get code and jetty ready for external testing" />
<!-- ************ CORE and SITE together targets ********** -->
<target name="clean" depends="clean_site,clean_core" description="remove the build directories for CORE and SITE" />
<target name="clean_test" depends="test_clean_site,test_clean_core" description="remove the directories generated for CORE and SITE testing" />
<target name="clean_all" depends="clean_test, clean" description="remove all generated directories for CORE and SITE, including test and dist">
<delete dir="${site.dist.dir}" quiet="true" />
</target>
</project>