Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  *   '$RCSfile$'
4
  *     Authors: Matt Jones, Chad Berkley, Jivka Bojilova
5
  *   Copyright: 2000 Regents of the University of California and the
6
  *              National Center for Ecological Analysis and Synthesis
7
  * For Details: http://www.nceas.ucsb.edu/
8
  *
9
  *    '$Author: tao $'
10
  *    '$Date: 2003-08-21 17:25:12 -0700 (Thu, 21 Aug 2003) $'
11
  *    '$Revision: 1807 $'
12
  *
13
  * Build file for the Ant cross-platform build system for metacat
14
  * See http://jakarta.apache.org for details on Ant
15
  *
16
  * usage: ant [compile|jar|install|jdoc]
17
  *
18
  * This program is free software; you can redistribute it and/or modify
19
  * it under the terms of the GNU General Public License as published by
20
  * the Free Software Foundation; either version 2 of the License, or
21
  * (at your option) any later version.
22
  *
23
  * This program is distributed in the hope that it will be useful,
24
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26
  * GNU General Public License for more details.
27
  *
28
  * You should have received a copy of the GNU General Public License
29
  * along with this program; if not, write to the Free Software
30
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
31
-->
32
<project name="metacat" default="jar" basedir=".">
33
  <target name="oracle">
34
     <!-- Customize these properties if you are using oracle -->
35
     <property name="jdbc-connect"
36
               value="jdbc:oracle:thin:@pine.nceas.ucsb.edu:1521:knb"/>
37
     <property name="dbDriver" value="oracle.jdbc.driver.OracleDriver"/>
38
     <property name="dbAdapter" value="edu.ucsb.nceas.dbadapter.OracleAdapter"/>
39
     <property name="oracle_home" value="/usr/local/oracle/8.1.6" />
40
     <property name="jdbc" value="${oracle_home}/jdbc/lib/classes111.zip" />
41
     <!-- Property to indicate is not MSSQL installation-->
42
     <property name="other" value="yes"/>
43
   </target>
44

    
45
   <target name="postgresql">
46
     <!-- Customize these properties if you are using postgres -->
47
     <property name="jdbc-connect"
48
               value="jdbc:postgresql://localhost/exp"/>
49
     <property name="dbDriver" value="org.postgresql.Driver"/>
50
     <property name="dbAdapter"
51
               value="edu.ucsb.nceas.dbadapter.PostgresqlAdapter"/>
52
     <property name="jdbc" value="lib/jdbc7.1-1.2.jar" />
53
     <!-- Property to indicate is not MSSQL installation-->
54
     <property name="other" value="yes"/>
55
    </target>
56
   
57
   <target name="sqlserver">
58
     <!-- Customize these properties if you are using SQL server -->
59
     <property name="jdbc-connect"
60
               value="jdbc:microsoft:sqlserver://fatali.nceas.ucsb.edu:1433"/>
61
     <property name="dbDriver" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
62
     <property name="dbAdapter"
63
               value="edu.ucsb.nceas.dbadapter.SqlserverAdapter"/>
64
     <property name="jdbc-base" value="F:\\Program Files\\Microsoft SQL Server 2000 Driver for JDBC\\lib" />
65
     <property name="jdbc" value="${jdbc-base}/msbase.jar" />
66
     <property name="jdbc-add1" value="${jdbc-base}/msutil.jar" />
67
     <property name="jdbc-add2" value="${jdbc-base}/mssqlserver.jar" />
68
     <!-- Property to indicate is a MSSQL installation-->
69
     <property name="MSSQL" value="yes"/>
70
   </target>
71

    
72
   <target name="config" depends="oracle">
73
      <!-- Change the 'depends' attribute above to 'postgresql' to install
74
           metacat with postgres instead of oracle -->
75

    
76
      <!-- Customize these properties for your system -->
77
      <property name="tomcat" value="/usr/local/devtools/jakarta-tomcat" />
78
      <property name="webapps" value="/usr/local/devtools/jakarta-tomcat/webapps" />
79
      <property name="context" value="tao" />
80
      <property name="user" value="knb"/>
81

    
82
      <property name="password" value="tdataint"/>
