-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.xml
753 lines (669 loc) · 33.8 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
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
<?xml version="1.0"?>
<!--
'$RCSfile: build.xml,v $'
Copyright: 1997-2002 Regents of the University of California,
University of New Mexico, and
Arizona State University
Sponsors: National Center for Ecological Analysis and Synthesis and
Partnership for Interdisciplinary Studies of Coastal Oceans,
University of California Santa Barbara
Long-Term Ecological Research Network Office,
University of New Mexico
Center for Environmental Studies, Arizona State University
Other funding: National Science Foundation (see README for details)
The David and Lucile Packard Foundation
For Details: http://knb.ecoinformatics.org/
'$Author: obrien $'
'$Date: 2009-02-26 00:16:16 $'
'$Revision: 1.112 $'
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<project name="eml" default="docs" basedir=".">
<!-- Allow integration with Git projects -->
<macrodef name = "git">
<attribute name = "command" />
<attribute name = "dir" default = "" />
<element name = "args" optional = "true" />
<sequential>
<echo message = "git @{command}" />
<exec executable = "git" dir = "@{dir}">
<arg value = "@{command}" />
<args/>
</exec>
</sequential>
</macrodef>
<macrodef name = "git-clone-pull">
<attribute name = "repository" />
<attribute name = "dest" />
<attribute name = "refname" />
<sequential>
<git command = "clone">
<args>
<arg value = "@{repository}" />
<arg value = "@{dest}" />
</args>
</git>
<git command = "checkout" dir = "@{dest}">
<args>
<arg value = "@{refname}" />
</args>
</git>
<git command = "pull" dir = "@{dest}" >
<args>
<arg value = "@{repository}" />
<arg value = "@{refname}" />
</args>
</git>
</sequential>
</macrodef>
<macrodef name = "checkout-and-copy">
<attribute name = "dest" />
<attribute name = "refname" />
<attribute name = "target" />
<attribute name = "xsd" default = "" />
<sequential>
<echo>Getting EML from source: @{refname}</echo>
<git command = "checkout" dir = "@{dest}">
<args>
<arg value = "@{refname}" />
</args>
</git>
<mkdir dir="@{target}" />
<copy todir="@{target}" filtering="yes">
<fileset dir="@{dest}/@{xsd}">
<include name="*.xsd"/>
</fileset>
</copy>
</sequential>
</macrodef>
<target name="config">
<property file="build.properties"/>
<!-- User specified properties -->
<!-- These are properties you'll need to change to install the parser
servlet on your system. -->
<!-- where to install the servlet -->
<!--<property name="servlet.install.dir" value="/var/www/org.ecoinformatics.knb/emlparser"/>-->
<!--<property name="servlet.install.dir" value="/var/lib/tomcat6/webapps/emlparser"/>-->
<property name="servlet.install.dir" value="build/emlparser"/>
<!-- the server the servlet will run on -->
<property name="server" value="https://knb.ecoinformatics.org"/>
<!--the servlet context directory-->
<property name="servletdir" value="emlparser"/>
<!-- the path to the servlet from the servletdir -->
<property name="servletpath" value="/emlparser"/>
<property name="version" value="2.2.0"/>
<!-- namespaces that the servlet should auto resolve -->
<!-- LOCAL TEST VALUES -->
<property name="namespaces"
value="eml://ecoinformatics.org/eml-2.0.0 ${server}/${servletdir}/schema/eml-2.0.0/eml.xsd
eml://ecoinformatics.org/eml-2.0.1 ${server}/${servletdir}/schema/eml-2.0.1/eml.xsd
eml://ecoinformatics.org/eml-2.1.0 ${server}/${servletdir}/schema/eml-2.1.0/eml.xsd
eml://ecoinformatics.org/literature-2.1.0 ${server}/${servletdir}/schema/eml-2.1.0/eml-literature.xsd
eml://ecoinformatics.org/project-2.1.0 ${server}/${servletdir}/schema/eml-2.1.0/eml-project.xsd
eml://ecoinformatics.org/eml-2.1.1 ${server}/${servletdir}/schema/eml-2.1.1/eml.xsd
eml://ecoinformatics.org/literature-2.1.1 ${server}/${servletdir}/schema/eml-2.1.1/eml-literature.xsd
eml://ecoinformatics.org/project-2.1.1 ${server}/${servletdir}/schema/eml-2.1.1/eml-project.xsd
https://eml.ecoinformatics.org/eml-2.2.0 ${server}/${servletdir}/schema/eml-2.2.0/eml.xsd
http://www.xml-cml.org/schema/stmml-1.1 ${server}/${servletdir}/schema/eml-2.1.0/stmml.xsd
http://www.xml-cml.org/schema/stmml ${server}/${servletdir}/schema/eml-2.0.1/stmml.xsd" />
<!-- the path from the tomcat/bin directory to the config.xml file -->
<property name="servletconfigfile" value="${servlet.install.dir}/lib/config.xml"/>
<property name="servlettempdir" value="build/emlparser"/>
<filter token="tempdir" value="${servlettempdir}"/>
<property environment="env"/>
<property name="eml.git.repository.url" value="https://github.com/NCEAS/eml.git" />
<property name="eml-module" value="eml"/>
<property name="eml2_0_0-tag" value="RELEASE_EML_2_0_0_UPDATE_1"/>
<property name="eml2_0_1-tag" value="RELEASE_EML_2_0_1"/>
<property name="eml2_1_0-tag" value="RELEASE_EML_2_1_0"/>
<property name="eml2_1_1-tag" value="RELEASE_EML_2_1_1"/>
<property name="eml2_2_0-tag" value="BRANCH_EML_2_2"/>
</target>
<target name="init" depends="config">
<property name="name" value="eml"/>
<property name="eml-version" value="eml-${version}"/>
<property name="testdir" value="./src/test/java" />
<property name="test.resources.dir" value="./src/test/resources" />
<property name="srcdir" value="./src/main/java" />
<property name="src.resources.dir" value="./src/main/resources" />
<property name="invalid.dir" value="${test.resources.dir}/invalidEML"/>
<property name="build.dir" value="build"/>
<property name="build.tests" value="${build.dir}/tests"/>
<property name="build.src" value="${build.dir}/src"/>
<property name="build.dest" value="${build.dir}/classes"/>
<property name="build.docs" value="${build.dir}/docs"/>
<property name="build.javadocs" value="${build.dir}/javadocs"/>
<property name="build.stripped" value="stripped"/>
<property name="build.emlgit" value="${build.dir}/emlgit"/>
<property name="style.dir" value="./style"/>
<property name="config.file" value="${src.resources.dir}/config.xml"/>
<property name="xmlp" value="lib/xercesImpl-2.12.0.jar"/>
<property name="xml-apis" value="lib/xml-apis-1.4.01.jar"/>
<property name="serializer" value="lib/serializer-2.7.2.jar"/>
<property name="xalan" value="lib/xalan-2.7.2.jar"/>
<property name="itext" value="lib/iText-2.0.8.jar"/>
<property name="renderer" value="lib/core-renderer.jar"/>
<property name="renderer-min" value="lib/core-renderer-minimal.jar"/>
<property name="jtidy" value="lib/jtidy-r938.jar"/>
<property name="io" value="lib/commons-io-2.0.jar"/>
<property name="jdom" value="lib/jdom.jar"/>
<property name="cos" value="lib/cos.jar"/>
<property name="servlet" value="lib/apache/servlet.jar"/>
<property name="junit" value="lib/junit.jar"/>
<property name="utilities" value="lib/utilities.jar"/>
<property name="htmldocbook-style"
value="style/docbook-xsl-1.50.0/html/docbook.xsl"/>
<filter token="server" value="https://knb.ecoinformatics.org"/>
<filter token="docrooturl" value=""/>
<filter token="version" value="${version}"/>
<filter token="eml-version" value="${eml-version}"/>
<filter token="testdir" value="${test.resources.dir}" />
<filter token="srcdir" value="${srcdir}" />
<filter token="invalid.dir" value="${invalid.dir}" />
<filter token="config.file" value="${config.file}" />
<filter token="namespaces" value="${namespaces}"/>
<filter token="servletconfigfile" value="${servletconfigfile}"/>
<filter token="server" value="${server}"/>
<filter token="servletdir" value="${servletdir}"/>
<filter token="servletpath" value="${servletpath}"/>
<property name="release.dir" value="./release"/>
<property name="ver.dir" value="${release.dir}/eml-${version}"/>
<property name="ver.lib" value="${ver.dir}/lib"/>
<property name="ver.docs" value="${ver.dir}/docs"/>
<property name="ver.src" value="${ver.dir}/src"/>
<property name="ver.tst" value="${ver.dir}/test"/>
<property name="ver.site" value="${ver.dir}/site"/>
<property name="package.home" value="org/ecoinformatics" />
<property name="cpath" value="${utilities}:${servlet}:${cos}:${xalan}:${xml-apis}:${io}:${xmlp}:${serializer}:${jtidy}:${itext}:${renderer}:${renderer-min}:${jdom}:${junit}:${build.dir}/${name}.jar"/>
<!-- These two Data Manager Library properties need to be declared here
so that the Data Manager Library can be excluded from the default eml
distribution. Other Data Manager properties are declared in
the init-datamanager-lib target below. -->
<property name="datamanager.dir" value="org/ecoinformatics/datamanager"/>
<property name="datamanager.name" value="datamanager"/>
<mkdir dir="${build.docs}/eml-${version}"/>
</target>
<target name="release" depends="init">
<mkdir dir="${release.dir}"/>
<delete dir="${ver.dir}"/>
<mkdir dir="${ver.dir}"/>
<mkdir dir="${ver.lib}"/>
<mkdir dir="${ver.src}"/>
<mkdir dir="${ver.tst}"/>
<copy file="./build.xml" todir="${ver.dir}"/>
<copy file="./LICENSE" todir="${ver.dir}"/>
<copy file="./README.md" todir="${ver.dir}"/>
<copy todir="${ver.dir}" filtering="no">
<fileset dir=".">
<include name="*.xsd"/>
<include name="xsd/*.xsd"/>
<include name="eml-unitDictionary.xml"/>
<include name="eml-spatialReferenceDictionary.xml"/>
</fileset>
</copy>
<copy todir="${ver.lib}" filtering="no">
<fileset dir="./lib">
<exclude name="${datamanager.name}/**"/>
</fileset>
</copy>
<copy todir="${ver.src}" filtering="yes">
<fileset dir="${srcdir}">
<exclude name="emlconversions/**"/>
<exclude name="${datamanager.dir}/**"/>
</fileset>
</copy>
<copy todir="${ver.tst}" filtering="yes">
<fileset dir="./test">
<exclude name="${datamanager.dir}/**"/>
</fileset>
</copy>
<copy todir="${ver.docs}" filtering="no">
<fileset dir="docs"/>
</copy>
<exec dir="docs" executable="R" resolveexecutable="true">
<arg value="-f build_book.R"/>
</exec>
<copy todir="${ver.site}" filtering="no">
<fileset dir="dist"/>
</copy>
<delete file="${release.dir}/eml-${version}.zip"/>
<zip zipfile="${release.dir}/eml-${version}.zip" basedir="${release.dir}"/>
<delete file="${release.dir}/eml-${version}.tar.gz"/>
<tar tarfile="${release.dir}/eml-${version}.tar" basedir="${release.dir}"/>
<gzip zipfile="${release.dir}/eml-${version}.tar.gz" src="${release.dir}/eml-${version}.tar"/>
<delete file="${release.dir}/eml-${version}.tar"/>
</target>
<target name="buildenumerations" depends="init">
<style basedir="." style="getunits.xsl"
in="eml-unitDictionary.xml"
out="${build.docs}/eml-${version}/enumerations.xml"
classpath="${cpath}" processor="trax"/>
<echo>
************************************************
enumerations created.
see docs/eml-${version}/enumerations.xml
************************************************
</echo>
</target>
<target name="compile" depends="init">
<mkdir dir="${build.tests}"/>
<mkdir dir="${build.dest}"/>
<copy todir="${build.tests}" filtering="yes">
<fileset dir="${testdir}">
<exclude name="**/CVS*"/>
<exclude name="**/.#*"/>
<exclude name="${datamanager.dir}/**"/>
<exclude name="emlconversions/**"/>
</fileset>
</copy>
<echo>
************************************************
copied some stuff to ${build.tests}
************************************************
</echo>
<copy todir="${build.tests}" filtering="yes">
<fileset dir="${srcdir}">
<exclude name="**/CVS*"/>
<exclude name="**/.#*"/>
<exclude name="${datamanager.dir}/**"/>
<exclude name="emlconversions/**"/>
</fileset>
</copy>
<copy file ="${config.file}" todir="${build.dest}" filtering="yes"/>
<javac srcdir="${build.tests}"
destdir="${build.dest}"
classpath="${cpath}"
debug="on"/>
</target>
<target name="jar" depends="compile">
<jar jarfile="${build.dir}/${name}.jar"
basedir="${build.dest}"
includes="${package.home}/** config.xml"
excludes="${datamanager.dir}/**" />
<copy file="${build.dir}/${name}.jar" tofile="lib/${name}.jar"/>
</target>
<target name="compile-test" depends="jar">
<!-- copy and compile the tests into a jar file -->
<mkdir dir="${build.tests}"/>
<mkdir dir="${build.dest}"/>
<copy todir="${build.tests}" filtering="yes">
<fileset dir="${testdir}">
<exclude name="**/CVS*"/>
<exclude name="**/.#*"/>
<exclude name="${datamanager.dir}/**"/>
<exclude name="emlconversions/**"/>
</fileset>
</copy>
<javac srcdir="${build.tests}"
destdir="${build.dest}"
classpath="${cpath}"
debug="on"/>
<jar jarfile="${build.dir}/${name}-test.jar" basedir="${build.dest}"
includes="${package.home}/${name}test/**" />
</target>
<!-- use the ant "junit" task to run JUnit tests. -->
<target name="test" depends="compile-test">
<!--copy the unit dictionary so it will get validated-->
<copy file="eml-unitDictionary.xml" tofile="test/eml-unitDictionary.xml"/>
<echo>
************************************************
copied the unitDictionary
************************************************
</echo>
<!-- use the ant "junit" task to run JUnit tests. -->
<junit printsummary="yes" haltonfailure="no" fork="no" haltonerror="no" failureproperty="test.failed">
<classpath>
<pathelement path="${cpath}:${build.dir}/${name}-test.jar:${build.dir}/${name}.jar" />
</classpath>
<formatter type="plain" usefile="false"/>
<env key="EML_VERSION" value="${version}"/>
<batchtest fork="yes" todir="${build.dir}">
<fileset dir="${build.tests}">
<include name="**/*Test.java" />
<exclude name="${datamanager.dir}/**" />
</fileset>
</batchtest>
</junit>
<fail message="Test failure detected, check test results." if="test.failed" />
</target>
<target name="emlparsertest" depends="jar">
<junit printsummary="yes" haltonfailure="no" fork="no"
haltonerror="no">
<classpath>
<pathelement path="${cpath}:${build.dir}/${name}-test.jar:${build.dir}/${name}.jar" />
</classpath>
<formatter type="plain" />
<batchtest fork="yes" todir="${build.dir}">
<fileset dir="${build.tests}">
<include name="**/EMLParserTest.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="runonetest" depends="jar">
<!-- Prompt user for the test name. -->
<input
message="Please enter name of test to run: "
addproperty="testtorun"
defaultvalue="HtmlToPdfTest"
/>
<junit printsummary="yes" haltonfailure="no" fork="no"
haltonerror="no">
<classpath>
<pathelement path="${cpath}:${build.dir}/${name}-test.jar:${build.dir}/${name}.jar" />
</classpath>
<formatter type="plain" />
<batchtest fork="yes" todir="${build.dir}">
<fileset dir="${build.tests}">
<include name="**/${testtorun}.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="-check-clone" unless="clone.exists">
<available property="clone.exists" file="${build.emlgit}"/>
</target>
<target name="clone-eml" depends="-check-clone" unless="clone.exists">
<git-clone-pull repository="${eml.git.repository.url}" dest="${build.emlgit}" refname="${eml2_0_0-tag}" />
<available property="clone.exists" file="${build.emlgit}"/>
</target>
<target name="servletinstall" depends="jar, clone-eml" if="${clone.exists}">
<copy file="lib/emlparser.html" tofile="${servlet.install.dir}/index.html"/>
<mkdir dir="${servlet.install.dir}/docs" />
<copy file="lib/emlparser-docs.html" tofile="${servlet.install.dir}/docs/index.html"/>
<copy file="src/test/resources/eml-sample.xml"
tofile="${servlet.install.dir}/eml-sample.xml"/>
<copy file="${config.file}" tofile="${servlet.install.dir}/lib/config.xml" filtering="yes"/>
<copy file="lib/web.xml" tofile="${servlet.install.dir}/WEB-INF/web.xml"/>
<copy file="${cos}" tofile="${servlet.install.dir}/WEB-INF/lib/cos.jar"/>
<copy file="lib/eml.jar"
tofile="${servlet.install.dir}/WEB-INF/lib/eml.jar"/>
<copy file="${xalan}"
tofile="${servlet.install.dir}/WEB-INF/lib/xalan.jar"/>
<copy file="${xml-apis}"
tofile="${servlet.install.dir}/WEB-INF/lib/xml-apis.jar"/>
<copy file="${xmlp}"
tofile="${servlet.install.dir}/WEB-INF/lib/xercesImpl.jar"/>
<copy file="${utilities}"
tofile="${servlet.install.dir}/WEB-INF/lib/utilities.jar"/>
<!-- Copy eml-2.0.0 schema. Add code here for copying any other schemas. -->
<checkout-and-copy dest = "${build.emlgit}" refname = "${eml2_0_0-tag}" target = "${servlet.install.dir}/schema/eml-2.0.0" />
<!-- Copy eml-2.0.1 schema. Add code here for copying any other schemas. -->
<checkout-and-copy dest = "${build.emlgit}" refname = "${eml2_0_1-tag}" target = "${servlet.install.dir}/schema/eml-2.0.1" />
<!-- Copy eml-2.1.0 schema. Add code here for copying any other schemas. -->
<checkout-and-copy dest = "${build.emlgit}" refname = "${eml2_1_0-tag}" target = "${servlet.install.dir}/schema/eml-2.1.0" />
<!-- Copy eml-2.1.1 schema. Add code here for copying any other schemas. -->
<checkout-and-copy dest = "${build.emlgit}" refname = "${eml2_1_1-tag}" target = "${servlet.install.dir}/schema/eml-2.1.1" />
<!-- Copy eml-2.2.0 schema. Add code here for copying any other schemas. -->
<checkout-and-copy dest = "${build.emlgit}" refname = "${eml2_2_0-tag}" target = "${servlet.install.dir}/schema/eml-2.2.0" xsd="xsd" />
</target>
<target name="emlparser_war" depends="servletinstall">
<mkdir dir="${release.dir}" />
<war destfile="${release.dir}/${servletdir}.war"
webxml="${servlet.install.dir}/WEB-INF/web.xml">
<fileset dir="${servlet.install.dir}" />
<lib dir="${servlet.install.dir}/WEB-INF/lib" />
<webinf dir="${servlet.install.dir}/WEB-INF" />
</war>
</target>
<target name="clean" depends="init">
<delete dir="./build"/>
<delete file="${eml-version}.zip"/>
<delete file="${eml-version}.tar.gz"/>
<delete file="${datamanager.name}.zip"/>
<delete file="${datamanager.name}.tar.gz"/>
<delete file="${servlet.install.dir}/WEB-INF/lib/eml.jar"/>
</target>
<!--
The following set of targets support the Data Manager library:
init-datamanager-lib
compile-datamanager-lib
jar-datamanager-lib
dist-datamanager-lib
run-datamanager-one
test-datamanager-init (used internally only)
test-datamanager-all
test-datamanager-one
javadoc-datamanager-lib
Applications can use this library's API to manage EML data (as well as
other types of data). The library is currently housed under the 'eml'
module in SVN. At some point in the future, it may be broken out into its
own module.
-->
<target name="init-datamanager-lib" depends="init">
<property name="datamanager.lib" value="lib/datamanager"/>
<property name="version.datamanager" value="1.0.0"/>
<property name="datamanager-version" value="${datamanager.name}-${version.datamanager}"/>
<property name="ver.dir.datamanager" value="${release.dir}/${datamanager-version}"/>
<property name="ver.docs.datamanager" value="${ver.dir.datamanager}/docs"/>
<property name="ver.lib.datamanager" value="${ver.dir.datamanager}/${datamanager.lib}"/>
<property name="ver.src.datamanager" value="${ver.dir.datamanager}/src"/>
<!-- Used by 'test-datamanager-one' target. User is prompted for the name
of the test to run. If user enters no value, runs this test by
default. -->
<property name="default-datamanager-test" value="DataManagerTest" />
<property name="default-datamanager-run" value="org.ecoinformatics.datamanager.util.TableGenerator" />
<property name="axis" value="${datamanager.lib}/axis.jar"/>
<property name="discover" value="${datamanager.lib}/commons-discovery.jar"/>
<property name="ftp" value="${datamanager.lib}/commons-net-3.3.jar"/>
<property name="hsql" value="${datamanager.lib}/hsqldb.jar"/>
<property name="log" value="${datamanager.lib}/commons-logging.jar"/>
<property name="log4j" value="${datamanager.lib}/log4j-1.2.8.jar"/>
<property name="queryservice" value="${datamanager.lib}/org.ecoinformatics.ecogrid.QueryService-stub.jar"/>
<property name="authenticatedqueryservice" value="${datamanager.lib}/org.ecoinformatics.ecogrid.AuthenticatedQueryService-stub.jar"/>
<property name="authenticationservice" value="${datamanager.lib}/org.ecoinformatics.ecogrid.AuthenticationService-stub.jar"/>
<property name="putservice" value="${datamanager.lib}/org.ecoinformatics.ecogrid.PutService-stub.jar"/>
<!-- <property name="postgresql-driver" value="${datamanager.lib}/postgresql-8.0-312.jdbc3.jar"/> -->
<property name="postgresql-driver" value="${datamanager.lib}/postgresql-8.3-606.jdbc3.jar"/>
<property name="rpc" value="${datamanager.lib}/jaxrpc.jar"/>
<property name="saaj" value="${datamanager.lib}/saaj.jar"/>
<property name="soap" value="${datamanager.lib}/soap.jar"/>
<property name="tar" value="${datamanager.lib}/tar.jar"/>
<property name="wsdl" value="${datamanager.lib}/wsdl4j.jar"/>
<property name="cpath.datamanager"
value="${junit}:${axis}:${discover}:${ftp}:${hsql}:${log}:${log4j}:${postgresql-driver}:${queryservice}:${authenticatedqueryservice}:${authenticationservice}:${putservice}:${rpc}:${saaj}:${soap}:${tar}:${utilities}:${wsdl}:${io}:${xalan}:${xml-apis}"/>
</target>
<target name="compile-datamanager-lib" depends="init-datamanager-lib,compile">
<mkdir dir="${build.dest}"/>
<mkdir dir="${build.src}"/>
<copy todir="${build.src}" filtering="yes">
<fileset dir="${srcdir}">
<include name="${datamanager.dir}/**"/>
<exclude name="emlconversions/**"/>
<exclude name="org/ecoinformatics/eml/**"/>
<exclude name="**/CVS*"/>
<exclude name="**/.#*"/>
</fileset>
</copy>
<copy file="${src.resources.dir}/datamanager.properties" todir="${build.dest}" />
<copy file="${src.resources.dir}/endpoint.properties" todir="${build.dest}" />
<echo>"cpath.datamanager = ${cpath.datamanager}"</echo>
<javac srcdir="${build.src}"
destdir="${build.dest}"
classpath="${cpath.datamanager}"
debug="on"/>
</target>
<target name="jar-datamanager-lib" depends="clean,compile-datamanager-lib">
<jar jarfile="${build.dir}/${datamanager.name}.jar"
basedir="${build.dest}"
excludes="org/ecoinformatics/**/**Test.class"
/>
</target>
<target name="dist-datamanager-lib"
depends="jar-datamanager-lib,javadoc-datamanager-lib">
<mkdir dir="${release.dir}"/>
<delete dir="${ver.dir}"/>
<delete dir="${ver.dir.datamanager}"/>
<mkdir dir="${ver.dir.datamanager}"/>
<mkdir dir="${ver.dir.datamanager}/lib/apache"/>
<mkdir dir="${ver.dir.datamanager}/lib/sample"/>
<mkdir dir="${ver.lib.datamanager}"/>
<mkdir dir="${ver.docs.datamanager}"/>
<mkdir dir="${ver.src.datamanager}/${datamanager.dir}"/>
<copy file="./build.properties" todir="${ver.dir.datamanager}"/>
<copy file="./build.xml" todir="${ver.dir.datamanager}"/>
<!--
<copy file="./docs/datamanager/LICENSE" todir="${ver.dir.datamanager}"/>
<copy file="./docs/datamanager/README" todir="${ver.dir.datamanager}"/>
-->
<!-- Copy datamanager jar file to the top-level
distribution directory -->
<copy file="${build.dir}/${datamanager.name}.jar" filtering="no"
todir="${ver.dir.datamanager}"/>
<!-- Copy datamanager documents, excluding project management, to
the distribution documents directory -->
<copy todir="${ver.docs.datamanager}" filtering="no">
<fileset dir="docs/${datamanager.name}">
<exclude name="projectManagement/**"/>
</fileset>
</copy>
<!-- Copy datamanager javadocs to the distribution documents directory -->
<mkdir dir="${ver.docs.datamanager}/javadocs" />
<copy todir="${ver.docs.datamanager}/javadocs" filtering="no">
<fileset dir="${build.javadocs}">
</fileset>
</copy>
<!-- Copy datamanager jar files and properties file to
the distribution lib directory -->
<copy todir="${ver.lib.datamanager}" filtering="no">
<fileset dir="${datamanager.lib}">
<exclude name="*.jar"/>
<include name="datamanager.properties"/>
</fileset>
</copy>
<copy todir="${ver.dir.datamanager}/lib/sample" filtering="no">
<fileset dir="lib/sample">
<include name="eml-sample.xml"/>
</fileset>
</copy>
<!-- Copy datamanager source code to the distribution source directory -->
<copy todir="${ver.src.datamanager}/${datamanager.dir}" filtering="yes">
<fileset dir="${srcdir}/${datamanager.dir}"/>
</copy>
<!-- zip and tar/gzip the datamanager distribution -->
<delete file="./${datamanager-version}.zip"/>
<zip zipfile="./${datamanager-version}.zip" basedir="${ver.dir.datamanager}"/>
<delete file="./${datamanager-version}.tar.gz"/>
<tar tarfile="./${datamanager-version}.tar" basedir="${ver.dir.datamanager}"/>
<gzip zipfile="./${datamanager-version}.tar.gz" src="./${datamanager-version}.tar"/>
<delete file="./${datamanager-version}.tar"/>
</target>
<target name="run-datamanager-one" depends="jar-datamanager-lib">
<!-- Run one class in the data manager library. -->
<!-- Prompt user for the classname.
If user enters a null value, use the default-datamanager-test -->
<input
message="Please enter name of class to run: "
addproperty="class-to-run"
defaultvalue="${default-datamanager-run}"
/>
<input
message="Please enter arguments for the class: "
addproperty="class-to-run-args"
defaultvalue="tao.1.1 http://knb.ecoinformatics.org/knb/metacat sessionid"
/>
<!-- run the class -->
<java classname="${class-to-run}">
<arg line="${class-to-run-args}"/>
<classpath>
<pathelement path="${cpath.datamanager}:${build.dest}:${srcdir}" />
</classpath>
</java>
</target>
<target name="test-datamanager-init" depends="compile-datamanager-lib">
<!-- copy and compile the data manager tests prior to running "junit" -->
<copy todir="${build.src}" filtering="yes">
<fileset dir="${testdir}">
<include name="${datamanager.dir}/**"/>
<exclude name="emlconversions/**"/>
<exclude name="org/ecoinformatics/eml/**"/>
<exclude name="**/CVS*"/>
<exclude name="**/.#*"/>
</fileset>
</copy>
<javac srcdir="${build.src}"
destdir="${build.dest}"
classpath="${cpath.datamanager}"
debug="on"/>
</target>
<target name="test-datamanager-all" depends="test-datamanager-init">
<!-- use the ant "junit" task to run JUnit tests for data manager lib. -->
<junit printsummary="yes" haltonfailure="no" fork="yes"
haltonerror="no">
<classpath>
<pathelement path="${cpath.datamanager}:${build.dest}" />
</classpath>
<formatter type="plain" />
<batchtest fork="yes" todir="${build.dir}">
<fileset dir="${build.src}">
<include name="**/*Test.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="test-datamanager-one" depends="test-datamanager-init">
<!-- Run only one test in the data manager library. -->
<!-- Prompt user for the test name.
If user enters a null value, use the default-datamanager-test -->
<input
message="Please enter name of test to run: [${default-datamanager-test}]"
addproperty="test-to-run"
defaultvalue="${default-datamanager-test}"
/>
<!-- use the ant "junit" task to run a single test in data manager lib. -->
<junit printsummary="yes" haltonfailure="no" fork="yes"
haltonerror="no" showoutput="true" >
<classpath>
<pathelement path="${cpath.datamanager}:${build.dest}" />
</classpath>
<formatter type="plain" />
<batchtest fork="yes" todir="${build.dir}">
<fileset dir="${build.src}">
<include name="**/${test-to-run}.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="javadoc-datamanager-lib" depends="compile-datamanager-lib"
description="Generates javadoc documentation">
<mkdir dir="${build.javadocs}"/>
<javadoc packagenames="org.ecoinformatics.datamanager.*"
sourcepath="${build.src}"
destdir="${build.javadocs}"
author="true"
version="true"
use="true"
windowtitle="DataManager API"
doctitle="<h1>DataManager</h1>"
bottom="<i>Copyright © 2007 Regents of the University of California. All Rights Reserved.</i>">
<classpath path="${cpath.datamanager}"/>
</javadoc>
</target>
<!-- End of targets for Data Manager library -->
<target name="kepler-style-jar" depends="init" description="Generates a kepler-styles.jar for Kepler">
<mkdir dir="${build.dir}/kepler/style/eml-2.1.0"/>
<mkdir dir="${build.dir}/kepler/style/kepler"/>
<copy todir="${build.dir}/kepler/style/eml-2.1.0" filtering="yes">
<fileset dir="style/eml">
<include name="*.xsl" />
</fileset>
</copy>
<copy todir="${build.dir}/kepler/style/kepler" filtering="yes">
<fileset dir="../kepler/core/resources/style">
<include name="kepler.css" />
</fileset>
</copy>
<jar jarfile="${build.dir}/kepler/kepler-styles.jar"
basedir="${build.dir}/kepler"/>
</target>
</project>