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-12 18:08:39 -0700 (Tue, 12 Aug 2003) $'
11
  *    '$Revision: 1801 $'
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: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="/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="tao"/>
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="45" />
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="itis"
126
                value="${morphosourcedir}/lib/itislib.jar" />
127
      <property name="emlparser"
128
                value="lib/eml.jar" />
129
      <property name="configxml"
130
                value="lib/configxml.jar" />
131
      <property name="itislib"
132
                value="lib/itislib.jar" />
133
      <property name="emlparser"
134
                value="lib/eml.jar" />
135
      <property name="util"
136
                value="lib/utilities.jar" />
137
  </target>
138

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
478
        <formatter type="plain" />
479

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

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

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

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

    
510
        <formatter type="plain" />
511

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

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

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

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

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

    
553
        <formatter type="plain" />
554

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

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

    
567

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

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

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

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

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

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

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

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

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