83
      <property name="mcuser" value="uid=tao,o=NCEAS,dc=ecoinformatics,dc=org"/>
84
      <property name="mcpassword" value=""/>
85
      <property name="mcanotheruser" value="uid=jtao,o=LTER,dc=ecoinformatics,dc=org"/>
86
      <property name="mcanotherpassword" value=""/>
87

    
88
      <!-- Tomcat version, if you use tomcat 3, please fill it "tomcat3". If you using tomcat4, please fill it "tomcat4"-->
89
      <property name="tomcatversion" value="tomcat4"/>
90

    
91
      <property name="server" value="pine.nceas.ucsb.edu:8443"/>
92
      <property name="systemidserver" value="http://pine.nceas.ucsb.edu:8080" />
93
      <property name="datafilepath" value="/usr/local/devtools/jakarta-tomcat/data/tao/data" />
94
      <property name="inlinedatafilepath" value="/usr/local/devtools/jakarta-tomcat/data/tao/inlinedata" />
95
      <property name="debuglevel" value="55" />
96

    
97
      <property name="forcereplicationwaitingtime" value="30000"/>
98
      <property name="cvsroot"
99
                value=":ext:tao@cvs.ecoinformatics.org:/cvs" />
100
      <property name="web-base-url"
101
                value="http://knb.ecoinformatics.org"/>
102
      <property name="default-style" value="knb" />
103
      <property name="morphosourcedir" value="../morpho" />
104
      <property name="defaultcontenttype" value="application/octet-stream" />
105
      <property name="utilitiesdir" value="../utilities" />
106

    
107
      <!-- Make sure these paths match the location of the jar files
108
           on your system, the defaults should usually work -->
109
      <property name="jsdk"
110
                value="${tomcat}/common/lib/servlet.jar" />
111
      <property name="xmlp"
112
                value="lib/xercesImpl.jar" />
113
      <property name="srb"
114
                value="lib/srbrmi" />
115
      <property name="cos"
116
                value="lib/cos.jar" />
117
      <property name="morpho"
118
                value="lib/morpho.jar" />
119
      <property name="xalan"
120
                value="lib/xalan/xalan.jar" />
121
      <property name="apis"
122
                value="lib/xalan/xml-apis.jar" />
123
      <property name="httpclient"
124
                value="lib/httpclient.jar" />
125
      <property name="emlparser"
126
                value="lib/eml.jar" />
127
      <property name="configxml"
128
                value="lib/configxml.jar" />
129
      <property name="itislib"
130
                value="lib/itislib.jar" />
131
      <property name="emlparser"
132
                value="lib/eml.jar" />
133
      <property name="util"
134
                value="lib/utilities.jar" />
135
  </target>
136

    
137
   <target name="init" depends="config">
138
      <!-- It is less likely you'll need to make any changes from here down,
139
           but customization is possible -->
140
      <property name="installdir" value="${webapps}/${context}" />
141
      <property name="name" value="metacat"/>
142
      <property name="Name" value="MetaCat"/>
143
      <property name="debugprefix" value="${Name}:"/>
144
      <property name="release" value="1.2.1"/>
145
      <property name="replication-path"
146
                value="/${context}/servlet/replication"/>
147
      <property name="servlet-path" value="/${context}/servlet/metacat"/>
148
      <property name="html-path" value="/${context}"/>
149
      <property name="image-path" value="/${context}" />
150
      <property name="style-path" value="/${context}/style"/>
151
      <property name="replication-log" value="/tmp/metacatreplication.log"/>
152
      <property name="replicationerrorlog" value="/tmp/metacatreplication.err"/>
153
      <property name="config-dir" value="${installdir}" />
154
      <property name="eml-module" value="eml" />
155
      <property name="eml-version" value="2.0.0beta6" />
156
      <property name="eml-tag" value="RELEASE_EML_2_0_0_BETA_6_REV1" />
157
      <property name="eml2-tag" value="STMML_SCHEMA_UPDATE" />
158
      <property name="eml2namespace" value="eml://ecoinformatics.org/eml-2.0.0" />
159
      <property name="stmmlnamespace" value="http://www.xml-cml.org/schema/stmml" />
160

    
161
      <property name="cpath"
