This repository was archived by the owner on May 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathbuild.xml
More file actions
608 lines (545 loc) · 25 KB
/
Copy pathbuild.xml
File metadata and controls
608 lines (545 loc) · 25 KB
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
<project name="plexi" default="build" basedir=".">
<description>Adaptor Library</description>
<tstamp/>
<!-- Load build environment specific properties. -->
<property file="build.properties"/>
<property name="compile.java.version" value="1.6"/>
<property name="compile.java.bootclasspath" value="${build.bootclasspath}"/>
<!-- The build.bootclasspath property, if set, must match the Java version
set in compile.java.version. To detect errors in build.bootclasspath,
set compile.java.newerClassname to a class that was added in
the immediately following release of Java. For example, for
"1.6", pick a class added in Java 7. -->
<property name="compile.java.newerClassname" value="java.lang.AutoCloseable"/>
<property name="src.dir" location="src"/>
<property name="prebuilt.dir" location="prebuilt"/>
<property name="test.dir" location="test"/>
<property name="test.class" value="*Test"/>
<property name="build.dir" location="build"/>
<property name="build-src.dir" location="${build.dir}/src"/>
<property name="build-test.dir" location="${build.dir}/test"/>
<property name="build-instrument.dir" location="${build.dir}/instrument"/>
<property name="dist.dir" location="dist"/>
<property name="javadoc.dir" location="${build.dir}/javadoc"/>
<property name="resource.dir" location="resources"/>
<property name="test-resource.dir" location="test-resources"/>
<property name="lib.dir" location="lib"/>
<property name="adaptor.pkg.dir" value="com/google/enterprise/adaptor"/>
<property name="adaptor.pkg.name" value="com.google.enterprise.adaptor"/>
<property name="adaptor.class"
value="${adaptor.pkg.name}.examples.AdaptorTemplate"/>
<property name="adaptor.args" value=""/>
<property name="cobertura.dir" value="${basedir}/../cobertura/"/>
<!-- Use add-modules with Java 9 and higher. -->
<condition property="java.modules"
value="" else="--add-modules java.xml.bind">
<matches string="${ant.java.version}" pattern="^1\.[678]$"/>
</condition>
<path id="adaptorlib.build.classpath">
<fileset dir="${lib.dir}">
<include name="json_simple-1.1.jar"/>
<include name="gdata-core-1.0.jar"/>
<include name="gdata-gsa-1.0.jar"/>
<include name="joda-time-1.6.jar"/>
<include name="opensaml-2.3.2.jar"/>
<include name="openws-1.3.1.jar"/>
<include name="xmltooling-1.2.2.jar"/>
<include name="guava-17.0.jar"/>
<include name="jsr305.jar"/>
<include name="gson-2.0.jar"/>
<include name="velocity-1.5.jar"/>
<include name="commons-daemon-1.0.15.jar"/>
</fileset>
</path>
<path id="adaptorlib.run.classpath">
<path refid="adaptorlib.build.classpath"/>
<pathelement location="${resource.dir}"/>
<path refid="opensaml.run.classpath"/>
</path>
<path id="examples.build.classpath">
<fileset dir="${lib.dir}">
<include name="opencsv-2.3.jar"/>
</fileset>
</path>
<path id="examples.run.classpath">
<path refid="examples.build.classpath"/>
</path>
<path id="opensaml.run.classpath">
<fileset dir="${lib.dir}">
<include name="bcprov-jdk15-1.45.jar"/>
<!--include name="commons-codec-1.3.jar"/-->
<include name="commons-collections-3.1.jar"/>
<!--include name="commons-httpclient-3.1.jar"/-->
<include name="commons-lang-2.1.jar"/>
<!--include name="jcip-annotations-1.0.jar"/-->
<!--include name="jcl-over-slf4j-1.5.10.jar"/-->
<include name="joda-time-1.6.jar"/>
<!--include name="jul-to-slf4j-1.5.10.jar"/-->
<!--include name="log4j-over-slf4j-1.5.10.jar"/-->
<!--include name="not-yet-commons-ssl-0.3.9.jar"/-->
<include name="opensaml-2.3.2.jar"/>
<include name="openws-1.3.1.jar"/>
<include name="slf4j-api-1.5.10.jar"/>
<include name="velocity-1.5.jar"/>
<include name="xmlsec-1.4.3.jar"/>
<include name="xmltooling-1.2.2.jar"/>
<!-- Libraries that are supposed to be endorsed, that we aren't having
endorsed. -->
<!--include name="resolver-2.9.1.jar"/-->
<!--include name="serializer-2.9.1.jar"/-->
<!--include name="xalan-2.7.1.jar"/-->
<include name="xercesImpl-2.11.0.jar"/>
<include name="xml-apis-1.4.1.jar"/>
<!-- Additional dependencies not included with opensaml. -->
<include name="slf4j-jdk14-1.5.10.jar"/>
<include name="commons-logging-api-1.1.1.jar"/>
</fileset>
</path>
<path id="cobertura.classpath">
<fileset dir="${cobertura.dir}" erroronmissingdir="false">
<include name="cobertura.jar"/>
<include name="lib/**/*.jar"/>
</fileset>
</path>
<target name="-check-instrument-uptodate">
<uptodate property="instrument.uptodate"
targetfile="${build-instrument.dir}/cobertura.ser">
<srcfiles dir="${build-src.dir}"/>
</uptodate>
</target>
<path id="junit.classpath">
<fileset dir="${lib.dir}">
<include name="junit-4.11.jar"/>
<include name="hamcrest-core-1.3.jar"/>
</fileset>
</path>
<target name="build"
depends="-real-build,-check-instrument-uptodate,clean-instrument"
description="Build source"/>
<target name="-real-build">
<mkdir dir="${build-src.dir}"/>
<!-- Make sure that the build.bootclasspath isn't newer than expected. -->
<available property="compile.java.isNewer"
classname="${compile.java.newerClassname}"
classpath="${compile.java.bootclasspath}" ignoresystemclasses="true"/>
<fail if="compile.java.isNewer">
Error: build.bootclasspath is newer than JDK ${compile.java.version}.
</fail>
<!-- Compile adaptorlib. -->
<javac srcdir="${src.dir}" destdir="${build-src.dir}" debug="true"
includeantruntime="false" encoding="utf-8"
target="${compile.java.version}" source="${compile.java.version}">
<!-- Do not suppress options warnings on this first call. -->
<compilerarg line="-Xlint -Xlint:-path -Xlint:-serial"/>
<bootclasspath path="${compile.java.bootclasspath}"/>
<classpath refid="adaptorlib.build.classpath"/>
<exclude name="${adaptor.pkg.dir}/examples/**"/>
<exclude name="${adaptor.pkg.dir}/experimental/**"/>
<include name="${adaptor.pkg.dir}/**"/>
</javac>
<!-- Compile examples. -->
<javac srcdir="${src.dir}" destdir="${build-src.dir}" debug="true"
includeantruntime="false" encoding="utf-8"
target="${compile.java.version}" source="${compile.java.version}">
<compilerarg line="-Xlint -Xlint:-path -Xlint:-serial -Xlint:-options"/>
<bootclasspath path="${compile.java.bootclasspath}"/>
<classpath refid="examples.build.classpath"/>
<include name="${adaptor.pkg.dir}/examples/**"/>
</javac>
<mkdir dir="${build-test.dir}"/>
<!-- Compile JUnit helper -->
<javac srcdir="${lib.dir}" destdir="${build-test.dir}" debug="true"
includeantruntime="true" encoding="utf-8"
target="${compile.java.version}" source="${compile.java.version}">
<compilerarg line="-Xlint -Xlint:-path -Xlint:-serial -Xlint:-options"/>
<bootclasspath path="${compile.java.bootclasspath}"/>
<classpath refid="junit.classpath"/>
<include name="JUnitLogFixFormatter.java"/>
</javac>
<!-- Compile tests, excluding example and experimental tests. -->
<javac srcdir="${test.dir}" destdir="${build-test.dir}" debug="true"
includeantruntime="false" encoding="utf-8"
target="${compile.java.version}" source="${compile.java.version}">
<compilerarg line="-Xlint -Xlint:-path -Xlint:-serial -Xlint:-options"/>
<bootclasspath path="${compile.java.bootclasspath}"/>
<classpath refid="adaptorlib.build.classpath"/>
<classpath location="${build-src.dir}"/>
<classpath refid="junit.classpath"/>
<exclude name="${adaptor.pkg.dir}/examples/**"/>
<exclude name="${adaptor.pkg.dir}/experimental/**"/>
</javac>
<!-- Compile tests for examples. -->
<javac srcdir="${test.dir}" destdir="${build-test.dir}" debug="true"
includeantruntime="false" encoding="utf-8"
target="${compile.java.version}" source="${compile.java.version}">
<compilerarg line="-Xlint -Xlint:-path -Xlint:-serial -Xlint:-options"/>
<bootclasspath path="${compile.java.bootclasspath}"/>
<classpath refid="examples.build.classpath"/>
<classpath location="${build-src.dir}"/>
<classpath refid="junit.classpath"/>
<include name="${adaptor.pkg.dir}/examples/**"/>
</javac>
<!-- Compile experimental code. -->
<javac srcdir="${src.dir}" destdir="${build-src.dir}" debug="true"
includeantruntime="false" encoding="utf-8"
target="${compile.java.version}" source="${compile.java.version}">
<compilerarg line="-Xlint -Xlint:-path -Xlint:-serial -Xlint:-options"/>
<bootclasspath path="${compile.java.bootclasspath}"/>
<classpath refid="adaptorlib.build.classpath"/>
<classpath location="${lib.dir}/commons-fileupload-1.3.jar"/>
<include name="${adaptor.pkg.dir}/experimental/**"/>
</javac>
<!-- Compile tests for experimental. -->
<javac srcdir="${test.dir}" destdir="${build-test.dir}" debug="true"
includeantruntime="false" encoding="utf-8"
target="${compile.java.version}" source="${compile.java.version}">
<compilerarg line="-Xlint -Xlint:-path -Xlint:-serial -Xlint:-options"/>
<bootclasspath path="${compile.java.bootclasspath}"/>
<classpath refid="adaptorlib.build.classpath"/>
<classpath location="${build-src.dir}"/>
<classpath refid="junit.classpath"/>
<include name="${adaptor.pkg.dir}/experimental/**"/>
</javac>
</target>
<target name="-discover-version" unless="adaptorlib.version">
<exec executable="git" outputproperty="adaptorlib.version"
logError="true" failifexecutionfails="false">
<arg value="describe"/>
<arg value="--always"/>
</exec>
<!-- Set version if git describe failed. -->
<property name="adaptorlib.version" value="unknown-${DSTAMP}"/>
</target>
<target name="dist" description="Generate distribution binaries"
depends="clean,test,package"/>
<target name="package" description="Generate binaries"
depends="build,javadoc,-discover-version">
<property name="dist.staging.dir" value="${build.dir}/dist/staging"/>
<delete dir="${build.dir}/dist"/>
<delete dir="${dist.dir}"/>
<mkdir dir="${build.dir}/dist"/>
<mkdir dir="${build.dir}/dist/staging"/>
<mkdir dir="${build.dir}/dist/staging/examples"/>
<mkdir dir="${dist.dir}"/>
<!-- Set the file name suffix from the version. Add a leading dash,
and strip a leading "v" prefix if it is followed by a digit. -->
<loadresource property="adaptorlib.suffix">
<propertyresource name="adaptorlib.version"/>
<filterchain>
<replaceregex pattern="^(v(?=\d))?" replace="-"/>
</filterchain>
</loadresource>
<!-- Produce intermediate distribution files -->
<copy file="LICENSE" todir="${dist.staging.dir}"/>
<copy file="THIRDPARTYLICENSE.txt" todir="${dist.staging.dir}"/>
<!-- adaptor.jar -->
<jar destfile="${dist.staging.dir}/adaptor${adaptorlib.suffix}.jar"
basedir="${build-src.dir}" excludes="${adaptor.pkg.dir}/examples/**">
<manifest>
<section name="com/google/enterprise/adaptor/">
<attribute name="Implementation-Title" value="Adaptor Library"/>
<attribute name="Implementation-Vendor" value="Google Inc."/>
<attribute name="Implementation-Version"
value="${adaptorlib.version}"/>
</section>
</manifest>
<fileset dir="${resource.dir}"/>
</jar>
<!-- adaptor-src.jar -->
<jar destfile="${dist.staging.dir}/adaptor${adaptorlib.suffix}-src.jar"
basedir="${src.dir}" excludes="${adaptor.pkg.dir}/examples/**">
<fileset dir="${resource.dir}"/>
</jar>
<!-- lib/ -->
<!-- Concatenate dependent JARs together into a comma-delimited list. -->
<pathconvert pathsep="," refid="adaptorlib.run.classpath"
property="tmp.adaptorlib.fileset">
<!-- We remove the lib.dir from the paths to prevent trouble with comma
and space in lib.dir. It also makes it nicer <echo>ing
tmp.adaptorlib.fileset. -->
<map from="${lib.dir}/" to=""/>
</pathconvert>
<copy todir="${dist.staging.dir}/lib">
<fileset dir="${lib.dir}" includes="${tmp.adaptorlib.fileset}"/>
</copy>
<!-- adaptor-withlib.jar -->
<jar destfile="${build.dir}/dist/adaptor-withlib.tmp.jar"
filesetmanifest="mergewithoutmain">
<!-- Provide an empty manifest to encourage mergewithoutmain to function.
See https://issues.apache.org/bugzilla/show_bug.cgi?id=54171 . -->
<manifest/>
<zipfileset src="${dist.staging.dir}/adaptor${adaptorlib.suffix}.jar"/>
<zipgroupfileset dir="${dist.staging.dir}/lib"/>
</jar>
<!-- Re-save JAR without signing keys, since keeping them in the JAR causes
security exceptions. -->
<zip destfile="${dist.staging.dir}/adaptor${adaptorlib.suffix}-withlib.jar">
<zipfileset excludes="META-INF/**/*.DSA,META-INF/**/*.SF"
src="${build.dir}/dist/adaptor-withlib.tmp.jar"/>
</zip>
<!-- adaptor-examples.jar -->
<pathconvert pathsep="," refid="examples.run.classpath"
property="tmp.examples.zipgroup">
<map from="${lib.dir}/" to=""/>
</pathconvert>
<jar destfile="${dist.staging.dir}/examples/adaptor${adaptorlib.suffix}-examples.jar"
basedir="${build-src.dir}" includes="${adaptor.pkg.dir}/examples/**">
<manifest>
<section name="com/google/enterprise/adaptor/examples/">
<attribute name="Implementation-Title" value="Example Adaptors"/>
<attribute name="Implementation-Vendor" value="Google Inc."/>
<attribute name="Implementation-Version"
value="${adaptorlib.version}"/>
</section>
</manifest>
<zipgroupfileset dir="${lib.dir}" includes="${tmp.examples.zipgroup}"/>
<fileset dir="${src.dir}"
includes="${adaptor.pkg.dir}/examples/**/*.java"/>
</jar>
<!-- example Command Line Adaptor scripts -->
<copy todir="${dist.staging.dir}">
<fileset dir="${basedir}" includes="examples/*"/>
</copy>
<!-- adaptor-docs.zip -->
<zip destfile="${dist.staging.dir}/adaptor${adaptorlib.suffix}-docs.zip"
basedir="${javadoc.dir}"/>
<!-- Produce final distribution files -->
<!-- adaptor-src.zip -->
<zip destfile="${dist.dir}/adaptor${adaptorlib.suffix}-src.zip"
basedir="${basedir}">
<exclude name="**/.*/**"/>
<!-- Normal private files -->
<exclude name="build/**"/>
<exclude name="dist/**"/>
<exclude name="adaptor-config.properties"/>
<exclude name="cacerts.jks"/>
<exclude name="keys.jks"/>
<exclude name="adaptor.crt"/>
<exclude name="gsa.crt"/>
<!-- IntelliJ files -->
<exclude name="workspace/**"/>
<exclude name="classes/**"/>
<exclude name=".idea"/>
<exclude name="Plexi.iml"/>
<!-- NetBeans files -->
<exclude name="nbproject/**"/>
</zip>
<!-- adaptor-bin.zip -->
<move file="${dist.staging.dir}"
tofile="${build.dir}/dist/adaptor${adaptorlib.suffix}"/>
<zip destfile="${dist.dir}/adaptor${adaptorlib.suffix}-bin.zip"
basedir="${build.dir}/dist/adaptor${adaptorlib.suffix}"/>
</target>
<!-- Build stand-alone AdaptorTemplate.jar for testing purposes. -->
<target name="adaptor-template" description="AdaptorTemplate jar"
depends="package">
<jar destfile="${build.dir}/dist/adaptor${adaptorlib.suffix}/AdaptorTemplate.jar"
basedir="${build-src.dir}"
includes="${adaptor.pkg.dir}/**/AdaptorTemplate.class">
<manifest>
<attribute name="Implementation-Title" value="Adaptor Template"/>
<attribute name="Implementation-Vendor" value="Google Inc."/>
<attribute name="Implementation-Version"
value="${adaptorlib.version}"/>
<attribute name="Main-Class"
value="com.google.enterprise.adaptor.examples.AdaptorTemplate" />
<attribute name="Class-Path"
value="adaptor${adaptorlib.suffix}-withlib.jar" />
</manifest>
</jar>
</target>
<target name="-javadoc-test-uptodate">
<uptodate property="javadoc.uptodate"
targetfile="${javadoc.dir}/index.html">
<srcfiles dir="${src.dir}"/>
</uptodate>
</target>
<target name="javadoc" description="Build JavaDocs"
depends="-javadoc-test-uptodate" unless="javadoc.uptodate">
<javadoc sourcepath="${src.dir}" destdir="${javadoc.dir}"
overview="${src.dir}/overview.html"
packagenames="${adaptor.pkg.name},${adaptor.pkg.name}.**">
<classpath refid="adaptorlib.build.classpath"/>
<classpath refid="examples.build.classpath"/>
<classpath location="${lib.dir}/commons-fileupload-1.3.jar"/>
<link href="https://docs.oracle.com/javase/6/docs/jre/api/net/httpserver/spec/"/>
<link href="https://docs.oracle.com/javase/6/docs/api/"/>
<link href="http://commons.apache.org/proper/commons-daemon/apidocs/"/>
<arg line="${java.modules}"/>
<arg value="-quiet"/>
<arg value="-notimestamp"/>
</javadoc>
</target>
<target name="clean" description="Remove build output">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
<target name="run" depends="build" description="Run default adaptor">
<java classpath="${build-src.dir}" fork="true" classname="${adaptor.class}">
<jvmarg line="${java.modules}"/>
<classpath refid="adaptorlib.run.classpath"/>
<sysproperty key="java.util.logging.config.file"
value="logging.properties"/>
<sysproperty key="javax.net.ssl.keyStore" file="keys.jks"/>
<sysproperty key="javax.net.ssl.keyStoreType" value="jks"/>
<sysproperty key="javax.net.ssl.keyStorePassword" value="changeit"/>
<sysproperty key="javax.net.ssl.trustStore" file="cacerts.jks"/>
<sysproperty key="javax.net.ssl.trustStoreType" value="jks"/>
<sysproperty key="javax.net.ssl.trustStorePassword" value="changeit"/>
<arg line="${adaptor.args}"/>
</java>
</target>
<target name="groups_writer" depends="build" description="Run groups writer">
<java classpath="${build-src.dir}" fork="true"
classname="${adaptor.pkg.name}.examples.GroupDefinitionsWriter">
<jvmarg line="${java.modules}"/>
<classpath refid="adaptorlib.run.classpath"/>
<sysproperty key="java.util.logging.config.file"
value="logging.properties"/>
<sysproperty key="javax.net.ssl.keyStore" file="keys.jks"/>
<sysproperty key="javax.net.ssl.keyStoreType" value="jks"/>
<sysproperty key="javax.net.ssl.keyStorePassword" value="changeit"/>
<sysproperty key="javax.net.ssl.trustStore" file="cacerts.jks"/>
<sysproperty key="javax.net.ssl.trustStoreType" value="jks"/>
<sysproperty key="javax.net.ssl.trustStorePassword" value="changeit"/>
<arg line="${adaptor.args}"/>
</java>
</target>
<target name="groups_from_csv" depends="build"
description="Run groups from csv">
<java classpath="${build-src.dir}" fork="true"
classname="${adaptor.pkg.name}.examples.GroupDefinitionsFromCsv">
<jvmarg line="${java.modules}"/>
<classpath refid="adaptorlib.run.classpath"/>
<sysproperty key="java.util.logging.config.file"
value="logging.properties"/>
<sysproperty key="javax.net.ssl.keyStore" file="keys.jks"/>
<sysproperty key="javax.net.ssl.keyStoreType" value="jks"/>
<sysproperty key="javax.net.ssl.keyStorePassword" value="changeit"/>
<sysproperty key="javax.net.ssl.trustStore" file="cacerts.jks"/>
<sysproperty key="javax.net.ssl.trustStoreType" value="jks"/>
<sysproperty key="javax.net.ssl.trustStorePassword" value="changeit"/>
<arg line="${adaptor.args}"/>
</java>
</target>
<target name="groups_scale_tester" depends="build"
description="Run groups scale tester">
<java classpath="${build-src.dir}" fork="true"
classname="${adaptor.pkg.name}.examples.GroupDefinitionsScaleTester">
<jvmarg line="${java.modules}"/>
<classpath refid="adaptorlib.run.classpath"/>
<sysproperty key="java.util.logging.config.file"
value="logging.properties"/>
<sysproperty key="javax.net.ssl.keyStore" file="keys.jks"/>
<sysproperty key="javax.net.ssl.keyStoreType" value="jks"/>
<sysproperty key="javax.net.ssl.keyStorePassword" value="changeit"/>
<sysproperty key="javax.net.ssl.trustStore" file="cacerts.jks"/>
<sysproperty key="javax.net.ssl.trustStoreType" value="jks"/>
<sysproperty key="javax.net.ssl.trustStorePassword" value="changeit"/>
<arg line="${adaptor.args}"/>
</java>
</target>
<target name="sim" depends="build" description="run simulator">
<java classpath="${build-src.dir}" fork="true"
classname="com.google.enterprise.adaptor.experimental.Sim">
<classpath refid="adaptorlib.run.classpath"/>
<classpath location="${lib.dir}/commons-fileupload-1.3.jar"/>
<sysproperty key="java.util.logging.config.file"
value="logging.properties"/>
</java>
</target>
<target name="coverage" depends="instrument,test,coverage-report"
description="Run instrumented tests and generate coverage report"/>
<target name="test" depends="build" description="Run JUnit tests">
<junit printsummary="yes" haltonfailure="yes" forkmode="once" fork="true"
dir="${basedir}" maxmemory="512m">
<jvmarg line="${java.modules}"/>
<sysproperty key="net.sourceforge.cobertura.datafile"
file="${build-instrument.dir}/cobertura.ser"/>
<classpath refid="adaptorlib.run.classpath"/>
<classpath refid="examples.run.classpath"/>
<classpath refid="cobertura.classpath"/>
<classpath refid="junit.classpath"/>
<classpath location="${build-instrument.dir}"/>
<classpath location="${build-src.dir}"/>
<classpath location="${build-test.dir}"/>
<classpath location="${resource.dir}"/>
<classpath location="${test-resource.dir}"/>
<formatter type="plain" usefile="false"/>
<formatter classname="JUnitLogFixFormatter" usefile="false"/>
<batchtest>
<fileset dir="${test.dir}">
<include name="**/${test.class}.java"/>
<exclude name="**/experimental/**"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="sim-test" depends="build">
<junit printsummary="yes" haltonfailure="yes" forkmode="once" fork="true"
dir="${basedir}" maxmemory="512m">
<classpath refid="junit.classpath"/>
<classpath location="${build-src.dir}"/>
<classpath refid="adaptorlib.run.classpath"/>
<classpath location="${build-test.dir}"/>
<classpath location="${lib.dir}/commons-fileupload-1.3.jar"/>
<formatter type="plain" usefile="false"/>
<formatter classname="JUnitLogFixFormatter" usefile="false"/>
<batchtest>
<fileset dir="${test.dir}">
<include name="**/experimental/SimTest.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="instrument" depends="build" description="Instrument classes">
<taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>
<cobertura-instrument datafile="${build-instrument.dir}/cobertura.ser"
todir="${build-instrument.dir}">
<fileset dir="${build-src.dir}">
<include name="${adaptor.pkg.dir}/**"/>
</fileset>
</cobertura-instrument>
</target>
<target name="clean-instrument" unless="instrument.uptodate"
description="Delete instrumented classes">
<delete dir="${build-instrument.dir}"/>
</target>
<target name="coverage-report" description="Generates code coverage report">
<taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>
<cobertura-report datafile="${build-instrument.dir}/cobertura.ser"
srcdir="${src.dir}" destdir="${build.dir}/coverage"/>
</target>
<!-- Eclipse: run 'ant eclipse' to generate Eclipse project files -->
<target name="eclipse" depends="clean-eclipse">
<taskdef name="eclipse" classname="prantl.ant.eclipse.EclipseTask">
<classpath>
<pathelement location="${lib.dir}/ant-eclipse-jvm1.2-1.0.jar"/>
</classpath>
</taskdef>
<eclipse mode="java">
<project name="gsa-adaptors-library"/>
<classpath>
<output path="build/"/>
<source path="${src.dir}" output="build/src"/>
<source path="${test.dir}" output="build/test"/>
<library pathref="adaptorlib.build.classpath"/>
<library pathref="examples.build.classpath"/>
<library pathref="junit.classpath"/>
<library path="${lib.dir}/commons-fileupload-1.3.jar"/>
<library pathref="adaptorlib.run.classpath"/>
<library pathref="examples.run.classpath"/>
<library path="${resource.dir}"/>
<library path="${test-resource.dir}"/>
</classpath>
</eclipse>
</target>
<target name="clean-eclipse">
<delete dir="bin" includeEmptyDirs="true"/>
<delete file=".classpath"/>
<delete file=".project"/>
</target>
<target name="clean-all" depends="clean,clean-instrument,clean-eclipse"
description="deep clean">
</target>
</project>