-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild.xml
executable file
·1695 lines (1518 loc) · 71.9 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
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0"?>
<!--
* Authors: Matt Jones, Chad Berkley, Jivka Bojilova
* Copyright: 2000 Regents of the University of California and the
* National Center for Ecological Analysis and Synthesis
* For Details: http://www.nceas.ucsb.edu/
*
* Build file for the Ant cross-platform build system for metacat
* See http://jakarta.apache.org for details on Ant
*
* usage: ant [compile|jar|install|documentation]
*
* 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="metacat" default="jar" basedir="."
xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<property name="eml2-style-tag" value="RELEASE_EML_UTILS_1_1_2"/>
<property environment="env"/>
<property file="build.properties"/><!-- USER SPECIFIC PROPS -->
<!-- the target version for java compilation-->
<property name="java.target.version" value="${java.target}"/>
<!-- the source code version for java compilation-->
<property name="java.source.version" value="${java.target}"/>
<property name="metacatui-tag" value="${metacatui.tag}"/>
<!-- Configure the maven2 ant tasks -->
<path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.1.0.jar"/>
<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="antlib:org.apache.maven.artifact.ant"
classpathref="maven-ant-tasks.classpath"/>
<!-- Don't run setMavenHome target if maven.home is already set -->
<condition property="maven.home.isset">
<isset property="maven.home"/>
</condition>
<!-- defining the axis tasks -->
<path id="axis.ant.classpath">
<fileset dir="lib/lsid_lib">
<include name="*.jar"/>
</fileset>
</path>
<!-- 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="-b"/>
<arg value="@{refname}"/>
<arg value="--depth"/>
<arg value="1"/>
<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>
<!-- added to silence: "warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last;
set to false for repeatable builds" since ant 9. See https://ant.apache.org/manual/Tasks/javac.html -->
<presetdef name="javac">
<javac includeantruntime="false" />
</presetdef>
<!-- get metacatUI project -->
<target name="getMetacatUI" depends="init">
<git-clone-pull repository="${metacatui.git.repository.url}" dest="${metacatui.build.dir}"
refname="${metacatui.git.repository.refname}"/>
</target>
<target name="build-metacat-ui" description="Calls the Maven build for metacatUI war" depends="getMetacatUI"
unless="build-metacat-ui-called">
<war destfile="${dist.dir}/${metacatui.war.name}" needxmlfile="false">
<fileset dir="${metacatui.war.resources.dir}"/>
</war>
<property name="build-metacat-ui-called" value="true"/>
</target>
<taskdef resource="axis-tasks.properties"
classpathref="axis.ant.classpath"/>
<available file="${build.tomcat.dir}/common/lib/servlet-api.jar"
property="tomcat.common.exists"/>
<!--
Attempt to find and set the path to Maven
Prefers, in this order:
- The value set in build.properties. The reason is that this
build file loads all properties from build.properties and properties are
immutable, so it's easiest to just use the same precedence chain.
- The value set in the $MAVEN_HOME environmental variable.
- The value found via the shell magic in the <exex> below.
-->
<target name="setMavenHome" unless="${maven.home.isset}">
<exec executable="sh" resultproperty="which.mvn" failifexecutionfails="false">
<arg value="-c"/>
<arg value="which mvn"/>
<redirector outputproperty="which.mvn.output"/>
</exec>
<exec executable="sh" resultproperty="which.mvn3" failifexecutionfails="false">
<arg value="-c"/>
<arg value="which mvn3"/>
<redirector outputproperty="which.mvn3.output"/>
</exec>
<exec executable="sh" resultproperty="exec.mvn.status" failifexecutionfails="false">
<arg value="-c"/>
<arg value="mvn --version | grep 'Maven home' | cut -d' ' -f3"/>
<redirector outputproperty="found.maven.home"/>
</exec>
<exec executable="sh" resultproperty="exec.mvn3.status" failifexecutionfails="false">
<arg value="-c"/>
<arg value="mvn3 --version | grep 'Maven home' | cut -d' ' -f3"/>
<redirector outputproperty="found.maven3.home"/>
</exec>
<exec executable="sh" resultproperty="exec.mvn2.status" failifexecutionfails="false">
<arg value="-c"/>
<arg value="dpkg-query -L maven2 | grep '/boot$' | cut -d'/' -f1-4"/>
<redirector outputproperty="found.maven2.home"/>
</exec>
<!-- Use value set in $MAVEN_HOME if maven.home isn't already set -->
<condition property="isset.env.MAVEN_HOME">
<isset property="env.MAVEN_HOME"/>
</condition>
<condition property="maven.home" value="${env.MAVEN_HOME}">
<and>
<not>
<isset property="maven.home"/>
</not>
<isset property="isset.env.MAVEN_HOME"/>
</and>
</condition>
<!-- Fall back to the found value via the above <exex> for mvn3 -->
<condition property="maven.home" value="${found.maven3.home}">
<and>
<not>
<isset property="maven.home"/>
</not>
<equals arg1="${which.mvn3}" arg2="0"/>
</and>
</condition>
<!-- Fall back to the found value via the above <exex> mvn -->
<condition property="maven.home" value="${found.maven.home}">
<and>
<not>
<isset property="maven.home"/>
</not>
<not>
<!-- Helps this condition fall through to find maven 2, below -->
<equals arg1="${found.maven.home}" arg2=""/>
</not>
<equals arg1="${which.mvn}" arg2="0"/>
</and>
</condition>
<!-- Fall back to the found value via the above <exex> mvn when version 2 is installed -->
<condition property="maven.home" value="${found.maven2.home}">
<and>
<not>
<isset property="maven.home"/>
</not>
<equals arg1="${which.mvn}" arg2="0"/>
</and>
</condition>
<!-- Fail the task if maven.home never got set -->
<condition property="maven.home.is.set">
<isset property="maven.home"/>
</condition>
<fail message="Couldn't find Maven home. Either: (1) Set maven.home in build.properties, (2) set $MAVEN_HOME, or (3) put mvn in your $PATH."
unless="maven.home.is.set"/>
<echo message="Setting Maven home (maven.home) to '${maven.home}'."/>
</target>
<target name="config" depends="setMavenHome,setTomcatCommon, setTomcatNoCommon">
<!-- usr for client testing, generally you don't need change-->
<property name="mcuser"
value="uid=kepler,o=unaffiliated,dc=ecoinformatics,dc=org"/>
<property name="mcpassword" value="kepler"/>
<property name="mcanotheruser"
value="uid=tao,o=NCEAS,dc=ecoinformatics,dc=org"/>
<property name="mcanotherpassword" value="yourpass"/>
<property name="piscouser"
value="uid=tao,o=PISCO,dc=ecoinformatics,dc=org"/>
<property name="piscopassword" value="yourpass"/>
<property name="lteruser"
value="uid=jtao,o=LTER,dc=ecoinformatics,dc=org"/>
<property name="lterpassword" value="yourpass"/>
<property name="debug" value="on"/>
<property name="morphosourcedir" value="../morpho"/>
<property name="installdir"
value="${app.deploy.dir}/${metacat.context}"/>
<echo>*********** set jsdk to ${jsdk}</echo>
</target>
<target name="setTomcatCommon" if="tomcat.common.exists">
<property name="jsdk"
value="${build.tomcat.dir}/common/lib/servlet-api.jar"/>
</target>
<target name="setTomcatNoCommon" unless="tomcat.common.exists">
<property name="jsdk"
value="${build.tomcat.dir}/lib/servlet-api.jar"/>
</target>
<target name="init" depends="config, build-metacat-common" unless="init.called">
<property name="libdir.mvn" value="lib/maven"/>
<delete dir="${libdir.mvn}"/>
<mkdir dir="${libdir.mvn}"/>
<path id="base.classpath">
<pathelement location="${jsdk}"/>
<pathelement location="lib"/>
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
<fileset dir="lib/lsid_lib">
<include name="*.jar"/>
</fileset>
<!-- Include everything from maven -->
<fileset dir="${libdir.mvn}">
<include name="*.jar"/>
</fileset>
</path>
<path id="test.classpath">
<pathelement location="${jsdk}"/>
<pathelement location="lib"/>
<fileset dir="lib">
<include name="*.jar"/>
<exclude name="maven-ant-tasks-2.1.0.jar"/>
</fileset>
<fileset dir="lib/lsid_lib">
<include name="*.jar"/>
</fileset>
<!-- Include maven -->
<fileset dir="${libdir.mvn}">
<include name="*.jar"/>
</fileset>
</path>
<!-- define the maven tasks -->
<taskdef uri="antlib:org.apache.maven.artifact.ant"
resource="org/apache/maven/artifact/ant/antlib.xml"
classpathref="base.classpath"/>
<echo>getting to resolve maven dependencies</echo>
<!-- Resolve maven dependencies -->
<artifact:pom id="metacatPom" file="pom.xml"/>
<echo>done with pom</echo>
<artifact:dependencies filesetId="dependency.fileset" pomrefid="metacatPom" usescope="runtime"/>
<echo>done with filesetId</echo>
<artifact:dependencies pathId="dependency.classpath" pomrefid="metacatPom"/>
<echo>done with resolving maven dependencies</echo>
<!-- combine base and dependencies for the classpath -->
<path id="compile.classpath">
<path refid="base.classpath"/>
<path refid="dependency.classpath"/>
</path>
<!-- It is less likely you'll need to make any changes from here down,
but customization is possible -->
<property name="name" value="metacat"/>
<property name="Name" value="MetaCat"/>
<property name="debugprefix" value="${Name}:"/>
<property name="release" value="${metacat.version}"/>
<tstamp>
<format property="copyrightyear" pattern="yyyy" locale="en,US"/>
</tstamp>
<property name="copyright" value="${copyrightyear} Regents of the University of California"/>
<property name="style-common-relpath" value="/style/common"/>
<property name="style-shared-relpath" value="/style/shared"/>
<property name="schema-relpath" value="/schema"/>
<property name="style-common-cvsrelpath"
value="lib${style-common-relpath}"/>
<property name="schema-cvsrelpath" value="lib${schema-relpath}"/>
<property name="style-skins-relpath" value="/style/skins"/>
<property name="eml.git.repository.url" value="https://github.com/NCEAS/eml.git"/>
<property name="eml-module" value="eml"/>
<property name="eml-version" value="2.0.0beta6"/>
<property name="eml-beta4-version" value="2.0.0beta4"/>
<property name="eml-beta-tag" value="BRANCH_EML_2_0_0_BETA_6_FOR_METACAT"/>
<property name="eml-beta4-tag" value="RELEASE_EML_2_BETA_4"/>
<property name="eml2_0_0-schema-tag" value="RELEASE_EML_2_0_0_UPDATE_1"/>
<property name="eml2_0_1-schema-tag" value="RELEASE_EML_2_0_1"/>
<property name="eml2_1_0-schema-tag" value="RELEASE_EML_2_1_0"/>
<property name="eml2_1_1-schema-tag" value="RELEASE_EML_2_1_1"/>
<property name="eml2_2_0-schema-tag" value="RELEASE_EML_2_2_0"/>
<property name="eml2_0_0namespace"
value="eml://ecoinformatics.org/eml-2.0.0"/>
<property name="eml2_0_1namespace"
value="eml://ecoinformatics.org/eml-2.0.1"/>
<property name="eml2_1_0namespace"
value="eml://ecoinformatics.org/eml-2.1.0"/>
<property name="eml2_1_1namespace"
value="eml://ecoinformatics.org/eml-2.1.1"/>
<property name="eml2_2_0namespace"
value="https://eml.ecoinformatics.org/eml-2.2.0"/>
<property name="stmmlnamespace"
value="http://www.xml-cml.org/schema/stmml"/>
<property name="stmml11namespace"
value="http://www.xml-cml.org/schema/stmml-1.1"/>
<property name="collections1_0_0namespace"
value="https://purl.dataone.org/collections-1.0.0"/>
<property name="portals1_0_0namespace"
value="https://purl.dataone.org/portals-1.0.0"/>
<property name="eml-css" value="eml_xsl.css"/>
<property name="eml-module.default.css" value="default.css"/>
<property name="systemidserver" value=""/>
<property name="html-path" value=""/>
<property name="metacat-properties-file" value="build/war/WEB-INF/metacat.properties"/>
<!-- Config for registry variables -->
<!-- TODO: SCW remove these, covered in metacat.properties or in skin.properties -->
<property name="scope" value="obfs"/>
<property name="responseForm" value="genericResponse.tmpl"/>
<property name="entryForm" value="entryForm.tmpl"/>
<property name="guide" value="genericGuide.tmpl"/>
<property name="loginForm" value="loginForm.tmpl"/>
<property name="confirmData" value="confirmData.tmpl"/>
<property name="deleteData" value="deleteData.tmpl"/>
<property name="genericHeader" value="genericHeader.tmpl"/>
<property name="genericFooter" value="genericFooter.tmpl"/>
<filter token="scope" value="${scope}"/>
<filter token="responseForm" value="${responseForm}"/>
<filter token="entryForm" value="${entryForm}"/>
<filter token="guide" value="${guide}"/>
<filter token="loginForm" value="${loginForm}"/>
<filter token="confirmData" value="${confirmData}"/>
<filter token="deleteData" value="${deleteData}"/>
<filter token="genericHeader" value="${genericHeader}"/>
<filter token="genericFooter" value="${genericFooter}"/>
<filter token="adminname" value="${adminname}"/>
<filter token="recipient" value="${recipient}"/>
<filter token="metacatVersion" value="${metacat.version}"/>
<filter token="metacatRC" value="${metacat.releaseCandidate}"/>
<filter token="build.context" value="${metacat.context}"/>
<filter token="docrooturl" value="./"/>
<filter token="mcuser" value="${mcuser}"/>
<filter token="mcpassword" value="${mcpassword}"/>
<filter token="mcanotheruser" value="${mcanotheruser}"/>
<filter token="mcanotherpassword" value="${mcanotherpassword}"/>
<filter token="eml-css" value="${eml-css}"/>
<filter token="style-skins-relpath"
value="${style-skins-relpath}"/>
<filter token="style-common-relpath"
value="${style-common-relpath}"/>
<filter token="eml-version" value="${eml-version}"/>
<filter token="eml-beta4-version" value="${eml-beta4-version}"/>
<filter token="eml2_0_0namespace" value="${eml2_0_0namespace}"/>
<filter token="eml2_0_1namespace" value="${eml2_0_1namespace}"/>
<filter token="eml2_1_0namespace" value="${eml2_1_0namespace}"/>
<filter token="eml2_1_1namespace" value="${eml2_1_1namespace}"/>
<filter token="eml2_2_0namespace" value="${eml2_2_0namespace}"/>
<filter token="stmmlnamespace" value="${stmmlnamespace}"/>
<filter token="stmml11namespace" value="${stmml11namespace}"/>
<filter token="collections1_0_0namespace" value="${collections1_0_0namespace}"/>
<filter token="portals1_0_0namespace" value="${portals1_0_0namespace}"/>
<filter token="debugprefix" value="${debugprefix}"/>
<filter token="defaultStage" value="${defaultStage}"/>
<filter token="defaultHeader" value="${defaultHeader}"/>
<filter token="defaultFooter" value="${defaultFooter}"/>
<filter token="defaultChangePass" value="${defaultChangePass}"/>
<filter token="defaultResetPass" value="${defaultResetPass}"/>
<filter token="changePassSuccess" value="${changePassSuccess}"/>
<filter token="resetPassSuccess" value="${resetPassSuccess}"/>
<filter token="registerFailed" value="${registerFailed}"/>
<filter token="registerLter" value="${registerLter}"/>
<filter token="registerMatch" value="${registerMatch}"/>
<filter token="registerSuccess" value="${registerSuccess}"/>
<filter token="register" value="${register}"/>
<filter token="searchResults" value="${searchResults}"/>
<filter token="ldapMainServerFailure"
value="${ldapMainServerFailure}"/>
<filter token="lter-user" value="${lteruser}"/>
<filter token="lter-pass" value="${lterpassword}"/>
<filter token="pisco-user" value="${piscouser}"/>
<filter token="pisco-pass" value="${piscopassword}"/>
<property name="srcdir" value="./src"/>
<property name="lib.dir" value="./lib"/>
<property name="docdir" value="./docs"/>
<property name="cgidir" value="./cgi-bin"/>
<property name="testdir" value="./test"/>
<property name="testtorun" value="MNodeServiceTest"/>
<property name="junittestsdir"
value="./test/edu/ucsb/nceas/metacattest"/>
<property name="junitnettestsdir"
value="./test/edu/ucsb/nceas/metacatnettest"/>
<property name="classtorun" value="edu.ucsb.nceas.metacat.admin.upgrade.dataone.GenerateSystemMetadata"/>
<property name="build.dir" value="./build"/>
<property name="build.src" value="${build.dir}/src"/>
<property name="build.dest" value="${build.dir}/classes"/>
<property name="build.samples" value="${build.dir}/samples"/>
<property name="build.tests" value="${build.dir}/tests"/>
<property name="build.tmp" value="${build.dir}/tmp"/>
<property name="build.metacattest"
value="${build.tests}/metacattest"/>
<property name="build.metacatnettest"
value="${build.tests}/metacatnettest"/>
<property name="build.data" value="${build.dir}/data"/>
<property name="build.docs" value="${build.dir}/docs"/>
<property name="build.javadocs" value="${build.docs}/api"/>
<property name="build.war" value="${build.dir}/war"/>
<property name="dist.dir" value="dist"/>
<property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
<property name="ver.src" value="${ver.dir}/src"/>
<property name="ver.test" value="${ver.dir}/test"/>
<property name="test.dir" value="${dist.dir}/test"/>
<!-- directories for creating a Harvest List Editor distribution -->
<property name="dist.dir.hle" value="disthle"/>
<property name="ver.dir.hle"
value="${dist.dir.hle}/harvest-list-editor-${release}"/>
<property name="pkg.dir" value="./package"/>
<property name="deb.pkg.dir" value="${pkg.dir}/debian"/>
<property name="package.home" value="edu/ucsb/nceas/metacat"/>
<!-- set up svn -->
<property name="svnant.lib" value="lib"/>
<property name="svnant.jar" value="${svnant.lib}/svnant.jar"/>
<property name="svnClientAdapter.jar"
value="${svnant.lib}/svnClientAdapter.jar"/>
<property name="svnjavahl.jar"
value="${svnant.lib}/svnjavahl.jar"/>
<!-- the git repo for metacatUI-->
<property name="metacatui.git.repository.url"
value="https://github.com/NCEAS/metacatui.git"/>
<property name="metacatui.git.repository.refname"
value="${metacatui-tag}"/>
<property name="metacatui.build.dir"
value="${build.dir}/metacatui_build"/>
<property name="metacatui.war.name"
value="metacatui.war"/>
<property name="metacatui.war.resources.dir"
value="${metacatui.build.dir}/src"/>
<!-- load the svn task -->
<path id="svn.classpath">
<pathelement location="${svnjavahl.jar}"/>
<pathelement location="${svnant.jar}"/>
<pathelement location="${svnClientAdapter.jar}"/>
</path>
<taskdef resource="svntask.properties"
classpathref="svn.classpath"/>
<condition property="eml.required">
<or>
<not>
<available file="lib/schema/eml-2.1.1/eml.xsd"/>
</not>
<not>
<available file="lib/schema/eml-2.1.0/eml.xsd"/>
</not>
<not>
<available file="lib/schema/eml-2.0.1/eml.xsd"/>
</not>
<not>
<available file="lib/schema/eml-2.0.0/eml.xsd"/>
</not>
<not>
<available
file="lib/dtd/eml-dataset-2.0.0beta6.dtd"/>
</not>
</or>
</condition>
<property name="init.called" value="true"/>
</target>
<target name="resolveDependencies" depends="init" description="retrieve dependencies with maven">
<echo>Moving Maven dependencies (${dependency.fileset}) to ${libdir.mvn}</echo>
<!-- Clear out mvn dir -->
<delete dir="${libdir.mvn}"/>
<!-- Copy all dependencies to the correct location. -->
<copy todir="${libdir.mvn}">
<fileset refid="dependency.fileset"/>
<!-- This mapper strips off all leading directory information -->
<mapper type="flatten"/>
</copy>
</target>
<target name="prepare" depends="init, resolveDependencies">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.src}"/>
<mkdir dir="${build.dest}"/>
<mkdir dir="${build.docs}"/>
<mkdir dir="${build.javadocs}"/>
<mkdir dir="${build.tmp}"/>
<copy todir="${build.src}" filtering="yes">
<fileset dir="${srcdir}">
<include name="edu/**"/>
<include name="com/**"/>
<include name="org/**"/>
<!-- include name="java/**" / -->
<include name="**/*.sql"/>
<exclude name="**/CVS*"/>
<exclude name="**/.#*"/>
<exclude name="edu/ucsb/nceas/workflowscheduler/**"/>
</fileset>
</copy>
<available file="lib/style/common/emlb6toeml2" type="dir"
property="styles.not.needed"/>
</target>
<target name="compile" depends="prepare"
description="Compiles java code to build dir, and copies metacat props files there">
<javac srcdir="${build.src}" destdir="${build.dest}"
target="${java.target.version}"
source="${java.source.version}"
debug="${debug}"
excludes="**/*.sql **/client/*.java **/harvesterClient/*.java">
<classpath>
<path refid="compile.classpath"/>
</classpath>
</javac>
</target>
<target name="jar" depends="compile,geteml"
description="Compiles and jars metacat java code to metacat.jar in build dir ">
<delete file="${build.dir}/${name}.jar"/>
<jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
excludes="**/protocols/ **/harvesterClient/"/>
</target>
<target name="protocol" depends="compile"
description="Compiles and jars protocol java code to protocol.jar in build dir">
<delete file="${build.dir}/protocol.jar"/>
<jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
includes="**/protocols/"/>
</target>
<target name="client" depends="prepare"
description="Compiles metacat-client java code to build dir">
<javac srcdir="${build.src}" destdir="${build.dest}"
target="${java.target.version}"
source="${java.source.version}"
includes="edu/ucsb/nceas/metacat/client/*">
<classpath>
<path refid="compile.classpath"/>
</classpath>
</javac>
</target>
<target name="clientjar" depends="client"
description="Compiles and jars metacat-client java code to metacat-client.jar in build dir">
<delete file="${build.dir}/${name}-client.jar"/>
<jar jarfile="${build.dir}/${name}-client.jar"
basedir="${build.dest}" includes="**/metacat/client/"/>
</target>
<target name="harvester" depends="client"
description="Compiles harvester java code to build dir">
<javac srcdir="${build.src}" destdir="${build.dest}"
target="${java.target.version}"
source="${java.source.version}"
includes="edu/ucsb/nceas/metacat/harvesterClient/*">
<classpath>
<path refid="compile.classpath"/>
</classpath>
</javac>
</target>
<target name="harvesterjar" depends="harvester"
description="Compiles and jars harvester java code to harvester.jar in build dir">
<delete file="${build.dir}/harvester.jar"/>
<jar jarfile="${build.dir}/harvester.jar"
basedir="${build.dest}" includes="**/metacat/harvesterClient/"/>
</target>
<target name="harvestListEditorDist" depends="harvesterjar"
description="Prepares a distribution of the Harvest List Editor tool">
<mkdir dir="${dist.dir.hle}"/>
<delete dir="${ver.dir.hle}"/>
<mkdir dir="${ver.dir.hle}"/>
<copy todir="${ver.dir.hle}" file="${build.dir}/harvester.jar"/>
<copy todir="${ver.dir.hle}" file="lib/xercesImpl.jar"/>
<copy todir="${ver.dir.hle}"
file="lib/harvester/harvestList.xsd"/>
<copy todir="${ver.dir.hle}"
file="lib/harvester/harvestListEditor.bat"/>
<copy todir="${ver.dir.hle}"
file="lib/harvester/harvestListEditor.sh"/>
<delete file="./harvest-list-editor-${release}.zip"/>
<zip zipfile="./harvest-list-editor-${release}.zip"
basedir="${ver.dir.hle}"/>
<delete file="./harvest-list-editor-${release}.tar.gz"/>
<tar tarfile="./harvest-list-editor-${release}.tar"
basedir="${ver.dir.hle}"/>
<gzip zipfile="./harvest-list-editor-${release}.tar.gz"
src="./harvest-list-editor-${release}.tar"/>
<delete file="./harvest-list-editor-${release}.tar"/>
</target>
<target name="geteml" depends="getemlpre2,getemlpre2beta4,geteml2+,getConversionXSL"
if="eml.required" description="Calls getemlpre2 and geteml2+ targets"/>
<target name="getemlpre2" depends="prepare,giteml" if="eml.required"
description="Checks EML-beta6 out of svn and copies dtds and xsl to your metacat sandbox">
<mkdir dir="lib/dtd"/>
<copy todir="lib/dtd" filtering="yes">
<fileset
dir="${build.tmp}/eml_${eml-beta-tag}">
<include name="*.dtd"/>
</fileset>
<mapper type="glob" from="eml-*.dtd"
to="eml-*-${eml-version}.dtd"/>
</copy>
<copy todir="${style-common-cvsrelpath}" filtering="yes">
<fileset
dir="${build.tmp}/eml_${eml-beta-tag}/style">
<include name="**/*.xsl"/>
</fileset>
</copy>
</target>
<target name="getemlpre2beta4" depends="prepare" if="eml.required"
description="Checks EML-beta4 out of svn and copies dtds to your metacat sandbox">
<mkdir dir="lib/dtd"/>
<copy todir="lib/dtd" filtering="yes">
<fileset
dir="${build.tmp}/eml_${eml-beta4-tag}">
<include name="*.dtd"/>
</fileset>
<mapper type="glob" from="eml-*.dtd"
to="eml-*-${eml-beta4-version}.dtd"/>
</copy>
</target>
<target name="giteml" depends="prepare" if="eml.required"
description="Git clone EML code from various tagged releases of the EML git repository">
<git-clone-pull repository="${eml.git.repository.url}"
dest="${build.tmp}/eml_${eml-beta4-tag}" refname="${eml-beta4-tag}"/>
<git-clone-pull repository="${eml.git.repository.url}"
dest="${build.tmp}/eml_${eml-beta-tag}" refname="${eml-beta-tag}"/>
<git-clone-pull repository="${eml.git.repository.url}"
dest="${build.tmp}/eml_${eml2_0_0-schema-tag}" refname="${eml2_0_0-schema-tag}"/>
<git-clone-pull repository="${eml.git.repository.url}"
dest="${build.tmp}/eml_${eml2_0_1-schema-tag}" refname="${eml2_0_1-schema-tag}"/>
<git-clone-pull repository="${eml.git.repository.url}"
dest="${build.tmp}/eml_${eml2_1_0-schema-tag}" refname="${eml2_1_0-schema-tag}"/>
<git-clone-pull repository="${eml.git.repository.url}"
dest="${build.tmp}/eml_${eml2_1_1-schema-tag}" refname="${eml2_1_1-schema-tag}"/>
<git-clone-pull repository="${eml.git.repository.url}"
dest="${build.tmp}/eml_${eml2-style-tag}" refname="${eml2-style-tag}"/>
<git-clone-pull repository="${eml.git.repository.url}"
dest="${build.tmp}/eml_${eml2_2_0-schema-tag}" refname="${eml2_2_0-schema-tag}"/>
</target>
<target name="geteml2+" depends="prepare,giteml" if="eml.required"
description="Checks eml-2 out of svn and copies schema and xsl to your metacat sandbox">
<!-- Checkout eml200 for given schema tag-->
<mkdir dir="lib/schema/eml-2.0.0"/>
<copy todir="lib/schema/eml-2.0.0" filtering="yes">
<fileset
dir="${build.tmp}/eml_${eml2_0_0-schema-tag}">
<include name="*.xsd"/>
</fileset>
<!-- shouldn't we have a mapper here like this??
<mapper type="glob" from="eml-*.xsd" to="eml-*-${eml-version}.xsd" />
Jing's code didn't have one - does it need to be added?
NOTE that eml-version is set to beta 6, so this would need changing -->
</copy>
<!-- Checkout eml201 for given schema tag-->
<mkdir dir="lib/schema/eml-2.0.1"/>
<copy todir="lib/schema/eml-2.0.1" filtering="yes">
<fileset
dir="${build.tmp}/eml_${eml2_0_1-schema-tag}">
<include name="*.xsd"/>
</fileset>
</copy>
<!-- Checkout eml210 for given schema tag-->
<mkdir dir="lib/schema/eml-2.1.0"/>
<copy todir="lib/schema/eml-2.1.0" filtering="yes">
<fileset
dir="${build.tmp}/eml_${eml2_1_0-schema-tag}">
<include name="*.xsd"/>
</fileset>
</copy>
<!-- Checkout eml210 for given style sheet tag-->
<antcall target="copyxsl">
<param name="cvs.tagname" value="${eml2-style-tag}"/>
<!-- param name="dirname" value="eml-2.1.0" / -->
<param name="dirname" value="eml-2"/>
</antcall>
<!-- Checkout eml211 for given schema tag-->
<mkdir dir="lib/schema/eml-2.1.1"/>
<copy todir="lib/schema/eml-2.1.1" filtering="yes">
<fileset
dir="${build.tmp}/eml_${eml2_1_1-schema-tag}">
<include name="*.xsd"/>
</fileset>
</copy>
<!-- Checkout eml220 for the given schema tag-->
<mkdir dir="lib/schema/eml-2.2.0"/>
<copy todir="lib/schema/eml-2.2.0" filtering="yes">
<fileset
dir="${build.tmp}/eml_${eml2_2_0-schema-tag}/xsd">
<include name="*.xsd"/>
</fileset>
</copy>
</target>
<target name="copyxsl"
description="Copies xsl stylesheets from checkout in build/tmp to your metacat sandbox">
<delete file="${style-common-cvsrelpath}/${eml-css}"/>
<copy todir="${style-common-cvsrelpath}/${dirname}"
filtering="yes">
<fileset
dir="${build.tmp}/eml_${cvs.tagname}/style/eml">
<include name="**/*.xsl"/>
</fileset>
</copy>
<!-- now copy default css from eml module and put it in style-common-path
dir with a new name, so other skin-specific css can import it if reqd -->
<copy
file="${build.tmp}/eml_${cvs.tagname}/${eml-module.default.css}"
tofile="${style-common-cvsrelpath}/${eml-css}"/>
</target>
<target name="correctEML201Docs" depends="jar"
description="Uses the ant task to run a JAVA patch class to correct invalide eml201 documents which were generated by wrong schema">
<copy todir="${build.dir}" file="lib/metacat.properties"
filtering="yes"/>
<java
classname="edu.ucsb.nceas.metacat.EML201DocumentCorrector">
<classpath>
<path refid="compile.classpath"/>
<fileset dir="${build.dir}">
<include name="${name}.jar"/>
</fileset>
</classpath>
</java>
</target>
<target name="install-dev" depends="warNoDocs, dist-metacat-index, build-metacat-ui,deploy"
description="* * * Install Metacat For Development. Lightweight install: does not include docs * * *">
<echo>Dev install completed at ${NOW}</echo>
</target>
<target name="install" depends="build-metacat,deploy"
description="Full installation of Metacat For Development, including documentation">
<echo>Full install completed at ${NOW}</echo>
</target>
<target name="deploy">
<copy file="${dist.dir}/${metacat.context}.war"
todir="${app.deploy.dir}"/>
<delete dir="${app.deploy.dir}/${metacat.context}"/>
<copy file="${dist.dir}/metacat-index.war"
todir="${app.deploy.dir}"/>
<delete dir="${app.deploy.dir}/metacat-index"/>
<copy file="${dist.dir}/${metacatui.war.name}"
todir="${app.deploy.dir}"/>
<delete dir="${app.deploy.dir}/metacatui"/>
<tstamp>
<format property="NOW" pattern="MM/dd/yyyy hh:mm:ss aa"/>
</tstamp>
</target>
<target name="build-metacat" depends="war, dist-metacat-index, build-metacat-ui"
description="Build Metacat, including indexer and UI">
</target>
<target name="install-skin" depends="init"
description="Install a Skin">
<input message="Please enter name of the skin"
addproperty="skin-name"/>
<mkdir dir="${installdir}/style/skins/${skin-name}"/>
<copy todir="${installdir}/style/skins/${skin-name}"
filtering="yes">
<fileset dir="lib/style/skins/${skin-name}">
<exclude name="**/*.png"/>
<exclude name="**/*.gif"/>
<exclude name="**/*.jpg"/>
<exclude name="**/CVS*"/>
<exclude name="**/.#*"/>
</fileset>
</copy>
<copy todir="${installdir}/style/skins/${skin-name}"
filtering="no">
<fileset dir="lib/style/skins/${skin-name}">
<include name="**/*.png"/>
<include name="**/*.gif"/>
<include name="**/*.jpg"/>
<exclude name="**/CVS*"/>
<exclude name="**/.#*"/>
</fileset>
</copy>
<copy todir="${installdir}/style/common" filtering="yes">
<fileset dir="lib/style/common">
<include name="*.js"/>
<include name="*.jsp"/>
<include name="*.css"/>
<exclude name="*.png"/>
<exclude name="*.gif"/>
<exclude name="*.jpg"/>
<exclude name="**/CVS*"/>
<exclude name="**/.#*"/>
</fileset>
</copy>
<echo message="Install Skin completed."/>
</target>
<target name="war" depends="warPrepare,createWar"
description="Create a web archive (WAR) for servlet deployment"/>
<!-- Generate a lightweight war file for dev purposes. Does not include documentation -->
<target name="warNoDocs" depends="warPrepareNoDocs,createWar"/>
<!-- Utility target to enerate a war from prepared files -->
<target name="createWar">
<mkdir dir="${dist.dir}"/>
<war destfile="${dist.dir}/${metacat.context}.war"
webxml="${build.war}/web.xml">
<fileset dir="${war.context}"/>
<lib dir="${war.lib}"/>
<classes dir="${war.classes}">
<exclude name="log4j.properties"/>
</classes>
<webinf dir="${war.webinf}"/>
</war>
</target>
<target name="warPrepare" depends="documentation,warPrepareNoDocs" />
<target name="warPrepareNoDocs" depends="jar,clientjar,harvesterjar,testPrepare">
<property name="war.lib" value="${build.war}/lib"/>
<property name="war.classes" value="${build.war}/classes"/>
<property name="war.webinf" value="${build.war}/WEB-INF"/>
<property name="war.context"
value="${build.war}/${metacat.context}"/>
<property name="war.webinf.sql" value="${war.webinf}/sql"/>
<property name="war.webinf.scripts"
value="${war.webinf}/scripts"/>
<property name="war.context.cgi" value="${war.context}/cgi-bin"/>
<property name="war.context.docs" value="${war.context}/docs"/>
<property name="war.context.temp" value="${war.context}/temp"/>
<property name="war.context.templates"
value="${war.context}${style-common-relpath}/templates"/>
<mkdir dir="${war.lib}"/>
<mkdir dir="${war.classes}"/>
<mkdir dir="${war.webinf}"/>
<mkdir dir="${war.context}"/>
<mkdir dir="${war.webinf.sql}"/>
<mkdir dir="${war.context.cgi}"/>
<mkdir dir="${war.context.docs}"/>
<mkdir dir="${war.context.temp}"/>
<mkdir dir="${war.context.templates}"/>
<copy file="${build.dir}/${name}.jar" todir="${war.lib}"/>
<copy file="${build.dir}/${name}-client.jar" todir="${war.lib}"/>
<copy file="${build.dir}/harvester.jar" todir="${war.lib}"/>
<copy todir="${war.lib}" filtering="no">
<fileset dir="lib">
<include name="*.jar"/>
<exclude name="maven-ant-tasks*.jar"/>
</fileset>
<fileset dir="${libdir.mvn}"/>
</copy>
<copy file="lib/web.xml" tofile="${build.war}/web.xml"/>
<copy file="lib/metacat.properties" todir="${war.webinf}"
filtering="yes"/>
<copy todir="${war.webinf}" filtering="yes">
<fileset dir="lib/account-web-info">
<exclude name="web.xml"/>
</fileset>
</copy>
<copy file="lib/solrQueryFieldDescriptions.properties" todir="${war.webinf}"/>
<copy file="lib/metacat.properties.metadata.xml"
todir="${war.webinf}" filtering="no"/>
<copy file="lib/org.properties.metadata.xml"
todir="${war.webinf}" filtering="no"/>
<copy file="lib/auth.properties.metadata.xml"
todir="${war.webinf}" filtering="no"/>
<copy todir="${war.webinf}" filtering="yes">
<fileset dir="lib">
<include name="skin.configs/**"/>
</fileset>
</copy>
<copy todir="${war.classes}" filtering="yes">
<fileset dir="metacat-common/src/main/resources/solr-home/conf">
<exclude name="schema.xml"/>
<exclude name="solrconfig.xml"/>
</fileset>
</copy>
<copy file="lib/log4j2.properties" todir="${war.classes}"
filtering="yes"/>
<copy todir="${war.context}" filtering="no">
<fileset dir="lib">
<include name="**/*.jpg"/>
<include name="**/*.png"/>
<include name="**/*.gif"/>
<include name="LiveMap_30/**"/>
<include name="oaipmh/**"/>
</fileset>
</copy>
<copy todir="${war.context}" filtering="yes">
<fileset dir="lib">
<exclude name="*.jar"/>
<exclude name="*.properties"/>
<exclude name="*.metadata.xml"/>
<exclude name="web.xml"/>
<exclude name="**/*.jpg"/>
<exclude name="**/*.png"/>
<exclude name="**/*.gif"/>
<exclude name="lsid_lib/**"/>
<exclude name="lsid_conf/**"/>
<exclude name="LiveMap_30/**"/>
<exclude name="oaipmh/**"/>
<exclude name="maven/**"/>
<exclude name="skin.configs/**"/>
<exclude name="spatial/geoserver/**"/>
</fileset>
</copy>
<copy todir="${war.context.docs}" filtering="no">
<fileset dir="${build.docs}"/>
</copy>
<copy todir="${war.webinf.sql}" filtering="yes">
<fileset dir="src">