162
                value="${xmlp}:${xalan}:${apis}:${jdbc}:${jsdk}:${srb}:${cos}:${morpho}:${emlparser}:${jdbc-add1}:${jdbc-add2}:${util}:${httpclient}"/>
163

    
164
      <filter token="docrooturl" value="./" />
165
      <filter token="jdbc-connect" value="${jdbc-connect}"/>
166
      <filter token="dbDriver" value="${dbDriver}"/>
167
      <filter token="dbAdapter" value="${dbAdapter}"/>
168
      <filter token="install-dir" value="${installdir}"/>
169
      <filter token="server" value="${server}"/>
170
      <filter token="systemidserver" value="${systemidserver}"/>
171
      <filter token="replication-log" value="${replication-log}"/>
172
      <filter token="replicationerrorlog" value="${replicationerrorlog}"/>
173
      <filter token="release" value="${release}"/>
174
      <filter token="servlet-path" value="${servlet-path}"/>
175
      <filter token="html-path" value="${html-path}"/>
176
      <filter token="user" value="${user}"/>
177
      <filter token="password" value="${password}"/>
178
      <filter token="mcuser" value="${mcuser}"/>
179
      <filter token="mcpassword" value="${mcpassword}"/>
180
      <filter token="mcanotheruser" value="${mcanotheruser}"/>
181
      <filter token="mcanotherpassword" value="${mcanotherpassword}"/>
182
      <filter token="image-path" value="${image-path}"/>
183
      <filter token="style-path" value="${style-path}"/>
184
      <filter token="web-base-url" value="${web-base-url}"/>
185
      <filter token="replication-path" value="${replication-path}"/>
186
      <filter token="config-dir" value="${config-dir}"/>
187
      <filter token="default-style" value="${default-style}"/>
188
      <filter token="eml-version" value="${eml-version}"/>
189
      <filter token="eml2namespace" value="${eml2namespace}"/>
190
      <filter token="stmmlnamespace" value="${stmmlnamespace}"/>
191
      <filter token="context" value="${context}"/>
192
      <filter token="forcereplicationwaitingtime" value="${forcereplicationwaitingtime}" />
193
      <filter token="debuglevel" value="${debuglevel}" />
194
      <filter token="datafilepath" value="${datafilepath}" />
195
      <filter token="inlinedatafilepath" value="${inlinedatafilepath}" />
196
      <filter token="defaultcontenttype" value="${defaultcontenttype}" />
197
      <filter token="debugprefix" value="${debugprefix}"/>
198

    
199
      <property name="srcdir" value="./src" />
200
      <property name="testdir" value="./test" />
201
      <property name="testtorun" value="MetacatClientTest" />
202
      <property name="junittestsdir" value="./test/edu/ucsb/nceas/metacattest" />
203
      <property name="junitnettestsdir" value="./test/edu/ucsb/nceas/metacatnettest" />
204
      <property name="build.dir" value="./build"/>
205
      <property name="build.src" value="${build.dir}/src"/>
206
      <property name="build.dest" value="${build.dir}/classes"/>
207
      <property name="build.docs" value="${build.dir}/docs"/>
208
      <property name="build.samples" value="${build.dir}/samples"/>
209
      <property name="build.tests" value="${build.dir}/tests"/>
210
      <property name="build.tmp" value="${build.dir}/tmp"/>
211
      <property name="build.metacattest" value="${build.tests}/metacattest"/>
212
      <property name="build.metacatnettest" value="${build.tests}/metacatnettest"/>
213
      <property name="build.data" value="${build.dir}/data"/>
214
      <property name="build.javadocs" value="${build.dir}/docs/api"/>
215
      <property name="build.img" value="${installdir}"/>
216

    
217
      <property name="dist.dir" value="dist"/>
218
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
219
      <property name="ver.src" value="${ver.dir}/src"/>
220

    
221
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
222
   </target>
223

    
224
   <target name="prepare" depends="init">
225
      <mkdir dir="${build.dir}"/>
226
      <mkdir dir="${build.src}"/>
227
      <mkdir dir="${build.dest}"/>
228
      <mkdir dir="${build.javadocs}"/>
229
      <mkdir dir="${build.tmp}"/>
230

    
231
      <copy todir="${build.src}" filtering="yes">
