-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.xml
1112 lines (862 loc) · 46.4 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"?>
<!--
~ /////////////////////////////////////////////////////////////////////////////
~ // This file is part of the "Hyrax Data Server" project.
~ //
~ //
~ // Copyright (c) 2019 OPeNDAP, Inc.
~ // Author: Nathan David Potter <ndp@opendap.org>
~ //
~ // This library is free software; you can redistribute it and/or
~ // modify it under the terms of the GNU Lesser General Public
~ // License as published by the Free Software Foundation; either
~ // version 2.1 of the License, or (at your option) any later version.
~ //
~ // This library 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
~ // Lesser General Public License for more details.
~ //
~ // You should have received a copy of the GNU Lesser General Public
~ // License along with this library; if not, write to the Free Software
~ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
~ //
~ // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
~ /////////////////////////////////////////////////////////////////////////////
-->
<project
name="OPeNDAP Lightweight Front end Server (OLFS), part of the Hyrax project"
default="all" basedir="."
xmlns:sonar="antlib:org.sonar.ant" >
<description>
Compiles the OLFS project software and, depending on the chosen target,
can produce a Web Application aRchive (WAR) file for each of:
- The OLFS/Hyrax service build targets(s): server
- The NGAP/Hyrax service, build targets(s): ngap
- The robots.txt service, build targets(s): robots, hyrax-robots
Also builds:
- The hex Encoder/Decoder application as an executable jar file.
- The XML Validator application as an executable jar file.
</description>
<!-- Global Properties for Java-OPeNDAP software development -->
<property name="DEPLOYMENT_CONTEXT" value="opendap"/>
<property name="NGAP_DEPLOYMENT_CONTEXT" value="ngap"/>
<!-- ********************************************* -->
<!-- Project-wide settings. All directories are -->
<!-- relative to the project "Basedir" directory, -->
<!-- which is assumed (by this file) to be set to -->
<!-- ".." -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Version Tags: Used for doing distribution builds.
These properties should be set from the command
line when running the DISTRO build target.
-->
<property name="HYRAX_VERSION" value="Not.A.Release"/>
<property name="OLFS_VERSION" value="Not.A.Release"/>
<property name="NGAP_VERSION" value="${HYRAX_VERSION}"/>
<property name="WCS_VERSION" value="${HYRAX_VERSION}"/>
<property name="OLFS_DIST_BASE" value="olfs-${OLFS_VERSION}"/>
<property name="NGAP_DIST_BASE" value="ngap-${HYRAX_VERSION}"/>
<property name="WEBAPP_DIST" value="${OLFS_DIST_BASE}-webapp"/>
<property name="SRC_DIST" value="${OLFS_DIST_BASE}-src"/>
<property name="DOC_DIST" value="${OLFS_DIST_BASE}-doc"/>
<property name="OLFS_LIB" value="${OLFS_DIST_BASE}"/>
<!-- Compiler Settings -->
<property name="compile.debug" value="on"/>
<property name="compile.debuglevel" value="lines,vars,source"/>
<property name="compile.deprecation" value="on"/>
<property name="compile.TARGET" value="1.8"/>
<property name="compile.SOURCE" value="1.8"/>
<property name="modern.compiler" value="modern"/>
<property name="classic.compiler" value="classic"/>
<!-- build.compiler: This is a "magic" property.
In the javac task, if the "compiler" property is not
explicitly set, then javac will use the value of this
property ("build.compiler") to set the compiler type.
See the online ANT Users Manual.
Read the section the comipler attribute of the javac task.
http://ant.apache.org/manual/index.html
-->
<property name="build.compiler" value="${modern.compiler}"/>
<!-- build.sysclasspath
This is a "magic" property. The value of the build.sysclasspath
property controls how the system classpath, ie. the classpath in
effect when Ant is run, affects the behaviour of classpaths in
Ant. The default behavior varies from Ant to Ant task.
The values and their meanings are:
only - Only the system classpath is used and classpaths
specified in build files, etc are ignored. This
situation could be considered as the person running
the build file knows more about the environment
than the person writing the build file
ignore - The system classpath is ignored. This situation is
the reverse of the above. The person running the
build trusts the build file writer to get the build
file right
last - The classpath is concatenated to any specified
classpaths at the end. This is a compromise, where
the build file writer has priority.
first - Any specified classpaths are concatenated to the
system classpath. This is the other form of compromise
where the build runner has priority.
Excerpted from the online ANT users Manual
http://ant.apache.org/manual/sysclasspath.html
-->
<property name="build.sysclasspath" value="ignore"/>
<!-- ********************************************* -->
<!-- Target to create the build directories -->
<!-- prior to a compile target. We also mark -->
<!-- the start time of the build for the log. -->
<target name="noop" description="Do Nothing Target">
<echo level="info" message="no-op target in ${ant.file}"/>
</target>
<target name="show" description="Show build settings.">
<echo level="info" message="##########################################################"/>
<echo level="info" message="# Build Settings"/>
<echo level="info" message="#"/>
<echo level="info" message=" Project Name: ${ant.project.name}"/>
<echo level="info" message=" Project File: ${ant.file}"/>
<echo level="info" message=" Hyrax Version: ${HYRAX_VERSION}"/>
<echo level="info" message=" OLFS Version: ${OLFS_VERSION}"/>
<echo level="info" message=" NGAP Version: ${NGAP_VERSION}"/>
<echo level="info" message=" WCS Version: ${WCS_VERSION}"/>
<echo level="info" message=" Deployment Context: ${DEPLOYMENT_CONTEXT}"/>
<echo level="info" message=" NGAP Deployment Context: ${NGAP_DEPLOYMENT_CONTEXT}"/>
<echo level="info" message=""/>
<echo level="info" message="Project Directories:"/>
<echo level="info" message=" src.dir: ${src.dir}"/>
<echo level="info" message=" doc.dir: ${doc.dir}"/>
<echo level="info" message=" lib.dir: ${lib.dir}"/>
<echo level="info" message=" resources.dir: ${resources.dir}"/>
<echo level="info" message=""/>
<echo level="info" message="Build Directories:"/>
<echo level="info" message=" build.dir: ${build.dir}"/>
<echo level="info" message=" build.classes: ${build.classes}"/>
<echo level="info" message=" build.doc: ${build.docs}"/>
<echo level="info" message=" build.resources: ${build.hyrax.resources}"/>
<echo level="info" message=""/>
<echo level="info" message="Ant Properties:"/>
<echo level="info" message=" ant.file: ${ant.file}"/>
<echo level="info" message=" ant.home: ${ant.home}"/>
<echo level="info" message=" ant.java.version: ${ant.java.version}"/>
<echo level="info" message=" ant.project.name: ${ant.project.name}"/>
<echo level="info" message=" ant.version: ${ant.version}"/>
<echo level="info" message=" basedir: ${basedir}"/>
<echo level="info" message=" user.name: ${user.name}"/>
<echo level="info" message=" user.home: ${user.home}"/>
<echo level="info" message=" java.home: ${java.home}"/>
<echo level="info" message=" java.version: ${java.version}"/>
<echo level="info" message=""/>
<echo level="info" message="Distribution Targets: "/>
<echo level="info" message=" WEBAPP_DIST: ${WEBAPP_DIST}"/>
<echo level="info" message=" SRC_DIST: ${SRC_DIST}"/>
<echo level="info" message=" DOC_DIST: ${DOC_DIST}"/>
<echo level="info" message=" OLFS_LIB: ${OLFS_LIB}"/>
<echo level="info" message=""/>
<echo level="info" message="----------------------------------------------------------"/>
<echo level="info" message=" Operating System: ${os.name}"/>
<echo level="info" message=" Arcitecture: ${os.arch}"/>
<echo level="info" message=" Version: ${os.version}"/>
<echo level="info" message=" sun.java.command: ${sun.java.command}"/>
<echo level="info" message=" ANT_OPTS: ${ANT_OPTS}"/>
<echo level="info" message="Calling echoproperties task"/>
<echoproperties />
<echo level="info" message=""/>
<echo level="info" message="##########################################################"/>
</target>
<!-- ################################################################# -->
<!-- Project Settings -->
<!-- ................................................................. -->
<!-- Project directories -->
<property name="src.dir" location="src"/>
<property name="doc.dir" location="doc"/>
<property name="lib.dir" location="lib"/>
<property name="resources.dir" location="resources"/>
<property name="WebInfResources.dir" location="${resources.dir}/hyrax/WEB-INF"/>
<property name="distributionResources.dir" location="${resources.dir}/distribution"/>
<!-- Build Directories -->
<property name="build.dir" location="build"/>
<property name="build.classes" location="${build.dir}/classes"/>
<property name="build.docs" location="${build.dir}/docs"/>
<property name="build.dist" location="${build.dir}/dist"/>
<property name="build.lib" location="${build.dir}/lib"/>
<property name="build.run" location="${build.dir}/run"/>
<property name="build.src" location="${build.dir}/src"/>
<property name="build.hyrax.resources" location="${build.dir}/resources"/>
<property name="hyraxResources.dir" location="${resources.dir}/hyrax"/>
<property name="BUILD_DMRPP_DEPLOYMENT_CONTEXT" value="build_dmrpp"/>
<property name="BUILD_DMRPP_VERSION" value="Not.A.Release"/>
<property name="BUILD_DMRPP_DIST_BASE" value="build_dmrpp-${BUILD_DMRPP_VERSION}"/>
<property name="build_dmrpp.resources.dir" location="${resources.dir}/build_dmrpp"/>
<property name="build_dmrpp.build.resources" location="${build.dir}/build_dmrpp"/>
<property name="ngapResources.dir" location="${resources.dir}/ngap"/>
<property name="build.ngap.resources" location="${build.dir}/ngap"/>
<property name="robotsResources.dir" location="${resources.dir}/robots"/>
<property name="build.robots.resources" location="${build.dir}/robots"/>
<property name="wcs.resources.dir" location="${resources.dir}/WCS/2.0"/>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Libraries
-->
<property name="json.lib" value="gson-2.8.9.jar"/>
<property name="junit.lib" value="junit-4.4.jar"/>
<property name="jdom.lib" value="jdom-1.1.1.jar"/>
<property name="urlRewrite.lib" value="urlrewrite-3.2.0.jar"/>
<property name="slf4j.lib" value="slf4j-api-2.0.13.jar"/> <!-- updated version jhrg 6/3/24 -->
<property name="logback-core.lib" value="logback-core-1.5.6.jar"/> <!-- updated version jhrg 6/3/24 -->
<property name="logback-classic.lib" value="logback-classic-1.5.6.jar"/> <!-- updated version jhrg 6/3/24 -->
<property name="commons-cli.lib" value="apache-commons-cli-1.2.jar"/>
<property name="commons-codec.lib" value="apache-commons-codec-1.8.jar"/>
<property name="commons-httpclient.lib" value="apache-commons-httpclient-3.1.jar"/>
<property name="commons-lang.lib" value="apache-commons-lang3-3.14.0.jar"/>
<property name="commons-text.lib" value="apache-commons-text-1.12.0.jar"/>
<property name="commons-logging.lib" value="apache-commons-logging-1.1.3.jar"/>
<property name="commons-io.lib" value="apache-commons-io-2.4.jar"/>
<property name="http-components-httpclient.lib" value="org.apache.httpcomponents.httpclient_4.5.3.jar"/>
<property name="http-components-httpcore.lib" value="org.apache.httpcomponents.httpcore_4.4.6.jar"/>
<property name="xalan.lib" value="xalan-j-2.7.3.jar"/>
<property name="xercesImpl.lib" value="xercesImpl-2.12.2.jar"/>
<property name="xercesXmlApis.lib" value="xerces-xml-apis-2.12.2.jar"/>
<property name="saxon-jdom.lib" value="saxon-9.1.0.5-jdom.jar"/>
<property name="saxon-s9api.lib" value="saxon-9.1.0.5-s9api.jar"/>
<property name="saxon.lib" value="saxon-9.1.0.5.jar"/>
<property name="catalina.lib" value="catalina-6.0.53.jar"/>
<property name="servlet-api.lib" value="servlet-api-3.0.jar"/>
<property name="sjson.lib" value="json-simple-1.1.1.jar"/>
<property name="owasp-encoder.lib" value="encoder-1.2.2.jar"/>
<property name="owasp-encoder-jsp.lib" value="encoder-jsp-1.2.2.jar"/>
<property name="aws-java-sdk-core.lib" value="aws-java-sdk-core-1.12.734.jar"/>
<property name="aws-java-sdk-ec2.lib" value="aws-java-sdk-ec2-1.12.734.jar"/>
<property name="aws-java-sdk-logs.lib" value="aws-java-sdk-logs-1.12.734.jar"/>
<property name="jackson-core.lib" value="jackson-core-2.17.0.jar" />
<property name="jackson-databind.lib" value="jackson-databind-2.17.0.jar" />
<property name="jackson-annotations.lib" value="jackson-annotations-2.17.0.jar" />
<property name="joda-time.lib" value="joda-time-2.12.7.jar"/>
<!-- WCS Libs -->
<property name="ogc-wcs.lib" value="wcs-v_2_0-2.6.1.jar"/>
<property name="ogc-gml.lib" value="gml-v_3_2_1-2.6.1.jar"/>
<property name="ogc-swe.lib" value="sweCommon-v_2_0-2.6.1.jar"/>
<property name="ogc-gmlcov.lib" value="gmlcov-v_1_0-2.6.1.jar"/>
<property name="ogc-ows.lib" value="ows-v_2_0-2.6.1.jar"/>
<property name="ogc-jaxb.lib" value="jaxb2-basics-runtime-0.11.0.jar"/>
<property name="jaxb-api.lib" value="jaxb-api-2.3.1.jar"/>
<property name="jaxb-core.lib" value="jaxb-core-2.3.0-b170127.1453.jar"/>
<property name="jaxb-impl.lib" value="jaxb-impl-2.3.0-b170127.1453.jar"/>
<property name="jaxb-runtime.lib" value="jaxb-runtime-2.3.6.jar"/>
<property name="javax.annotation-api.lib" value="javax.annotation-api-1.3.2.jar"/>
<property name="javax.activation.lib" value="activation-1.1.1.jar"/>
<property name="xlink.lib" value="xlink-v_1_0-1.4.0.jar"/>
<!-- Cloudwatch logback appender -->
<property name="cloudwathch-logback-appender.lib" value="cloudwatch-logback-appender-3.11.jar"/>
<!--
These are the library jars used by Hyrax.
-->
<fileset id="hyrax-libs" dir="${lib.dir}">
<include name="${owasp-encoder.lib}"/>
<include name="${owasp-encoder-jsp.lib}"/>
<include name="${json.lib}"/>
<include name="${sjson.lib}"/>
<include name="${jdom.lib}"/>
<include name="${junit.lib}"/>
<include name="${commons-lang.lib}"/>
<include name="${commons-text.lib}"/>
<include name="${commons-cli.lib}"/>
<include name="${commons-httpclient.lib}"/>
<include name="${commons-logging.lib}"/>
<include name="${commons-codec.lib}"/>
<include name="${commons-io.lib}"/>
<include name="${http-components-httpclient.lib}"/>
<include name="${http-components-httpcore.lib}"/>
<include name="${saxon-jdom.lib}"/>
<include name="${saxon-s9api.lib}"/>
<include name="${saxon.lib}"/>
<include name="${slf4j.lib}"/>
<include name="${logback-core.lib}"/>
<include name="${logback-classic.lib}"/>
<include name="${aws-java-sdk-core.lib}"/>
<include name="${aws-java-sdk-ec2.lib}"/>
<include name="${aws-java-sdk-logs.lib}"/>
<include name="${jackson-core.lib}"/>
<include name="${jackson-databind.lib}"/>
<include name="${jackson-annotations.lib}"/>
<include name="${joda-time.lib}"/>
<include name="${urlRewrite.lib}"/>
<!-- WCS-2.0 Libs -->
<include name="${ogc-wcs.lib}"/>
<include name="${ogc-gml.lib}"/>
<include name="${ogc-swe.lib}"/>
<include name="${ogc-gmlcov.lib}"/>
<include name="${ogc-ows.lib}"/>
<include name="${ogc-jaxb.lib}"/>
<include name="${jaxb-api.lib}"/>
<include name="${jaxb-core.lib}"/>
<include name="${jaxb-impl.lib}"/>
<include name="${jaxb-runtime.lib}"/>
<include name="${javax.annotation-api.lib}"/>
<include name="${javax.activation.lib}"/>
<include name="${xlink.lib}"/>
</fileset>
<!--
These are the library jars used by Hyrax.
-->
<fileset id="build_dmrpp-libs" dir="${lib.dir}">
<include name="${owasp-encoder.lib}"/>
<include name="${owasp-encoder-jsp.lib}"/>
<include name="${json.lib}"/>
<include name="${sjson.lib}"/>
<include name="${jdom.lib}"/>
<include name="${junit.lib}"/>
<include name="${commons-cli.lib}"/>
<include name="${http-components-httpclient.lib}"/>
<include name="${http-components-httpcore.lib}"/>
<include name="${saxon-jdom.lib}"/>
<include name="${saxon-s9api.lib}"/>
<include name="${saxon.lib}"/>
<include name="${slf4j.lib}"/>
<include name="${logback-core.lib}"/>
<include name="${logback-classic.lib}"/>
<include name="${urlRewrite.lib}"/>
</fileset>
<!-- Library compile (class)paths -->
<path id="olfs.compile.classpath">
<pathelement path="${build.classes}"/>
<!--
We have to have the catalina and servlet api's on the classpath at
compile time, but their not needed at deployment because they come
bundled with Tomcat
-->
<fileset dir="${lib.dir}">
<include name="${catalina.lib}"/>
<include name="${servlet-api.lib}"/>
</fileset>
<fileset refid="hyrax-libs" />
</path>
<path id="build_dmrpp.compile.classpath">
<pathelement path="${build.classes}"/>
<!--
We have to have the catalina and servlet api's on the classpath at
compile time, but their not needed at deployment because they come
bundled with Tomcat
-->
<fileset dir="${lib.dir}">
<include name="${catalina.lib}"/>
<include name="${servlet-api.lib}"/>
</fileset>
<fileset refid="build_dmrpp-libs" />
</path>
<target name="all" depends="clean,check,server"
description="Builds lots of stuff."/>
<target name="clean" description="Clean up ALL build products.">
<delete dir="${build.dir}"/>
</target>
<target name="init" description="Prepare all build directories.">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes}"/>
<mkdir dir="${build.docs}"/>
<mkdir dir="${build.dist}"/>
<mkdir dir="${build.lib}"/>
<mkdir dir="${build.run}"/>
<mkdir dir="${build.src}"/>
<filter token="HyraxVersion" value="${HYRAX_VERSION}"/>
<filter token="OlfsVersion" value="${OLFS_VERSION}"/>
<filter token="SERVICE_CONTEXT" value="${DEPLOYMENT_CONTEXT}"/>
<filter token="WCS_SOFTWARE_VERSION" value="${WCS_VERSION}"/>
<tstamp/>
<echo level="info" message="time: ${TSTAMP}"/>
<echo message="hyrax-libs: ${toString:hyrax-libs}"/>
</target>
<!-- It would be better if this target only copied the files that have changed.
jhrg 5/26/16 -->
<target name="check"
description="Run Unit Tests"
depends="compile"
>
<junit showoutput="yes"
haltonfailure="yes"
printsummary="yes"
>
<formatter type="plain" usefile="false"/>
<classpath refid="olfs.compile.classpath"/>
<test name="opendap.coreServlet.Scrub"/>
<test name="opendap.aggregation.AggregationParamsTest"/>
<test name="opendap.bes.dap4Responders.Dap4ResponderTest"/>
<!--
<test name="opendap.dap4.DatasetTest" />
<test name="opendap.wcs.v2_0.DynamicCoverageDescriptionTest" />
-->
</junit>
</target>
<!-- Alias for Travis which expects tests to be run by 'ant test' jhrg 3/14/19 -->
<target name="test" depends="check"/>
<target name="PreProcessSourceCode"
depends="clean,init"
description="Moves selected source code from the development tree into
the build/src directory. The code text is filtered to update version numbers.">
<echo level="info" message=" Moving and filtering Source code."/>
<echo level="info" message=" AntFile: ${ant.file} Moving and filtering Source code."/>
<echo level="info" message=" HYRAX_VERSION: ${HYRAX_VERSION}"/>
<echo level="info" message=" NGAP_VERSION: ${NGAP_VERSION}"/>
<echo level="info" message=" OLFS_VERSION: ${OLFS_VERSION}"/>
<echo level="info" message=" WCS_VERSION: ${WCS_VERSION}"/>
<echo level="info" message=" DEPLOYMENT_CONTEXT: ${DEPLOYMENT_CONTEXT}"/>
<echo level="info" message="NGAP_DEPLOYMENT_CONTEXT: ${NGAP_DEPLOYMENT_CONTEXT}"/>
<echo level="info" message=""/>
<copy todir="${build.src}" filtering="true">
<fileset dir="${src.dir}">
<!-- include all the java files -->
<include name="com/**"/>
<include name="opendap/**"/>
<include name="org/opendap/**"/>
<exclude name="opendap/cmr/**"/>
<!-- Exclude WCS 1.1.2 and semantics code -->
<exclude name="opendap/wcs/v1_1_2/**"/>
<exclude name="opendap/semantics/**"/>
<!-- Exclude prototype Amazon Web Services code from production -->
<exclude name="opendap/aws/**"/>
<!-- Exclude async test code -->
<exclude name="opendap/async/**"/>
</fileset>
</copy>
<copy todir="${build.hyrax.resources}" filtering="true">
<!-- Copy and filter all of the hyrax resources -->
<fileset dir="${hyraxResources.dir}"/>
<!-- get the WCS stuff but don't stomp on Hyrax things -->
<fileset dir="${wcs.resources.dir}">
<include name="xsl/**"/>
<include name="WEB-INF/**"/>
<exclude name="WEB-INF/web.xml"/>
<exclude name="WEB-INF/urlrewrite.xml"/>
<exclude name="WEB-INF/logback.xml"/>
<exclude name="WEB-INF/logback-test.xml"/>
</fileset>
</copy>
<copy todir="${build.robots.resources}" filtering="true">
<fileset dir="${robotsResources.dir}"/>
</copy>
<copy todir="${build.ngap.resources}" filtering="true">
<fileset dir="${ngapResources.dir}">
<exclude name="*.png" />
<exclude name="lib/**" />
</fileset>
</copy>
<copy todir="${build_dmrpp.build.resources}" filtering="true">
<fileset dir="${build_dmrpp.resources.dir}">
<exclude name="*.png" />
<exclude name="lib/**" />
</fileset>
</copy>
</target>
<target
name="compile"
depends="PreProcessSourceCode"
description="Compiles the OLFS."
>
<echo level="info" message="AntFile: ${ant.file} Compiling OLFS"/>
<echo level="info" message="Using the ${build.compiler} javac compiler"/>
<echo level="info" message="java.home (ant): ${java.home}"/>
<echo level="info" message="Target JVM Version: ${compile.TARGET}"/>
<echo level="info" message="Source Syntax Version: ${compile.SOURCE}"/>
<echo level="info" message=""/>
<javac compiler="${build.compiler}"
target="${compile.TARGET}"
source="${compile.SOURCE}"
destdir="${build.classes}"
debug="${compile.debug}"
debuglevel="${compile.debuglevel}"
deprecation="${compile.deprecation}">
<classpath refid="olfs.compile.classpath"/>
<src path="${build.src}"/>
</javac>
</target>
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<target name="src-dist"
depends="clean,PreProcessSourceCode"
description="Builds source distribution"
>
<tar destfile="${build.dist}/${SRC_DIST}.tgz"
compression="gzip"
>
<zipfileset dir="${build.src}" prefix="${SRC_DIST}/src"/>
<zipfileset dir="." prefix="${SRC_DIST}" includes="doc/**"/>
<zipfileset dir="." prefix="${SRC_DIST}" includes="lib/**"/>
<zipfileset dir="." prefix="${SRC_DIST}" includes="resources/hyrax/**"/>
<zipfileset dir="." prefix="${SRC_DIST}" includes="resources/WebStart/**"/>
<zipfileset dir="." prefix="${SRC_DIST}" includes="resources/gateway/**"/>
<zipfileset dir="." prefix="${SRC_DIST}" includes="resources/nciso/**"/>
<zipfileset dir="." prefix="${SRC_DIST}" includes="build.xml"/>
<zipfileset dir="." prefix="${SRC_DIST}" includes="README"/>
<zipfileset dir="." prefix="${SRC_DIST}" includes="NEWS"/>
<zipfileset dir="." prefix="${SRC_DIST}" includes="ChangeLog"/>
<zipfileset dir="." prefix="${SRC_DIST}" includes="COPYRIGHT"/>
</tar>
</target>
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<target name="server-dist"
depends="server"
description="Packages the war file into tar file with a release related name.">
<copy file="README.md"
tofile="${build.dist}/README"/>
<tar destfile="${build.dist}/${WEBAPP_DIST}.tgz"
compression="gzip"
>
<zipfileset dir="${build.dist}" prefix="${WEBAPP_DIST}">
<include name="opendap.war"/>
<include name="README"/>
</zipfileset>
</tar>
<delete file="${build.dist}/README"/>
<delete file="${build.dist}/opendap.war"/>
</target>
<target name="DISTRO"
depends="clean,src-dist,server-dist,hyrax-robots-dist"
description="Builds complete distribution"
>
</target>
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<target name="IsJavaDocUpToDate"
description="Checks to see if the JavaDoc is out of date."
>
<uptodate property="JavaDocIsUpToDate"
targetfile="${build.docs}/opendap/index.html">
<srcfiles dir="${src.dir}">
<include name="opendap/**/*.java"/>
<include name="org/opendap/**/*.java"/>
</srcfiles>
</uptodate>
</target>
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<target name="hexEncoderApp"
depends="clean,compile"
description="Builds executable jar file of the hex encoder application">
<mkdir dir="${build.dist}/hexEncoder"/>
<copy file="${lib.dir}/${commons-cli.lib}" tofile="${build.dist}/hexEncoder/${commons-cli.lib}"/>
<copy file="resources/hexEncoder/hexEncoder" tofile="${build.dist}/hexEncoder/hexEncoder"/>
<jar destfile="${build.dist}/hexEncoder/hexEncoder.jar"
manifest="resources/hexEncoder/hexEncoder.MANIFEST.MF">
<fileset dir="${build.classes}">
<include name="opendap/gateway/Encoder.class"/>
<include name="opendap/gateway/HexAsciiEncoder.class"/>
</fileset>
</jar>
<tar destfile="${build.dist}/hexEncoder.tgz"
compression="gzip"
>
<zipfileset dir="${build.dist}/hexEncoder"/>
</tar>
</target>
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<target name="validatorApp"
depends="clean,compile"
description="Builds executable jar file for the simple XML Validator">
<copy file="${lib.dir}/${commons-cli.lib}" tofile="${build.dist}/${commons-cli.lib}"/>
<copy file="${lib.dir}/${commons-httpclient.lib}" tofile="${build.dist}/${commons-httpclient.lib}"/>
<copy file="${lib.dir}/${commons-logging.lib}" tofile="${build.dist}/${commons-logging.lib}"/>
<copy file="${lib.dir}/${commons-codec.lib}" tofile="${build.dist}/${commons-codec.lib}"/>
<copy file="${lib.dir}/${xercesImpl.lib}" tofile="${build.dist}/${xercesImpl.lib}"/>
<copy file="${lib.dir}/${xercesXmlApis.lib}" tofile="${build.dist}/${xercesXmlApis.lib}"/>
<!--
<copy file="${lib.dir}/${saxon-jdom.lib}" tofile="${build.dist}/${saxon-jdom.lib}"/>
<copy file="${lib.dir}/${saxon-xml-apis.lib}" tofile="${build.dist}/${saxon-xml-apis.lib}"/>
<copy file="${lib.dir}/${saxon.lib}" tofile="${build.dist}/${saxon.lib}"/>
-->
<copy file="${lib.dir}/${jdom.lib}" tofile="${build.dist}/${jdom.lib}"/>
<jar destfile="${build.dist}/validator.jar"
manifest="resources/META-INF/validator.MANIFEST.MF">
<fileset dir="${build.classes}">
<include name="opendap/xml/Validator.class"/>
</fileset>
</jar>
</target>
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<target name="XSLTransformer"
depends="clean,compile"
description="Builds executable jar file of a simple XSL Transformer application">
<copy file="${lib.dir}/${commons-cli.lib}" tofile="${build.dist}/${commons-cli.lib}"/>
<copy file="${lib.dir}/${commons-httpclient.lib}" tofile="${build.dist}/${commons-httpclient.lib}"/>
<copy file="${lib.dir}/${commons-logging.lib}" tofile="${build.dist}/${commons-logging.lib}"/>
<copy file="${lib.dir}/${commons-codec.lib}" tofile="${build.dist}/${commons-codec.lib}"/>
<copy file="${lib.dir}/${xercesImpl.lib}" tofile="${build.dist}/${xercesImpl.lib}"/>
<copy file="${lib.dir}/${xercesXmlApis.lib}" tofile="${build.dist}/${xercesXmlApis.lib}"/>
<!--
<copy file="${lib.dir}/${saxon-jdom.lib}" tofile="${build.dist}/${saxon-jdom.lib}"/>
<copy file="${lib.dir}/${saxon-xml-apis.lib}" tofile="${build.dist}/${saxon-xml-apis.lib}"/>
<copy file="${lib.dir}/${saxon.lib}" tofile="${build.dist}/${saxon.lib}"/>
-->
<copy file="${lib.dir}/${jdom.lib}" tofile="${build.dist}/${jdom.lib}"/>
<jar destfile="${build.dist}/xslt.jar"
manifest="resources/META-INF/xsltransformer.MANIFEST.MF">
<fileset dir="${build.classes}">
<include name="opendap/xml/Transformer.class"/>
</fileset>
</jar>
</target>
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<target name="opendap" depends="server" />
<target
name="server"
depends="clean,compile"
description="Performs a clean build of the core software and assembles the WAR file."
>
<echo level="info" message="Building Hyrax server war file."/>
<echo level="info" message="build.hyrax.resources: ${build.hyrax.resources}"/>
<echo level="info" message="build.dist: ${build.dist}"/>
<war destfile="${build.dist}/${DEPLOYMENT_CONTEXT}.war"
webxml="${build.hyrax.resources}/WEB-INF/web.xml"
>
<lib refid="hyrax-libs" />
<classes dir="${build.classes}"/>
<zipfileset dir="${build.hyrax.resources}" prefix="">
<include name="**/*"/>
<exclude name="WEB-INF/web.xml"/>
</zipfileset>
<zipfileset dir="${doc.dir}" prefix="docs">
<exclude name="src.distribution.readme"/>
</zipfileset>
</war>
<delete file="${build.dist}/index.html"/>
</target>
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<target
name="robots"
depends="compile"
description="Performs a clean build of the robots/sitemap service and assembles the WAR file."
>
<echo level="info" message="Building robots/sitemap ROOT service war file."/>
<echo level="info" message="build.robots.resources: ${build.robots.resources}"/>
<echo level="info" message="build.dist: ${build.dist}"/>
<echo level="info" message="Copying: ${build.robots.resources}/robots.jsp To: ${build.robots.resources}/robots.txt"/>
<move file="${build.robots.resources}/robots.jsp" tofile="${build.robots.resources}/robots.txt"/>
<war destfile="${build.dist}/ROOT.war"
webxml="${build.robots.resources}/WEB-INF/web.xml"
>
<lib refid="hyrax-libs" />
<classes dir="${build.classes}"/>
<zipfileset dir="${build.hyrax.resources}" prefix="">
<include name="WEB-INF/conf/olfs.xml"/>
</zipfileset>
<zipfileset dir="${build.robots.resources}" prefix="">
<include name="**/*"/>
<exclude name="WEB-INF/web.xml"/>
</zipfileset>
<zipfileset dir="${doc.dir}" prefix="docs">
<exclude name="src.distribution.readme"/>
</zipfileset>
<webinf dir="${build.robots.resources}/WEB-INF">
<include name="logback-test.xml"/>
<include name="logback.xml"/>
<include name="urlrewrite.xml"/>
</webinf>
</war>
<!-- delete file="${build.dist}/index.html"/ -->
</target>
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<target name="hyrax-robots"
depends="server,robots"
description="Builds the war files for the robots/sitemap and Hyrax's OLFS.">
</target>
<target name="hyrax-robots-dist"
depends="hyrax-robots"
description="Packages the war files for the robots/sitemap and Hyrax's OLFS into a tar file with a release related name.">
<copy file="README.md"
tofile="${build.dist}/README"/>
<tar destfile="${build.dist}/robots-${WEBAPP_DIST}.tgz"
compression="gzip">
<zipfileset dir="${build.dist}" prefix="robots-${WEBAPP_DIST}">
<include name="opendap.war"/>
<include name="ROOT.war"/>
<include name="README"/>
</zipfileset>
</tar>
<delete file="${build.dist}/README"/>
<delete file="${build.dist}/opendap.war"/>
<delete file="${build.dist}/ROOT.war"/>
</target>
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<!-- SonarCloud build stuff -->
<!-- Define the SonarQube global properties (the most usual way is to pass these properties via the command line) -->
<property name="sonar.host.url" value="https://sonarcloud.io" />
<property name="sonar.login" value="ping... ping... ping..." />
<!-- Define the SonarQube project properties -->
<property name="sonar.projectKey" value="opendap-olfs" />
<property name="sonar.projectName" value="olfs" />
<property name="sonar.projectVersion" value="${OLFS_VERSION}" />
<property name="sonar.organization" value="opendap" />
<property name="sonar.sources" value="src" />
<property name="sonar.exclusions" value="retired/**/*.java" />
<property name="sonar.java.binaries" value="build" />
<property name="sonar.java.libraries" value="lib/*.jar" />
<property name="sonar.log.level" value="DEBUG" />
<property name="sonar.ws.timeout" value="2700" />
<!-- Define SonarQube Scanner for Ant Target -->
<target name="sonar">
<taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
<!-- classpath path="resources/sonar/sonarqube-ant-task-2.6.0.1426.jar" / -->
<classpath path="resources/sonar/sonarqube-ant-task-2.7.1.1951.jar" />
</taskdef>
<!-- taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml" / -->
<!-- Execute SonarQube Scanner for Ant Analysis -->
<sonar:sonar />
</target>
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<target
name="ngap"
depends="clean,compile"
description="Performs a clean build of the core software and assembles the WAR file.">
<echo level="info" message="Building Hyrax NGAP server war file."/>
<echo level="info" message="build.hyrax.resources: ${build.hyrax.resources}"/>
<echo level="info" message="ngapResources.dir: ${ngapResources.dir}"/>
<echo level="info" message="build.dist: ${build.dist}"/>
<!-- Drop this bit, and the bits below that include it in the war and
delete it from the dist dir -->
<!-- copy file="${ngapResources.dir}/logback-ngap.xml" tofile="${build.dist}/logback-test.xml"/ -->
<!-- Combine the libraries in the build dir, for inclusion in the WAR file below. -->
<copy todir="${build.ngap.resources}/lib" filtering="false">
<fileset refid="hyrax-libs"/>
<fileset dir="${ngapResources.dir}/lib">
<!-- We exclude these because they get placed into
$CATALINA_HOM/lib when the Docker containers are built.-->
<exclude name="elasticache-java-cluster-client-1.1.2.jar"/>
<exclude name="memcached-session-manager-2.3.2.jar"/>
<exclude name="memcached-session-manager-tc7-2.3.2.jar"/>
</fileset>
</copy>
<!--
Here we:
- Set the WAR file name to ${NGAP_DEPLOYMENT_CONTEXT}.war (A value of
ROOT will deploy to "/".)
- Utilize a special NGAP web.xml that deploys with the Hyrax
authentication and authorization filters enabled
-->
<war destfile="${build.dist}/${NGAP_DEPLOYMENT_CONTEXT}.war"
webxml="${build.ngap.resources}/web.xml">
<lib dir="${build.ngap.resources}/lib"/>
<classes dir="${build.classes}"/>
<zipfileset dir="${build.hyrax.resources}" prefix="">
<include name="**/*"/>
<exclude name="WEB-INF/conf/olfs.xml"/>
<exclude name="WEB-INF/conf/logback.xml"/>
<exclude name="WEB-INF/web.xml"/>
<exclude name="WEB-INF/urlrewrite.xml"/>
</zipfileset>
<zipfileset dir="${build.ngap.resources}" prefix="WEB-INF">
<include name="urlrewrite.xml"/>
</zipfileset>
<zipfileset dir="${build.ngap.resources}" prefix="WEB-INF/conf">
<include name="logback.xml"/>
<include name="olfs.xml"/>
</zipfileset>
<zipfileset dir="${doc.dir}" prefix="docs">
<exclude name="src.distribution.readme"/>
</zipfileset>
<!-- = = = = = = NGAP LANDING PAGE = = = = = = -->
<zipfileset dir="${build.ngap.resources}/landing" prefix="docs/ngap" />
<zipfileset dir="${ngapResources.dir}/landing" prefix="docs/ngap">
<include name="*.png" />
</zipfileset>
<!-- = = = = = = = = = = = = = = = = = = = = = -->
</war>
<delete file="${build.dist}/index.html"/>
</target>
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<!-- == == == == == == == == == == == == == == == == == == == == == == -->
<target name="ngap-dist"
depends="ngap"
description="Packages the NGAP war file (${NGAP_DEPLOYMENT_CONTEXT}.war) into a gzipped tar file with a release related name.">