This repository has been archived by the owner on May 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
974 lines (868 loc) · 40.7 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
<?xml version="1.0"?>
<!--
* build.xml
*
* Authors: Matt Jones
* Copyright: 2000 Regents of the University of California and the
* National Center for Ecological Analysis and Synthesis
* For Details: http://www.nceas.ucsb.edu/
* File Info: '$Id: build.xml,v 1.144 2009-06-02 16:38:05 tao Exp $'
*
* 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|jdoc]
-->
<project name="morpho" default="install" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<!-- include basedir so that this ant project can be imported by other's -->
<dirname property="morpho.basedir" file="${ant.file.morpho}"/>
<!-- 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>
<target name="init" unless="init.called">
<property name="name" value="morpho"/>
<property name="Name" value="Morpho Data Management Client"/>
<property name="release" value="2.0.0-RC2"/>
<property name="keystore" value="myKeystore"/>
<property name="storepass" value="your-pw-goes-here"/>
<property name="certificateLocation" value="/tmp/yourcert.pem"/>
<!--<property name="utilities-tag" value="trunk" />-->
<property name="utilities-tag" value="tags/UTILITIES_1_4_0" />
<property name="svn-utilitiesUrl"
value="https://code.ecoinformatics.org/code/utilities/${utilities-tag}" />
<property name="eml-module" value="eml" />
<property name="eml-svn-base-url" value="https://code.ecoinformatics.org/code/eml"/>
<property name="eml.git.repository.url" value="https://github.com/NCEAS/eml.git" />
<!-- the following two properties will be used to get newest eml doc-->
<property name="eml-doc-tag" value="RELEASE_EML_2_1_1" />
<property name="eml.doc.dir" value="docs/eml-2.1.1" />
<!-- the following property will be used to get eml210 schemas -->
<property name="eml-210-schema-tag" value="RELEASE_EML_2_1_0" />
<!-- the following property will be used to get eml211 schemas -->
<property name="eml-211-schema-tag" value="RELEASE_EML_2_1_1" />
<!-- eml-style-tag only be used to get xsl files that are different from schema releases -->
<property name="eml-style-tag" value="tags/RELEASE_EML_UTILS_1_1_1" />
<!--<property name="eml-style-tag" value="trunk" />-->
<property name="helpjar" value="morphohelp.jar" />
<filter token="release" value="${release}"/>
<filter token="certificateLocation" value="${certificateLocation}"/>
<filter token="server" value="http://knb.ecoinformatics.org"/>
<filter token="docrooturl" value="/"/>
<property name="itisdir" value="${morpho.basedir}/../itislib" />
<property name="srcdir" value="${morpho.basedir}/src" />
<property name="libdir" value="${morpho.basedir}/lib" />
<property name="xsldir" value="${morpho.basedir}/xsl" />
<property name="schemadir" value="${morpho.basedir}/xsd"/>
<property name="docuserdir" value="${morpho.basedir}/docs/user" />
<property name="jwsdir"
value="/var/www/org.ecoinformatics.knb/software/dist/morpho" />
<property name="testdir" value="${morpho.basedir}/tests" />
<property name="styledir" value="${libdir}/style" />
<property name="build.dir" value="${morpho.basedir}/build"/>
<property name="build.src" value="${build.dir}/src"/>
<property name="build.dest" value="${build.dir}/classes"/>
<property name="build.lib" value="${build.dir}/lib"/>
<property name="build.docs" value="${build.dir}/docs"/>
<property name="build.samples" value="${build.dir}/samples"/>
<property name="build.tests" value="${build.dir}/tests"/>
<property name="build.data" value="${build.dir}/data"/>
<property name="build.javadocs" value="${build.dir}/docs/api"/>
<property name="build.xsl" value="${build.dir}/xsl"/>
<property name="build.schema" value="${build.dir}/schema"/>
<!-- don't modify this value-->
<property name="java.help.doc.dir" value="${morpho.basedir}/morphohelp" />
<property name="searchDB" value="${morpho.basedir}/JavaHelpSearch"/>
<property name="help.system.file" value="morpho.hs"/>
<property name="map.file" value="Map.jhm"/>
<property name="help.toc" value="morphoTOC.xml"/>
<property name="help.index" value="morphoIndex.xml"/>
<!-- userguide in LaTex -->
<property name="userguide.basedir" value="${docuserdir}/latex"/>
<property name="userguide.fileprefix" value="MorphoUserGuide"/>
<property name="dist.dir" value="${morpho.basedir}/dist"/>
<property name="morpho.dir" value="${dist.dir}/morpho-${release}"/>
<property name="morpho.lib" value="${morpho.dir}/lib"/>
<property name="morpho.xsl" value="${morpho.dir}/xsl"/>
<property name="morpho.lib.catalog" value="${morpho.lib}/catalog"/>
<property name="morpho.lib.frames" value="${morpho.lib}/frames"/>
<property name="morpho.lib.sampledata" value="${morpho.lib}/sampledata"/>
<property name="morpho.lib.style" value="${morpho.lib}/style"/>
<property name="morpho.src" value="${morpho.dir}/src"/>
<property name="morpho.docs" value="${morpho.dir}/docs"/>
<property name="morpho.docs.dev" value="${morpho.docs}/dev"/>
<property name="morpho.docs.user" value="${morpho.docs}/user"/>
<property name="morpho.docs.licenses" value="${morpho.docs}/licenses"/>
<property name="morpho.docs.dev.api" value="${morpho.docs.dev}/api"/>
<!-- override the morpho property for other builds -->
<property name="morpho.args" value=".morpho2"/>
<!-- NOTE: location is machine specific - insert 'Launch4J' location on your machine! This
property will be used in buildwininstaller target. -->
<property name="launch4j.dir" location="/Applications/launch4j" />
<!-- NOTE: location is machine specific - insert LaTex bin path on your machine! This
property will be used in 'helppdf' target. -->
<property name="latex.path" value="/usr/local/texlive/2014/bin/universal-darwin"/>
<property name="izpackjar"
value="${libdir}/standalone-compiler.jar"/>
<property name="morpho"
value="${build.lib}/${name}.jar" />
<property name="help"
value="${libdir}/morphohelp.jar" />
<property name="utilities"
value="${libdir}/utilities.jar" />
<property name="index"
value="${libdir}/jhindexer.jar"/>
<property name="axis"
value="${libdir}/axis/axis.jar"/>
<property name="package.home" value="edu/ucsb/nceas" />
<condition property="utilities.required">
<or>
<not><available file="${utilities}" type="file"/></not>
</or>
</condition>
<condition property="eml210schema.needed">
<or>
<not><available file="${schemadir}/eml-2.1.0/eml.xsd" type="file"/></not>
</or>
</condition>
<condition property="eml211schema.needed">
<or>
<not><available file="${schemadir}/eml-2.1.1/eml.xsd" type="file"/></not>
</or>
</condition>
<condition property="transformstylesheet.needed">
<or>
<not><available file="${xsldir}/eml201to210.xsl" type="file"/></not>
<not><available file="${xsldir}/eml201to211.xsl" type="file"/></not>
<not><available file="${xsldir}/eml210to211.xsl" type="file"/></not>
<not><available file="${xsldir}/eml2tonbii.xsl" type="file"/></not>
<!-- make sure the eml2 stylesheets are in place from EML project -->
<not><available file="${styledir}/eml2/eml.xsl" type="file"/></not>
</or>
</condition>
<property name="nbii.jarname" value="nbii.jar" />
<property name="wsdl.url.nbii" value="http://nbii-thesaurus.ornl.gov/ws/services/SKOSThesaurusService?wsdl" />
<!-- for easier classpath management (so many axis jars!)-->
<path id="base.classpath">
<fileset dir="${libdir}">
<include name="*.jar" />
</fileset>
<fileset dir="${libdir}/axis">
<include name="*.jar" />
</fileset>
</path>
<path id="classpath.runtime">
<fileset dir="${build.lib}">
<include name="*.jar" />
</fileset>
</path>
<taskdef resource="axis-tasks.properties" classpathref="base.classpath"/>
<!-- set up the latex task -->
<taskdef name="latex" classname="de.dokutransdata.antlatex.LaTeX" classpathref="base.classpath" />
<!-- set up svn -->
<property name="svnant.lib" value="${morpho.basedir}/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" />
<!-- 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" />
<!-- If you drop the maven-ant-tasks in ~/.ant/lib, you don't need these two bits. -->
<taskdef uri="antlib:org.apache.maven.artifact.ant"
resource="org/apache/maven/artifact/ant/antlib.xml"
classpathref="base.classpath" />
<!-- Resolve maven dependencies -->
<artifact:pom id="morphoPom" file="${morpho.basedir}/pom.xml" />
<artifact:dependencies filesetId="dependency.fileset" pomrefid="morphoPom" usescope="runtime"/>
<artifact:dependencies pathId="dependency.classpath" pomrefid="morphoPom"/>
<property name="libdir.mvn" value="${libdir}/maven" />
<!-- combine base and dependencies for the classpath -->
<path id="classpath">
<path refid="base.classpath" />
<path refid="dependency.classpath" />
</path>
<property name="init.called" value="true" />
</target>
<target name="generateNBIIStubs" depends="prepare">
<echo message=" Generating stubs for NBII from ${wsdl.url.nbii}" />
<axis-wsdl2java verbose="true" output="${build.src}"
url="${wsdl.url.nbii}" />
</target>
<target name="compileNBII" depends="generateNBIIStubs">
<javac destdir="${build.dir}" debug="on" classpathref="classpath" >
<src path="${build.src}" />
</javac>
</target>
<target name="jarNBII" depends="compileNBII">
<jar jarfile="${build.dir}/${nbii.jarname}" basedir="${build.dir}" >
<include name="org/w3/www/**/*.*"/>
</jar>
<copy file="${build.dir}/${nbii.jarname}" todir="${libdir}" overwrite="true" />
</target>
<target name="prepare" depends="init">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.src}"/>
<mkdir dir="${build.dest}"/>
<mkdir dir="${build.lib}"/>
<mkdir dir="${build.javadocs}"/>
</target>
<target name="resolveD1" depends="init" description="retrieve DataONE dependencies with maven">
<echo>Moving Maven dependencies (${dependency.fileset}) to ${libdir.mvn} </echo>
<!-- Clear out mvn dir -->
<delete dir="${libdir.mvn}"></delete>
<!-- 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="emldoc" depends="prepare">
<!-- checkout eml module -->
<echo>Check out eml doc from ${eml-doc-tag}</echo>
<git-clone-pull repository="${eml.git.repository.url}"
dest="${build.docs}/${eml-module}" refname="${eml-doc-tag}" />
<ant dir="${build.docs}/${eml-module}" target="docs" inheritAll="false"/>
<mkdir dir="${java.help.doc.dir}" />
<copy todir="${java.help.doc.dir}/eml" filtering="no">
<fileset dir="${build.docs}/${eml-module}/${eml.doc.dir}">
<include name="**/*.html" />
<include name="**/*.png" />
<include name="**/*.css" />
</fileset>
</copy>
</target>
<target name="transform" depends="prepare">
<property name="input" value="${morpho.basedir}/tests/testfiles/eml201withadditionalMetacat.xml" />
<property name="output" value="eml210" />
<property name="stylesheetname" value="eml201to210.xsl" />
<xslt in="${input}" out="${output}" style="${xsldir}/${stylesheetname}">
<param name="filename" expression="${input}"/>
<outputproperty name="method" value="xml"/>
<outputproperty name="indent" value="yes"/>
</xslt>
</target>
<target name="getstylesheets" depends="prepare" if="transformstylesheet.needed">
<!-- checkout eml/eml201to210.xsl and eml2tonbii.xsl file -->
<echo>Check out eml conversion xsl files and NBII style sheet from source</echo>
<git-clone-pull repository="${eml.git.repository.url}"
dest="${build.xsl}/eml_${eml-style-tag}" refname="${eml-style-tag}" />
<copy file="${build.xsl}/eml_${eml-style-tag}/style/eml201to210.xsl" todir="${xsldir}" />
<copy file="${build.xsl}/eml_${eml-style-tag}/style/eml201to211.xsl" todir="${xsldir}" />
<copy file="${build.xsl}/eml_${eml-style-tag}/style/eml210to211.xsl" todir="${xsldir}" />
<copy file="${build.xsl}/eml_${eml-style-tag}/lib/eml2tonbii/eml2tonbii.xsl" todir="${xsldir}" />
<antcall target="copyemlstylesheet" />
</target>
<target name="copyemlstylesheet">
<!-- copy eml xslt files, except the settings file -->
<echo>Copy eml xsl files from source checkout to the lib dir</echo>
<copy todir="${styledir}/eml2">
<fileset dir="${build.xsl}/eml_${eml-style-tag}/style/eml" excludes="eml-settings.xsl"/>
</copy>
</target>
<target name="geteml210" depends="prepare" if="eml210schema.needed">
<!-- checkout eml moduel -->
<echo>Check out EML 2.1.0 schema from source</echo>
<mkdir dir="${build.schema}"/>
<git-clone-pull repository="${eml.git.repository.url}"
dest="${build.schema}/eml_${eml-210-schema-tag}" refname="${eml-210-schema-tag}" />
<mkdir dir="${schemadir}/eml-2.1.0" />
<copy todir="${schemadir}/eml-2.1.0" filtering="yes">
<fileset dir="${build.schema}/eml_${eml-210-schema-tag}">
<include name="*.xsd"/>
</fileset>
</copy>
</target>
<target name="geteml211" depends="prepare" if="eml211schema.needed">
<!-- checkout eml moduel -->
<echo>Check out EML 2.1.1 schema from source</echo>
<mkdir dir="${build.schema}"/>
<git-clone-pull repository="${eml.git.repository.url}"
dest="${build.schema}/eml_${eml-211-schema-tag}" refname="${eml-211-schema-tag}" />
<mkdir dir="${schemadir}/eml-2.1.1" />
<copy todir="${schemadir}/eml-2.1.1" filtering="yes">
<fileset dir="${build.schema}/eml_${eml-211-schema-tag}">
<include name="*.xsd"/>
</fileset>
</copy>
</target>
<target name="utilities" depends="prepare" if="utilities.required">
<!-- checkout utilities module -->
<echo message="Exporting utiities files from svn repository:" />
<svn>
<export srcUrl="${svn-utilitiesUrl}"
destPath="${build.dir}/utilities" />
</svn>
<ant inheritAll="false" dir="${build.dir}/utilities" target="jar" />
<delete file="${utilities}" />
<copy file="${build.dir}/utilities/build/utilities.jar" todir="${libdir}" />
</target>
<target name="helpjar" depends="prepare, emldoc">
<mkdir dir="${java.help.doc.dir}" />
<!-- copy morpho docs-->
<copy todir="${java.help.doc.dir}" filtering="no">
<fileset dir="${docuserdir}">
<include name="**/*.html" />
<include name="**/*.htm"/>
<include name="**/*.jpg" />
<include name="**/*.gif" />
<include name="*.css" />
<exclude name="*.html"/>
<exclude name="*.htm"/>
<exclude name="EMLHandbook.html"/>
<exclude name="EMLHandbook.html"/>
<exclude name="advanced/**" />
<exclude name="EmlDocs/**" />
<exclude name="latex/**" />
</fileset>
</copy>
<!-- copy metadata guide docs-->
<copy todir="${java.help.doc.dir}/EmlDocs/eml_guidebook" filtering="no" file="${docuserdir}/EmlDocs/eml_guidebook/eml_metadata_guide.html" >
</copy>
<!-- copy help systm files -->
<copy todir="." filtering="no">
<fileset dir="${docuserdir}">
<include name="${help.system.file}" />
<include name="${map.file}" />
<include name="${help.toc}" />
<include name="${help.index}"/>
</fileset>
</copy>
<!-- copy eml docs
<copy todir="${java.help.doc.dir}/eml" filtering="no">
<fileset dir="${build.docs}/${eml-module}/${eml.doc.dir}">
<include name="**/*.html" />
<include name="**/*.png" />
<include name="**/*.css" />
</fileset>
</copy>
-->
<!-- Creating search database -->
<!--<exec dir="${java.help.dir}" executable="${java.help.dir}/jhindexer" >
<arg line="morphohelp" />
</exec>-->
<java jar="${index}" fork="true">
<arg value="${java.help.doc.dir}"/>
</java>
<!-- delete help jar and create a new jar file -->
<delete file="${libdir}/${helpjar}" />
<jar destfile="${libdir}/${helpjar}" basedir="." includes="${help.system.file},${map.file}, ${help.toc}, ${help.index}, morphohelp/**/*, JavaHelpSearch/**/*">
</jar>
<!-- clean up the current dir-->
<delete>
<fileset dir="." includes="${help.system.file},${map.file}, ${help.toc}, ${help.index}, ${java.help.doc.dir}/**/*, ${searchDB}/**/*" />
</delete>
<delete dir="${java.help.doc.dir}"/>
<delete dir="${searchDB}" />
</target>
<target name="userguidepdf" depends="init">
<echo message="Creating ${userguide.fileprefix}.pdf from ${userguide.fileprefix}.tex" />
<latex
latexfile="${userguide.fileprefix}.tex"
verbose="on"
clean="on"
pdftex="on"
path="${latex.path}"
workingDir="${userguide.basedir}">
<makeindex
run="on"
workingDir="${userguide.basedir}"
path="${latex.path}">
<fileset dir="${userguide.basedir}">
<include name="*.nlo" />
</fileset>
</makeindex>
<bibtex
run="on"
workingDir="${userguide.basedir}"
path="${latex.path}"
/>
</latex>
</target>
<!--
<target name="compile" depends="clean,itis,prepare">
-->
<target name="compile" depends="prepare, utilities, geteml210, geteml211, getstylesheets">
<javac srcdir="${srcdir}"
destdir="${build.dest}"
debug="on"
classpathref="classpath" />
</target>
<target name="jar" depends="compile,prepare-lib">
<delete file="${build.dir}/${name}.jar" />
<delete file="${build.dir}/${name}-config.jar" />
<copy todir="${build.dest}/${package.home}/morpho/framework" filtering="no">
<fileset dir="${srcdir}/${package.home}/morpho/framework/images">
</fileset>
</copy>
<copy todir="${build.dest}/${package.home}/morpho/datapackage" filtering="no">
<fileset dir="${srcdir}/${package.home}/morpho/datapackage/images">
</fileset>
</copy>
<copy todir="${build.dest}/${package.home}/morpho/query" filtering="no">
<fileset dir="${srcdir}/${package.home}/morpho/query/images">
</fileset>
</copy>
<copy todir="${build.dest}/${package.home}/morpho/util" filtering="no">
<fileset dir="${srcdir}/${package.home}/morpho/util/images">
</fileset>
</copy>
<copy todir="${build.dest}/${package.home}/morpho/editor" filtering="no">
<fileset dir="${srcdir}/${package.home}/morpho/editor/images">
</fileset>
</copy>
<copy todir="${build.dest}/${package.home}/morpho/plugins/datapackagewizard/pages" filtering="no">
<fileset dir="${srcdir}/${package.home}/morpho/plugins/datapackagewizard/pages/images">
</fileset>
</copy>
<jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
includes="${package.home}/${name}/** com/** edu/tesc/**" >
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="edu.ucsb.nceas.morpho.Morpho"/>
<attribute name="Class-Path" value="../ ../lib/"/>
</manifest>
</jar>
<jar jarfile="${build.dir}/${name}-config.jar" basedir="${build.lib}"
excludes="*.jar,SchemaParser/**,LiveMap/**,*.zip,*.gz,axis/**,launch4j/**">
<metainf file="${build.lib}/mime.types"/>
</jar>
<copy file="${build.dir}/${name}-config.jar" tofile="${libdir}/${name}-config.jar"/>
</target>
<!-- copy necessary resources to build lib -->
<target name="prepare-lib" depends="prepare">
<copy todir="${build.lib}" filtering="no">
<fileset dir="${libdir}"
excludes="*.jar,SchemaParser/**,LiveMap/**,*.zip,*.gz,maven/**"/>
</copy>
<copy todir="${build.lib}" filtering="no">
<fileset dir="${libdir}"
includes="*.jar" excludes="maven-ant-tasks*.jar"/>
<fileset dir="${libdir}/axis"
includes="*.jar"/>
</copy>
<copy todir="${build.lib}" filtering="no">
<fileset refid="dependency.fileset" />
<!-- This mapper strips off all leading directory information -->
<mapper type="flatten" />
</copy>
<copy file="${morpho.basedir}/CONTRIBUTORS.txt" todir="${build.lib}" filtering="no" />
</target>
<target name="install" depends="jar">
<copy file="${build.dir}/${name}.jar" todir="${build.lib}" />
<copy file="${build.dir}/${name}-config.jar" todir="${build.lib}" />
<echo message="Install complete. Use the morpho script to run it." />
</target>
<target name="sign" depends="install">
<signjar jar="${build.lib}/${name}.jar" alias="myself"
storepass="${storepass}" keystore="${keystore}"/>
<signjar jar="${build.lib}/${name}-config.jar" alias="myself"
storepass="${storepass}" keystore="${keystore}"/>
</target>
<target name="jws" depends="sign">
<mkdir dir="${jwsdir}"/>
<copy todir="${jwsdir}" filtering="no">
<fileset dir=".">
<include name="*.jnlp"/>
</fileset>
<fileset dir="${build.lib}">
<include name="*.jar"/>
</fileset>
</copy>
</target>
<target name="dist" depends="install,docs,jdoc">
<mkdir dir="${dist.dir}"/>
<delete dir="${morpho.dir}" />
<mkdir dir="${morpho.dir}"/>
<mkdir dir="${morpho.lib}"/>
<mkdir dir="${morpho.lib.sampledata}"/>
<mkdir dir="${morpho.docs}"/>
<mkdir dir="${morpho.xsl}"/>
<mkdir dir="${morpho.docs.dev}"/>
<mkdir dir="${morpho.docs.dev.api}"/>
<copy file="${morpho.basedir}/LICENSE" todir="${morpho.dir}"/>
<copy file="${morpho.basedir}/morpho" todir="${morpho.dir}"/>
<copy file="${morpho.basedir}/morpho.bat" todir="${morpho.dir}"/>
<copy file="${morpho.basedir}/README.txt" todir="${morpho.dir}"/>
<copy todir="${morpho.lib.sampledata}">
<fileset dir="${morpho.basedir}/lib/sampledata"/>
</copy>
<copy todir="${morpho.xsl}">
<fileset dir="${morpho.basedir}/xsl"/>
</copy>
<copy todir="${morpho.docs}">
<fileset dir="${build.docs}">
<exclude name="**/api"/>
</fileset>
</copy>
<copy todir="${morpho.docs.dev.api}">
<fileset dir="${build.docs}/api"/>
</copy>
<copy todir="${morpho.lib}">
<fileset dir="${build.lib}" >
<include name="*.jar"/>
</fileset>
</copy>
<delete file="${morpho.basedir}/lib/morpho-${release}.zip"/>
<zip zipfile="${morpho.basedir}/lib/morpho-${release}.zip" basedir="${dist.dir}"/>
<delete file="${morpho.basedir}/lib/morpho-${release}.tar.gz" />
<tar tarfile="${morpho.basedir}/lib/morpho-${release}.tar" basedir="${dist.dir}"/>
<gzip zipfile="${morpho.basedir}/lib/morpho-${release}.tar.gz"
src="${morpho.basedir}/lib/morpho-${release}.tar"/>
<delete file="${morpho.basedir}/lib/morpho-${release}.tar" />
</target>
<target name="distsrc" depends="dist">
<mkdir dir="${morpho.src}"/>
<copy todir="${morpho.src}">
<fileset dir="${morpho.basedir}/src"/>
</copy>
<delete file="${morpho.basedir}/lib/morpho-src-${release}.zip"/>
<zip zipfile="${morpho.basedir}/lib/morpho-src-${release}.zip" basedir="${dist.dir}"/>
<delete file="${morpho.basedir}/lib/morpho-src-${release}.tar.gz" />
<tar tarfile="${morpho.basedir}/lib/morpho-src-${release}.tar" basedir="${dist.dir}"/>
<gzip zipfile="${morpho.basedir}/lib/morpho-src-${release}.tar.gz"
src="${morpho.basedir}/lib/morpho-src-${release}.tar"/>
<delete file="${morpho.basedir}/lib/morpho-src-${release}.tar" />
</target>
<target name="clean" depends="init">
<delete dir="${build.dir}" />
<delete dir="${morpho.dir}" />
<delete dir="${dist.dir}"/>
<delete file="${libdir}/${name}-config.jar" />
</target>
<!--Except clean, it also delete utilies.jar, eml-210 schema and eml201to210.xsl file.
Those files are checked out from another cvs.-->
<target name="fullclean" depends="clean">
<delete dir="${schemadir}/eml-2.1.0" />
<delete dir="${schemadir}/eml-2.1.1" />
<delete file="${utilities}" />
<delete file="${xsldir}/eml201to210.xsl" />
<delete file="${xsldir}/eml201to211.xsl" />
<delete file="${xsldir}/eml210to211.xsl" />
<delete file="${xsldir}/eml2tonbii.xsl" />
<delete dir="${styledir}/eml2" excludes="eml-settings.xsl" />
</target>
<target name="docs" depends="init">
<mkdir dir="${build.docs}"/>
<mkdir dir="${build.docs}/user"/>
<mkdir dir="${build.docs}/user/advanced"/>
<mkdir dir="${build.docs}/licenses"/>
<copy file="${morpho.basedir}/docs/README.txt" todir="${build.docs}"/>
<copy todir="${build.docs}/licenses" filtering="no">
<fileset dir="${morpho.basedir}/docs/licenses">
<exclude name="**/*.html"/>
</fileset>
</copy>
<copy todir="${build.docs}/user" filtering="no">
<fileset dir="${morpho.basedir}/docs/user">
<exclude name="**/*.html"/>
</fileset>
</copy>
<copy todir="${build.docs}/user" filtering="yes">
<fileset dir="${morpho.basedir}/docs/user">
<include name="*.html"/>
</fileset>
</copy>
<copy todir="${build.docs}/user/advanced" filtering="yes">
<fileset dir="${morpho.basedir}/docs/user/advanced">
<include name="*.html"/>
</fileset>
</copy>
</target>
<target name="jdoc" depends="init">
<mkdir dir="${build.javadocs}" />
<javadoc packagenames="edu.ucsb.nceas.*"
sourcepath="src"
destdir="${build.javadocs}"
author="true"
version="true"
use="true"
windowtitle="${Name} API"
doctitle="<h1>${Name}</h1>"
bottom="<i>Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.</i>"
/>
</target>
<target name="run" depends="install">
<java classname="edu.ucsb.nceas.morpho.Morpho"
fork="yes" dir="${morpho.basedir}" >
<classpath>
<path refid="classpath.runtime" />
<pathelement path="${morpho}:${help}"/>
</classpath>
<arg line="${morpho.args}"/>
<jvmarg value="-Xmx512m"/>
<jvmarg value="-Xss1m"/>
</java>
</target>
<!--
This target uses Launch$J (see http://launch4j.sourceforge.net/)
It will create a file ("Kepler-launch.exe" that will launch Kepler on a Windows box
Dan Higgins - Nov 2007
-->
<target name="buildwinexe" depends="install">
<!-- NOTE: location is machine specific - insert 'Launch4J' location on your machine! -->
<delete file="${morpho.basedir}/morpho.exe"/>
<taskdef name="launch4j"
classname="net.sf.launch4j.ant.Launch4jTask"
classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar"
onerror="ignore"/>
<!--launch4j configFile="${morpho.basedir}/installer/build/launch-morpho.xml"/-->
<launch4j>
<config
dontwrapjar="true"
headertype="gui"
outfile="${morpho.basedir}/morpho.exe"
errtitle="Morpho"
cmdline="${morpho.args}"
chdir="."
priority="normal"
downloadurl="http://java.com/download"
stayalive="false"
icon="${libdir}/DesktopIcon32x32.ico">
<classPath mainClass="edu.ucsb.nceas.morpho.Morpho">
<cp>%EXEDIR%/lib/*.jar</cp>
</classPath>
<jre minVersion="1.7.0" jdkPreference="preferJre">
<opt>-Xmx1024m</opt>
<opt>-Xss20m</opt>
<opt>-Djava.endorsed.dirs="%EXEDIR%/lib/jar/apache"</opt>
<opt>-Djava.library.path="%EXEDIR%/lib"</opt>
</jre>
</config>
</launch4j>
</target>
<!-- The target 'macjarbundler' builds a Mac OS X application bundle.
This provides a double-clickable icon that will launch a java
application on the Mac without the need to open the terminal and
type a long command string. It it thus similar to creating an
.exe file from launching Kepler on Windows.
The target uses an ant taskdef called 'jarbundler'
(see http://informagen.com/JarBundler/). For the target to work a
'jarbundler-n.n.jar' must be added to the ant /lib directory. This
task is supposed to be cross-platform (as long as a file called
'JavaApplicationStub' is available. However, I encountered a
problem with building the application bundle on a Windows machine
and moving the result to a Mac due to differences between '\' and
'/' in the classpath. It is thus suggested that this be run on a
Mac. (Dan Higgins 11/2007)
-->
<target name="macjarbundler" depends="install">
<taskdef name="appbundler"
classpath="${morpho.basedir}/lib/appbundler-1.0.jar"
classname="com.oracle.appbundler.AppBundlerTask"
onerror="ignore" />
<echo message="Using morpho args: ${morpho.args}"></echo>
<!--<jarbundler dir="${morpho.basedir}/"
name="morpho"
stubfile="${morpho.basedir}/installer/build/mac/JavaApplicationStub"
mainclass="edu.ucsb.nceas.morpho.Morpho"
icon="${morpho.basedir}/lib/DesktopIcon32x32.icns"
vmoptions="-Xmx1024m -Xss5m"
arguments="${morpho.args}">
<jarfileset dir="${build.lib}">
<include name="*.jar" />
</jarfileset>
</jarbundler> -->
<appbundler outputdirectory="${morpho.basedir}/"
name="Morpho"
displayname="Morpho"
identifier="edu.ucsb.nceas.morpho.Morpho"
icon="${morpho.basedir}/lib/DesktopIcon32x32.icns"
applicationCategory="public.app-category.developer-tools"
mainclassname="edu/ucsb/nceas/morpho/Morpho">
<!--<runtime dir="/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home"/>-->
<classpath dir="${build.lib}">
<include name="*.jar" />
</classpath>
<!--<option value="-Dapple.laf.useScreenMenuBar=true"/>
<option value="-Duser.dir=$APP_ROOT/Contents/Resources"/>-->
<option value="-Xmx1024M"/>
<option value="-Xss100M"/>
</appbundler>
<!--the executable file JavaAppLaunch generated by appbundler will lauch morpho with the working directory - user-home.
However, we want the working directory to be app-package-root. So we use the universalJavaApplicationStub from
https://github.com/tofi86/universalJavaApplicationStub to replace the JavaAppLaunch generated by appbundler.
-->
<copy todir="Morpho.app/Contents/MacOS" overwrite="yes">
<fileset dir="lib">
<include name="JavaAppLauncher"/>
</fileset>
</copy>
</target>
<!--Generates installer for windows, mac and linux-->
<target name="buildallinstallers" depends="clean, buildwininstaller, buildmacinstaller, buildlinuxinstaller" description="build all installlers for windows, mac and linux"/>
<!--
This target uses Launch4J (see http://launch4j.sourceforge.net/)
It will create a file ("morpho-installer.exe" that will install morpho on a Windows box
Dan Higgins - Jan 2008
-->
<target name="buildwininstaller" depends="init,wininstallercleanup,buildwinexe">
<property name="windows" value="windows">
</property>
<antcall target="makeinstaller">
<param name="os-name" value="${windows}"/>
<param name="version" value="${release}"/>
<param name="izpackjar" value="${izpackjar}"/>
</antcall>
<taskdef name="launch4j"
classname="net.sf.launch4j.ant.Launch4jTask"
classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/xstream.jar"
onerror="ignore"/>
<launch4j configFile="${morpho.basedir}/installer/build/launch-installer.xml"
outfile="${morpho.basedir}/morpho-${release}.exe" jar="${morpho.basedir}/morpho-${release}-${windows}.jar"/>
</target>
<!--Builds jar file for mac. Before run it, please edit installer/build/install.xml file -->
<target name="buildmacinstaller" depends="init,macinstallercleanup,macjarbundler">
<antcall target="makeinstaller">
<param name="os-name" value="mac"/>
<param name="version" value="${release}"/>
<param name="izpackjar" value="${izpackjar}"/>
</antcall>
</target>
<!--Builds jar installer file for linux. -->
<target name="buildlinuxinstaller" depends="init,linuxinstallercleanup,install">
<antcall target="makeinstaller">
<param name="os-name" value="linux"/>
<param name="version" value="${release}"/>
<param name="izpackjar" value="${izpackjar}"/>
</antcall>
</target>
<!-- The target "makeinstaller" uses the IzPack installer system (see http://izpack.org/)
to create an installer jar file. This is based on the script $KEPLER/installer/build/install.xml.
A jar file called 'IzPack-install.jar' is created in $KEPLER dir. This jar can be executed by
double clicking on Windows and on Mac OS X.
Dan Higgins - Nov 2007
-->
<target name="makeinstaller">
<taskdef name="izpack" classpath="${izpackjar}"
classname="com.izforge.izpack.ant.IzPackTask"
onerror="ignore"/>
<!-- We call IzPack -->
<echo message="Makes the installer using IzPack"/>
<izpack input="${morpho.basedir}/installer/build/install-${os-name}.xml"
output="${morpho.basedir}/morpho-${release}-${os-name}.jar"
installerType="standard"
basedir="${morpho.basedir}/"
inheritAll="true"/>
</target>
<!-- the following 3 targets clean up the build for system specific installers -->
<target name="macinstallercleanup">
<delete file="${morpho.basedir}/morpho-${release}-mac.jar"/>
<delete dir="${morpho.basedir}/morpho.app"/>
</target>
<target name="wininstallercleanup">
<delete file="${morpho.basedir}/morpho-${release}-windows.jar"/>
<delete file="${morpho.basedir}/morpho-${release}.exe"/>
</target>
<target name="linuxinstallercleanup">
<delete file="${morpho.basedir}/morpho-${release}-linux.jar"/>
</target>
<!-- use the ant "junit" task to run JUnit tests. -->
<target name="test" depends="install">
<!-- copy and compile the tests into a jar file -->
<mkdir dir="${build.tests}"/>
<copy todir="${build.tests}" filtering="yes">
<fileset dir="${testdir}">
<exclude name="**/CVS*"/>
<exclude name="**/.#*"/>
</fileset>
</copy>
<javac srcdir="${build.tests}"
destdir="${build.dest}"
classpathref="classpath"
debug="on"/>
<jar jarfile="${build.dir}/${name}-test.jar" basedir="${build.dest}"
includes="${package.home}/${name}test/**" />
<!-- use the ant "junit" task to run JUnit tests. -->
<junit printsummary="yes" haltonfailure="no" fork="no"
haltonerror="no">
<classpath>
<path refid="classpath" />
<pathelement path="${build.dir}/${name}-test.jar" />
</classpath>
<formatter type="plain" />
<batchtest fork="yes" todir="${build.dir}">
<fileset dir="${build.tests}">
<include name="**/*.java" />
</fileset>
</batchtest>
</junit>
</target>
<!-- use the ant "junit" task to run one JUnit tests. -->
<target name="runonetest" depends="install">
<echo>testtorun: ${testtorun}</echo>
<!-- copy and compile the tests into a jar file -->
<mkdir dir="${build.tests}"/>
<copy todir="${build.tests}" filtering="yes">
<fileset dir="${testdir}">
<exclude name="**/CVS*"/>
<exclude name="**/.#*"/>
</fileset>
</copy>
<javac srcdir="${build.tests}"
destdir="${build.dest}"
classpathref="classpath"
debug="on"/>
<jar jarfile="${build.dir}/${name}-test.jar" basedir="${build.dest}"
includes="${package.home}/${name}test/**" />
<!-- use the ant "junit" task to run JUnit one test. -->
<junit printsummary="yes" haltonfailure="no" fork="yes"
haltonerror="no" showoutput="yes">
<classpath>
<fileset dir="${build.lib}">
<include name="*.jar" />
<exclude name="standalone-compiler.jar"/>
</fileset>
<pathelement path="${build.dir}/${name}-test.jar" />
</classpath>
<formatter type="plain" />
<batchtest fork="yes" todir="${build.dir}">
<fileset dir="${build.tests}">
<include name="**/${testtorun}.java" />
</fileset>
</batchtest>
</junit>
</target>
<!-- build the itis library for querying ITIS -->
<target name="itis" depends="init">
<ant dir="${itisdir}" />
<copy file="${itisdir}/lib/itislib.jar" todir="${libdir}" />
</target>
</project>