232
        <fileset dir="${srcdir}">
233
          <include name="edu/**"/>
234
          <include name="com/**"/>
235
          <include name="**/*.sql"/>
236
          <exclude name="**/CVS*"/>
237
          <exclude name="**/.#*"/>
238
          <exclude name="edu/ucsb/nceas/metacat/harvesterClient/*.*"/>
239
        </fileset>
240
      </copy>
241
   </target>
242

    
243
   <target name="compile" depends="prepare">
244
       <javac srcdir="${build.src}"
245
              destdir="${build.dest}"
246
              classpath="${cpath}"
247
              excludes="**/*.sql" />
248
       <copy file="lib/metacat.properties"
249
             tofile="${build.dest}/${package.home}/metacat.properties"
250
             filtering="yes" />
251
       <copy file="lib/srbProps.properties"
252
             tofile="${build.dest}/${package.home}/srbProps.properties"/>
253
   </target>
254

    
255
   <target name="jar" depends="compile">
256
       <delete file="${build.dir}/${name}.jar" />
257
       <copy todir="${build.dest}">
258
         <fileset dir="lib/srbrmi"/>
259
       </copy>
260
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
261
            excludes="**/protocols/" />
262
   </target>
263

    
264
   <target name="protocol" depends="compile">
265
       <delete file="${build.dir}/protocol.jar" />
266
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
267
            includes="**/protocols/" />
268
   </target>
269

    
270
   <target name="utilities" depends="config">
271
     <ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
272
     <ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
273
     <copy file="${utilitiesdir}/lib/httpclient.jar" todir="lib" />
274
     <copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
275
   </target>
276

    
277
   <target name="client" depends="utilities, prepare">
278
       <javac srcdir="${build.src}"
279
              destdir="${build.dest}"
280
              classpath="${cpath}"
281
              includes="edu/ucsb/nceas/metacat/client/*" />
282
   </target>
283

    
284
   <target name="clientjar" depends="client">
285
       <delete file="${build.dir}/${name}-client.jar" />
286
       <jar jarfile="${build.dir}/${name}-client.jar" basedir="${build.dest}"
287
            includes="**/metacat/client/" />
288
   </target>
289

    
290
   <target name="getdtdschema" depends="prepare">
291
     <echo>Enter CVS password: </echo>
292
     <cvs cvsRoot="${cvsroot}"
293
          package="${eml-module}"
294
          tag="${eml-tag}"
295
          dest="${build.tmp}" />
296
     <mkdir dir="lib/dtd" />
297
     <copy todir="lib/dtd" filtering="yes">
298
       <fileset dir="${build.tmp}/${eml-module}">
299
         <include name="*.dtd"/>
300
       </fileset>
301
       <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
302
     </copy>
303
     <echo>Enter CVS password: </echo>
304
     <cvs cvsRoot="${cvsroot}"
305
          package="${eml-module}"
306
          tag="${eml2-tag}"
307
          dest="${build.tmp}" />
308
     <mkdir dir="lib/schema" />
309
     <copy todir="lib/schema" filtering="yes">
310
       <fileset dir="${build.tmp}/${eml-module}">
311
         <include name="*.xsd"/>
312
       </fileset>
313
     </copy>
314
     <copy todir="lib/style">
315
       <fileset dir="${build.tmp}/${eml-module}/style">
316
       <include name="*.xsl"/>
317
     </fileset>
318
     </copy>
319
   </target>
320

    
321
   <target name="getdtd" depends="prepare">
322
     <echo>Enter CVS password: </echo>
323
     <cvs cvsRoot="${cvsroot}"
324
          package="${eml-module}"
325
          tag="${eml-tag}"
326
          dest="${build.tmp}" />
327
     <mkdir dir="lib/dtd" />
328
     <copy todir="lib/dtd" filtering="yes">
329
       <fileset dir="${build.tmp}/${eml-module}">
330
         <include name="*.dtd"/>
331
       </fileset>
332
       <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
333
     </copy>
334
   </target>
335

    
336
   <target name="getschema" depends="prepare">
337
     <echo>Enter CVS password: </echo>
338
     <cvs cvsRoot="${cvsroot}"
