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: jones $'
10
  *    '$Date: 2003-08-12 16:29:02 -0700 (Tue, 12 Aug 2003) $'
11
  *    '$Revision: 1796 $'
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:@dev.nceas.ucsb.edu:1521:exp"/>
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="/oracle01/app/oracle/product/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="postgresql">
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="tao"/>
81
      <property name="password" value=""/>
82
      <property name="mcuser" value="uid=jones,o=NCEAS,dc=ecoinformatics,dc=org"/>
83
      <property name="mcpassword" value=""/>
84
      <!-- Tomcat version, if you use tomcat 3, please fill it "tomcat3". If you using tomcat4, please fill it "tomcat4"-->
85
      <property name="tomcatversion" value="tomcat4"/>
86

    
87
      <property name="server" value="pine.nceas.ucsb.edu:8443"/>
88
      <property name="systemidserver" value="http://pine.nceas.ucsb.edu:8080" />
89
      <property name="datafilepath" value="/usr/local/devtools/jakarta-tomcat/data/tao/data" />
90
      <property name="inlinedatafilepath" value="/usr/local/devtools/jakarta-tomcat/data/tao/inlinedata" />
91
      <property name="debuglevel" value="45" />
92

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

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

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

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

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

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

    
213
      <property name="dist.dir" value="dist"/>
214
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
215
      <property name="ver.src" value="${ver.dir}/src"/>
216

    
217
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
218
   </target>
219

    
220
   <target name="prepare" depends="init">
221
      <mkdir dir="${build.dir}"/>
222
      <mkdir dir="${build.src}"/>
223
      <mkdir dir="${build.dest}"/>
224
      <mkdir dir="${build.javadocs}"/>
225
      <mkdir dir="${build.tmp}"/>
226

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

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

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

    
260
   <target name="protocol" depends="compile">
261
       <delete file="${build.dir}/protocol.jar" />
262
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
263
            includes="**/protocols/" />
264
   </target>
265

    
266
   <target name="utilities" depends="config">
267
     <ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
268
     <ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
269
     <copy file="${utilitiesdir}/lib/httpclient.jar" todir="lib" />
270
     <copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
271
   </target>
272

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

    
280
   <target name="clientjar" depends="client">
281
       <delete file="${build.dir}/${name}-client.jar" />
282
       <jar jarfile="${build.dir}/${name}-client.jar" basedir="${build.dest}"
283
            includes="**/metacat/client/" />
284
   </target>
285

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

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

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

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

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

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

    
460
      <jar jarfile="${build.dir}/${name}-junittests.jar"
461
        basedir="${build.tests}"
462
                includes="**/*.class" />
463

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

    
472
        <formatter type="plain" />
473

    
474
        <batchtest fork="yes" todir="${build.dir}">
475
          <fileset dir="${build.tests}">
476
            <include name="**/*.class" />
477
          </fileset>
478
        </batchtest>
479
     </junit>
480
   </target>
481

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

    
492
      <jar jarfile="${build.dir}/${name}-junittests.jar"
493
        basedir="${build.tests}"
494
                includes="**/*.class" />
495

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

    
504
        <formatter type="plain" />
505

    
506
        <batchtest fork="yes" todir="${build.dir}">
507
          <fileset dir="${build.tests}">
508
            <include name="**/${testtorun}.class" />
509
          </fileset>
510
        </batchtest>
511
     </junit>
512
   </target>
513

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

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

    
535
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
536
                    basedir="${build.metacatnettest}"
537
                    includes="**/*.class" />
538

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

    
547
        <formatter type="plain" />
548

    
549
        <batchtest fork="yes" todir="${build.dir}">
550
          <fileset dir="${build.metacatnettest}">
551
            <include name="**/*.class" />
552
          </fileset>
553
        </batchtest>
554
     </junit>
555
   </target>
556

    
557
   <target name="servletclean" depends="clean">
558
     <delete dir="${installdir}" />
559
   </target>
560

    
561

    
562
   <target name="clean" depends="init">
563
       <delete dir="${build.dir}" />
564
   </target>
565

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

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

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

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

    
615
  <target name="distsrc" depends="dist">
616
      <mkdir dir="${ver.src}"/>
617
      <copy todir="${ver.src}">
618
        <fileset dir="./src"/>
619
      </copy>
620

    
621
      <delete file="./${name}-src-${release}.zip"/>
622
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
623
      <delete file="./${name}-src-${release}.tar.gz" />
624
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
625
      <gzip zipfile="./${name}-src-${release}.tar.gz"
626
                src="./${name}-src-${release}.tar"/>
627
      <delete file="./${name}-src-${release}.tar" />
628
      <delete dir="${dist.dir}"/>
629
  </target>
630

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

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