339
          package="${eml-module}"
340
          tag="${eml2-tag}"
341
          dest="${build.tmp}" />
342
     <mkdir dir="lib/schema" />
343
     <copy todir="lib/schema" filtering="yes">
344
       <fileset dir="${build.tmp}/${eml-module}">
345
         <include name="*.xsd"/>
346
       </fileset>
347
     </copy>
348
     <copy todir="lib/style">
349
       <fileset dir="${build.tmp}/${eml-module}/style">
350
       <include name="*.xsl"/>
351
     </fileset>
352
     </copy>
353
   </target>
354

    
355
   <target name="dtdschemasql" depends="prepare">
356
     <echo/>
357
     <echo>Registering the DTDs with the new Metacat instance...</echo>
358
     <sql driver="${dbDriver}"
359
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
360
          url="${jdbc-connect}"
361
          userid="${user}"
362
          password="${password}"
363
          src="${build.src}/loaddtdschema.sql" />
364
   </target>
365

    
366
   <target name="schemasql" depends="prepare">
367
     <echo/>
368
     <echo>Registering the DTDs with the new Metacat instance...</echo>
369
     <sql driver="${dbDriver}"
370
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
371
          url="${jdbc-connect}"
372
          userid="${user}"
373
          password="${password}"
374
          src="${build.src}/loadschema.sql" />
375
   </target>
376
   
377
   <target name="installCommon" depends="jar">
378
       <mkdir dir="${datafilepath}" />
379
       <mkdir dir="${inlinedatafilepath}" />
380
       <chmod dir="${datafilepath}" perm="ug+w" />
381
       <mkdir dir="${installdir}/WEB-INF/lib" />
382
       <copy file="${build.dir}/${name}.jar"
383
             tofile="${installdir}/WEB-INF/lib/${name}.jar" />
384
       <copy file="${xmlp}"
385
             tofile="${installdir}/WEB-INF/lib/xercesImpl.jar" />
386
       <copy file="${xalan}"
387
             tofile="${installdir}/WEB-INF/lib/xalan.jar" />
388
       <copy file="${apis}"
389
             tofile="${installdir}/WEB-INF/lib/xml-apis.jar" />
390
       <copy file="${jdbc}"
391
             tofile="${installdir}/WEB-INF/lib/jdbc.jar" />
392
       <copy file="${cos}"
393
             tofile="${installdir}/WEB-INF/lib/cos.jar" />
394
       <copy file="${morpho}"
395
             tofile="${installdir}/WEB-INF/lib/morpho.jar" />
396
       <copy file="${emlparser}"
397
             tofile="${installdir}/WEB-INF/lib/eml.jar" />
398
       <copy file="${configxml}"
399
             tofile="${installdir}/WEB-INF/lib/configxml.jar" />
400
       <copy file="${itislib}"
401
             tofile="${installdir}/WEB-INF/lib/itislib.jar" />
402
       <copy file="lib/web.xml.${tomcatversion}"
403
             tofile="${installdir}/WEB-INF/web.xml" />
404
       <copy todir="${build.img}" filtering="no">
405
         <fileset dir="lib">
406
           <include name="**/*.jpg"/>
407
           <include name="**/*.png"/>
408
           <include name="**/*.gif"/>
409
         </fileset>
410
       </copy>
411
       <copy todir="${installdir}" filtering="yes">
412
         <fileset dir="lib">
413
           <exclude name="*.jar"/>
414
           <exclude name="*.properties"/>
415
           <exclude name="web.xml"/>
416
           <exclude name="**/srbrmi*"/>
417
           <exclude name="**/*.jpg"/>
418
           <exclude name="**/*.png"/>
419
           <exclude name="**/*.gif"/>
420
         </fileset>
421
       </copy>
422
       <echo>
423
             ***********************************************************
424
              Remember to register the default DTDs by running the
425
              "${build.src}/loaddtd.sql script". This is most easily
426
              done by using the "ant dtdsql" which will run it for you.
427
             ***********************************************************
428
       </echo>
429
   </target>
430
   
431
   <target name="installMSSQL" if="MSSQL" depends="installCommon">
432
      <echo> Install MSSQL</echo>
433
      <copy file="${jdbc-add1}"
434
             tofile="${installdir}/WEB-INF/lib/msutil.jar" />
435
       <copy file="${jdbc-add2}"
436
             tofile="${installdir}/WEB-INF/lib/mssqlserver.jar" />
437
   </target>
438
   
439
    <target name="installother" if="other" depends="installCommon">
440
        <echo> Install Other Database</echo>
441
   </target>
442
   
443
   <target name="install" depends="installMSSQL, installother">
444
     
445
   </target>
446
   
447
   <target name="testprep" depends="install">
448
      <mkdir dir="${build.tests}"/>
449
      <copy todir="${build.tests}" filtering="yes">
450
        <fileset dir="${testdir}">
451
          <include name="edu/**"/>
452
        </fileset>
453
      </copy>
454
   </target>
455

    
456
   <target name="test" depends="testprep">
457
      <!-- copy and compile the tests into a jar file -->
458
      <javac srcdir="${build.tests}"
459
             destdir="${build.tests}"
460
             classpath="${cpath}:${build.dir}/${name}.jar"
461
             debug="on"
462
       includes="**/*.java" />
463

    
464
      <jar jarfile="${build.dir}/${name}-junittests.jar"
465
        basedir="${build.tests}"
466
                includes="**/*.class" />
467

    
468
      <!-- use the ant "junit" task to run JUnit tests. -->
469
      <junit printsummary="yes" haltonfailure="no" fork="yes"
470
             haltonerror="no">
471
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
472
        <classpath>
473
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/${name}-junittests.jar" />
474
        </classpath>
475

    
476
        <formatter type="plain" />
477

    
478
        <batchtest fork="yes" todir="${build.dir}">
479
          <fileset dir="${build.tests}">
480
            <include name="**/*.class" />
481
          </fileset>
482
        </batchtest>
483
     </junit>
484
   </target>
485

    
486
    <target name="runonetest" depends="testprep">
487
      <!-- copy and compile the tests into a jar file -->
488
      <!--<property name="testtorun" value="SubTreeTest"/> -->
489
      <echo>testtorun: ${testtorun}</echo>
490
      <javac srcdir="${build.tests}"
491
             destdir="${build.tests}"
492
             classpath="${cpath}:${build.dir}/${name}.jar"
493
             debug="on"
494
       includes="**/*.java" />
495

    
496
      <jar jarfile="${build.dir}/${name}-junittests.jar"
497
        basedir="${build.tests}"
498
                includes="**/*.class" />
499

    
500
      <!-- use the ant "junit" task to run JUnit tests. -->
501
      <junit printsummary="yes" haltonfailure="no" fork="yes"
502
             haltonerror="no">
503
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
504
        <classpath>
505
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/${name}-junittests.jar" />
506
        </classpath>
507

    
508
        <formatter type="plain" />
509

    
510
        <batchtest fork="yes" todir="${build.dir}">
511
          <fileset dir="${build.tests}">
512
            <include name="**/${testtorun}.class" />
513
          </fileset>
514
        </batchtest>
515
     </junit>
516
   </target>
517

    
518
  <target name="gethttpclient" depends="prepare">
519
  <!--mkdir dir="${morphosourcedir}" -->
520
        <cvs cvsRoot="${cvsroot}"
521
             package="morpho"
522
             dest="." />
523
        <ant dir="${morphosourcedir}" inheritAll="false"  target="jar" />
524
   </target>
525

    
526
   <!-- run this target, we need to check out a another morpho souce dir was checked out. -->
527
   <target name="nettest" depends="install">
528
      <echo>***********************************
529
      Please run ant gethttpclient first!
530
      ***********************************
531
      </echo>
532
      <!-- copy and compile the tests into a jar file -->
533
      <mkdir dir="${build.metacatnettest}"/>
534
      <javac srcdir="${junitnettestsdir}"
535
             destdir="${build.metacatnettest}"
536
             classpath="${cpath}:${build.dir}/${name}.jar:${httpclient}"
537
             includes="**/*.java" />
538

    
539
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
540
                    basedir="${build.metacatnettest}"
541
                    includes="**/*.class" />
542

    
543
      <!-- use the ant "junit" task to run JUnit tests. -->
544
      <junit printsummary="yes" haltonfailure="no" fork="yes"
545
             haltonerror="no">
546
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
547
        <classpath>
548
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${httpclient}:${build.dir}/${name}-junitnettests.jar:${itislib}" />
549
        </classpath>
550

    
551
        <formatter type="plain" />
552

    
553
        <batchtest fork="yes" todir="${build.dir}">
554
          <fileset dir="${build.metacatnettest}">
555
            <include name="**/*.class" />
556
          </fileset>
557
        </batchtest>
558
     </junit>
559
   </target>
560

    
561
   <target name="servletclean" depends="clean">
562
     <delete dir="${installdir}" />
563
   </target>
564

    
565

    
566
   <target name="clean" depends="init">
567
       <delete dir="${build.dir}" />
568
   </target>
569

    
570
   <target name="jdoc" depends="prepare">
571
       <javadoc packagenames="edu.ucsb.nceas.*"
572
           sourcepath="${build.src}"
573
           destdir="${build.javadocs}"
574
           author="true"
575
           version="true"
576
           use="true"
577
           windowtitle="${Name} API"
578
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
579
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;"
580
       />
581
   </target>
582

    
583
   <target name="dist" depends="jar,protocol,jdoc,getdtd,getschema">
584
      <mkdir dir="${dist.dir}"/>
585
      <delete dir="${ver.dir}" />
586
      <mkdir dir="${ver.dir}"/>
587
      <copy todir="${ver.dir}">
588
        <fileset dir="."
589
            excludes="**/CVS* **/.#* **/src* **/test* **/build* **/docs* ${dist.dir}"/>
590
      </copy>
591
      <copy todir="${ver.dir}" file="build.xml"/>
592
      <copy todir="${ver.dir}/lib" file="${build.dir}/metacat.jar"/>
593
      <copy todir="${ver.dir}/lib" file="${build.dir}/protocol.jar"/>
594

    
595
      <copy todir="${ver.dir}/docs" filtering="yes">
596
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
597
      </copy>
598
      <copy todir="${ver.dir}/docs" filtering="no">
599
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
600
      </copy>
601
      <copy todir="${ver.dir}/docs/dev">
602
        <fileset dir="${build.dir}/docs"/>
603
      </copy>
604
      <copy todir="${ver.dir}/src">
605
        <fileset dir="${build.dir}/src"/>
606
      </copy>
607

    
608
      <delete dir="./${ver.dir}/${build.dir}"/>
609
      <delete dir="./${ver.dir}/dist"/>
610
      <delete file="./${name}-${release}.zip"/>
611
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
612
      <delete file="./${name}-${release}.tar.gz" />
613
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
614
      <gzip zipfile="./${name}-${release}.tar.gz"
615
                src="./${name}-${release}.tar"/>
616
      <delete file="./${name}-${release}.tar" />
617
  </target>
618

    
619
  <target name="distsrc" depends="dist">
620
      <mkdir dir="${ver.src}"/>
621
      <copy todir="${ver.src}">
622
        <fileset dir="./src"/>
623
      </copy>
624

    
625
      <delete file="./${name}-src-${release}.zip"/>
626
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
627
      <delete file="./${name}-src-${release}.tar.gz" />
628
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
629
      <gzip zipfile="./${name}-src-${release}.tar.gz"
630
                src="./${name}-src-${release}.tar"/>
631
      <delete file="./${name}-src-${release}.tar" />
632
      <delete dir="${dist.dir}"/>
633
  </target>
634

    
635
   <target name="stylesheettest">
636
     <xslt in="${input}" out="eml.html" style="lib/style/eml2/eml-2.0.0.xsl">
637
      <param name="displaymodule" expression="${displaymodule}"/>
638
      <param name="docid" expression="${input}"/>
639
      <param name="entitytype" expression="${entitytype}"/>
640
      <param name="entityindex" expression="${entityindex}"/>
641
      <outputproperty name="method" value="html"/>
642
      <outputproperty name="standalone" value="yes"/>
643
      <outputproperty name="encoding" value="iso8859_1"/>
644
      <outputproperty name="indent" value="yes"/>
645
    </xslt>
646
  </target>
647

    
648
</project>
(4-4/4)