Project

General

Profile

1 113 jones
<?xml version="1.0"?>
2 1311 berkley
<!--
3 670 jones
  *   '$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 113 jones
  *
9 670 jones
  *    '$Author$'
10 1292 tao
  *    '$Date$'
11
  *    '$Revision$'
12 666 jones
  *
13 670 jones
  * Build file for the Ant cross-platform build system for metacat
14
  * See http://jakarta.apache.org for details on Ant
15 113 jones
  *
16 303 jones
  * usage: ant [compile|jar|install|jdoc]
17 666 jones
  *
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 1311 berkley
-->
32 329 jones
<project name="metacat" default="jar" basedir=".">
33 1742 tao
  <target name="oracle">
34 931 jones
     <!-- 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 925 berkley
     <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 1744 tao
     <!-- Property to indicate is not MSSQL installation-->
42
     <property name="other" value="yes"/>
43 925 berkley
   </target>
44 1311 berkley
45 925 berkley
   <target name="postgresql">
46 931 jones
     <!-- Customize these properties if you are using postgres -->
47 1311 berkley
     <property name="jdbc-connect"
48 1570 tao
               value="jdbc:postgresql://localhost/exp"/>
49 925 berkley
     <property name="dbDriver" value="org.postgresql.Driver"/>
50 1311 berkley
     <property name="dbAdapter"
51 931 jones
               value="edu.ucsb.nceas.dbadapter.PostgresqlAdapter"/>
52 1716 berkley
     <property name="jdbc" value="lib/jdbc7.1-1.2.jar" />
53 1744 tao
     <!-- Property to indicate is not MSSQL installation-->
54
     <property name="other" value="yes"/>
55
    </target>
56 1739 tao
57
   <target name="sqlserver">
58
     <!-- Customize these properties if you are using SQL server -->
59
     <property name="jdbc-connect"
60 1742 tao
               value="jdbc:microsoft:sqlserver://fatali.nceas.ucsb.edu:1433"/>
61 1739 tao
     <property name="dbDriver" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
62
     <property name="dbAdapter"
63
               value="edu.ucsb.nceas.dbadapter.SqlserverAdapter"/>
64 1742 tao
     <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 1744 tao
     <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 1739 tao
   </target>
71 1311 berkley
72 1744 tao
   <target name="config" depends="postgresql">
73 1311 berkley
      <!-- Change the 'depends' attribute above to 'postgresql' to install
74 931 jones
           metacat with postgres instead of oracle -->
75
76
      <!-- Customize these properties for your system -->
77 1744 tao
      <property name="tomcat" value="/usr/local/devtools/jakarta-tomcat" />
78
      <property name="webapps" value="/usr/local/devtools/jakarta-tomcat/webapps" />
79 1722 tao
      <property name="context" value="tao" />
80
      <property name="user" value="tao"/>
81 1742 tao
      <property name="password" value="tdataint"/>
82 1729 tao
      <!-- Tomcat version, if you use tomcat 3, please fill it "tomcat3". If you using tomcat4, please fill it "tomcat4"-->
83 1771 tao
      <property name="tomcatversion" value="tomcat4"/>
84 1716 berkley
85 1744 tao
      <property name="server" value="pine.nceas.ucsb.edu:8443"/>
86
      <property name="systemidserver" value="http://pine.nceas.ucsb.edu:8080" />
87
      <property name="datafilepath" value="/usr/local/devtools/jakarta-tomcat/data/tao/data" />
88
      <property name="inlinedatafilepath" value="/usr/local/devtools/jakarta-tomcat/data/tao/inlinedata" />
89 1771 tao
      <property name="debuglevel" value="45" />
90 1716 berkley
91 1292 tao
      <property name="forcereplicationwaitingtime" value="30000"/>
92 1523 tao
      <property name="cvsroot"
93 1722 tao
                value=":ext:tao@cvs.ecoinformatics.org:/cvs" />
94 1311 berkley
      <property name="web-base-url"
95 931 jones
                value="http://knb.ecoinformatics.org"/>
96
      <property name="default-style" value="knb" />
97 1522 berkley
      <property name="morphosourcedir" value="../morpho" />
98 1570 tao
      <property name="defaultcontenttype" value="application/octet-stream" />
99 931 jones
100
      <!-- Make sure these paths match the location of the jar files
101
           on your system, the defaults should usually work -->
102 1311 berkley
      <property name="jsdk"
103 1742 tao
                value="${tomcat}/common/lib/servlet.jar" />
104 1311 berkley
      <property name="xmlp"
105 1376 tao
                value="lib/xercesImpl.jar" />
106 1311 berkley
      <property name="srb"
107 931 jones
                value="lib/srbrmi" />
108 1311 berkley
      <property name="cos"
109 931 jones
                value="lib/cos.jar" />
110 939 tao
      <property name="morpho"
111
                value="lib/morpho.jar" />
112 931 jones
      <property name="xalan"
113
                value="lib/xalan/xalan.jar" />
114
      <property name="apis"
115
                value="lib/xalan/xml-apis.jar" />
116 1103 tao
      <property name="httpclient"
117
                value="${morphosourcedir}/lib/httpclient.jar" />
118
      <property name="itis"
119 1311 berkley
                value="${morphosourcedir}/lib/itislib.jar" />
120 1470 tao
      <property name="emlparser"
121
                value="lib/eml.jar" />
122
      <property name="configxml"
123
                value="lib/configxml.jar" />
124 1578 tao
      <property name="itislib"
125
                value="lib/itislib.jar" />
126 1487 tao
      <property name="emlparser"
127
                value="lib/eml.jar" />
128 1103 tao
  </target>
129
130 931 jones
   <target name="init" depends="config">
131
      <!-- It is less likely you'll need to make any changes from here down,
132
           but customization is possible -->
133
      <property name="installdir" value="${webapps}/${context}" />
134 348 jones
      <property name="name" value="metacat"/>
135
      <property name="Name" value="MetaCat"/>
136 1538 berkley
      <property name="debugprefix" value="${Name}:"/>
137 1339 tao
      <property name="release" value="1.2.1"/>
138 1311 berkley
      <property name="replication-path"
139 931 jones
                value="/${context}/servlet/replication"/>
140
      <property name="servlet-path" value="/${context}/servlet/metacat"/>
141
      <property name="html-path" value="/${context}"/>
142 1437 berkley
      <property name="image-path" value="/${context}" />
143 931 jones
      <property name="style-path" value="/${context}/style"/>
144 923 jones
      <property name="replication-log" value="/tmp/metacatreplication.log"/>
145 1579 tao
      <property name="replicationerrorlog" value="/tmp/metacatreplication.err"/>
146 832 jones
      <property name="config-dir" value="${installdir}" />
147 924 jones
      <property name="eml-module" value="eml" />
148 877 jones
      <property name="eml-version" value="2.0.0beta6" />
149 1227 tao
      <property name="eml-tag" value="RELEASE_EML_2_0_0_BETA_6_REV1" />
150 1722 tao
      <property name="eml2-tag" value="STMML_SCHEMA_UPDATE" />
151 1570 tao
      <property name="eml2namespace" value="eml://ecoinformatics.org/eml-2.0.0" />
152 1718 tao
      <property name="stmmlnamespace" value="http://www.xml-cml.org/schema/stmml" />
153 348 jones
154 1311 berkley
      <property name="cpath"
155 1744 tao
                value="${xmlp}:${xalan}:${apis}:${jdbc}:${jsdk}:${srb}:${cos}:${morpho}:${emlparser}:${jdbc-add1}:${jdbc-add2}"/>
156 882 jones
157
      <filter token="docrooturl" value="./" />
158 588 berkley
      <filter token="jdbc-connect" value="${jdbc-connect}"/>
159 882 jones
      <filter token="dbDriver" value="${dbDriver}"/>
160 915 berkley
      <filter token="dbAdapter" value="${dbAdapter}"/>
161 614 bojilova
      <filter token="install-dir" value="${installdir}"/>
162 586 berkley
      <filter token="server" value="${server}"/>
163 977 tao
      <filter token="systemidserver" value="${systemidserver}"/>
164 586 berkley
      <filter token="replication-log" value="${replication-log}"/>
165 1579 tao
      <filter token="replicationerrorlog" value="${replicationerrorlog}"/>
166 348 jones
      <filter token="release" value="${release}"/>
167
      <filter token="servlet-path" value="${servlet-path}"/>
168 359 bojilova
      <filter token="html-path" value="${html-path}"/>
169 362 jones
      <filter token="user" value="${user}"/>
170
      <filter token="password" value="${password}"/>
171 409 berkley
      <filter token="image-path" value="${image-path}"/>
172 828 jones
      <filter token="style-path" value="${style-path}"/>
173 506 jones
      <filter token="web-base-url" value="${web-base-url}"/>
174 525 berkley
      <filter token="replication-path" value="${replication-path}"/>
175 832 jones
      <filter token="config-dir" value="${config-dir}"/>
176
      <filter token="default-style" value="${default-style}"/>
177 877 jones
      <filter token="eml-version" value="${eml-version}"/>
178 1570 tao
      <filter token="eml2namespace" value="${eml2namespace}"/>
179 1718 tao
      <filter token="stmmlnamespace" value="${stmmlnamespace}"/>
180 1009 tao
      <filter token="context" value="${context}"/>
181 1292 tao
      <filter token="forcereplicationwaitingtime" value="${forcereplicationwaitingtime}" />
182 1051 tao
      <filter token="debuglevel" value="${debuglevel}" />
183 1079 tao
      <filter token="datafilepath" value="${datafilepath}" />
184 1455 tao
      <filter token="inlinedatafilepath" value="${inlinedatafilepath}" />
185 1522 berkley
      <filter token="defaultcontenttype" value="${defaultcontenttype}" />
186 1538 berkley
      <filter token="debugprefix" value="${debugprefix}"/>
187 1487 tao
188 254 jones
      <property name="srcdir" value="./src" />
189 1116 tao
      <property name="junittestsdir" value="./test/edu/ucsb/nceas/metacattest" />
190
      <property name="junitnettestsdir" value="./test/edu/ucsb/nceas/metacatnettest" />
191 348 jones
      <property name="build.dir" value="./build"/>
192
      <property name="build.src" value="${build.dir}/src"/>
193
      <property name="build.dest" value="${build.dir}/classes"/>
194 516 jones
      <property name="build.docs" value="${build.dir}/docs"/>
195 348 jones
      <property name="build.samples" value="${build.dir}/samples"/>
196
      <property name="build.tests" value="${build.dir}/tests"/>
197 1116 tao
      <property name="build.metacattest" value="${build.tests}/metacattest"/>
198
      <property name="build.metacatnettest" value="${build.tests}/metacatnettest"/>
199 348 jones
      <property name="build.data" value="${build.dir}/data"/>
200 806 jones
      <property name="build.javadocs" value="${build.dir}/docs/api"/>
201 1437 berkley
      <property name="build.img" value="${installdir}"/>
202 348 jones
203 882 jones
      <property name="dist.dir" value="dist"/>
204 806 jones
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
205
      <property name="ver.src" value="${ver.dir}/src"/>
206
207 254 jones
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
208 113 jones
   </target>
209 1311 berkley
210 348 jones
   <target name="prepare" depends="init">
211
      <mkdir dir="${build.dir}"/>
212
      <mkdir dir="${build.src}"/>
213
      <mkdir dir="${build.dest}"/>
214 516 jones
      <mkdir dir="${build.javadocs}"/>
215 348 jones
216 822 jones
      <copy todir="${build.src}" filtering="yes">
217
        <fileset dir="${srcdir}">
218
          <include name="edu/**"/>
219
          <include name="com/**"/>
220 877 jones
          <include name="**/*.sql"/>
221 822 jones
          <exclude name="**/CVS*"/>
222
          <exclude name="**/.#*"/>
223 1702 tao
          <exclude name="edu/ucsb/nceas/metacat/harvesterClient/*.*"/>
224 822 jones
        </fileset>
225
      </copy>
226 348 jones
   </target>
227
228
   <target name="compile" depends="prepare">
229 1311 berkley
       <javac srcdir="${build.src}"
230
              destdir="${build.dest}"
231
              classpath="${cpath}"
232
              excludes="**/*.sql" />
233
       <copy file="lib/metacat.properties"
234
             tofile="${build.dest}/${package.home}/metacat.properties"
235 822 jones
             filtering="yes" />
236 1311 berkley
       <copy file="lib/srbProps.properties"
237 822 jones
             tofile="${build.dest}/${package.home}/srbProps.properties"/>
238 1311 berkley
   </target>
239 113 jones
240 204 jones
   <target name="jar" depends="compile">
241 353 jones
       <delete file="${build.dir}/${name}.jar" />
242 822 jones
       <copy todir="${build.dest}">
243
         <fileset dir="lib/srbrmi"/>
244
       </copy>
245 635 jones
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
246
            excludes="**/protocols/" />
247 1311 berkley
   </target>
248
249 635 jones
   <target name="protocol" depends="compile">
250
       <delete file="${build.dir}/protocol.jar" />
251
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
252
            includes="**/protocols/" />
253 1311 berkley
   </target>
254 113 jones
255 1612 tao
   <target name="getdtdschema" depends="prepare">
256
     <echo>Enter CVS password: </echo>
257
     <cvs cvsRoot="${cvsroot}"
258
          package="${eml-module}"
259
          tag="${eml-tag}"
260
          dest="${build.src}" />
261
     <mkdir dir="lib/dtd" />
262
     <copy todir="lib/dtd" filtering="yes">
263
       <fileset dir="${build.src}/${eml-module}">
264
         <include name="*.dtd"/>
265
       </fileset>
266
       <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
267
     </copy>
268
     <echo>Enter CVS password: </echo>
269
     <cvs cvsRoot="${cvsroot}"
270
          package="${eml-module}"
271
          tag="${eml2-tag}"
272
          dest="${build.src}" />
273
     <mkdir dir="lib/schema" />
274
     <copy todir="lib/schema" filtering="yes">
275
       <fileset dir="${build.src}/${eml-module}">
276
         <include name="*.xsd"/>
277
       </fileset>
278
     </copy>
279
     <copy todir="lib/style">
280
       <fileset dir="${build.src}/${eml-module}/style">
281
       <include name="*.xsl"/>
282
     </fileset>
283
     </copy>
284
   </target>
285
286 877 jones
   <target name="getdtd" depends="prepare">
287 1307 jones
     <echo>Enter CVS password: </echo>
288
     <cvs cvsRoot="${cvsroot}"
289
          package="${eml-module}"
290
          tag="${eml-tag}"
291
          dest="${build.src}" />
292
     <mkdir dir="lib/dtd" />
293
     <copy todir="lib/dtd" filtering="yes">
294
       <fileset dir="${build.src}/${eml-module}">
295
         <include name="*.dtd"/>
296
       </fileset>
297
       <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
298
     </copy>
299 1463 tao
   </target>
300 1522 berkley
301 1463 tao
   <target name="getschema" depends="prepare">
302
     <echo>Enter CVS password: </echo>
303
     <cvs cvsRoot="${cvsroot}"
304
          package="${eml-module}"
305
          tag="${eml2-tag}"
306
          dest="${build.src}" />
307
     <mkdir dir="lib/schema" />
308
     <copy todir="lib/schema" filtering="yes">
309
       <fileset dir="${build.src}/${eml-module}">
310
         <include name="*.xsd"/>
311
       </fileset>
312
     </copy>
313 1314 tao
     <copy todir="lib/style">
314 1307 jones
       <fileset dir="${build.src}/${eml-module}/style">
315 1311 berkley
       <include name="*.xsl"/>
316
     </fileset>
317 1307 jones
     </copy>
318 1522 berkley
   </target>
319 877 jones
320 1593 tao
   <target name="dtdschemasql" depends="prepare">
321 877 jones
     <echo/>
322
     <echo>Registering the DTDs with the new Metacat instance...</echo>
323
     <sql driver="${dbDriver}"
324 1744 tao
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
325 877 jones
          url="${jdbc-connect}"
326
          userid="${user}"
327
          password="${password}"
328 1593 tao
          src="${build.src}/loaddtdschema.sql" />
329 877 jones
   </target>
330 1716 berkley
331 1570 tao
   <target name="schemasql" depends="prepare">
332
     <echo/>
333
     <echo>Registering the DTDs with the new Metacat instance...</echo>
334
     <sql driver="${dbDriver}"
335 1744 tao
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
336 1570 tao
          url="${jdbc-connect}"
337
          userid="${user}"
338
          password="${password}"
339
          src="${build.src}/loadschema.sql" />
340
   </target>
341 1744 tao
342
   <target name="installCommon" depends="jar">
343 1079 tao
       <mkdir dir="${datafilepath}" />
344 1455 tao
       <mkdir dir="${inlinedatafilepath}" />
345 1079 tao
       <chmod dir="${datafilepath}" perm="ug+w" />
346 329 jones
       <mkdir dir="${installdir}/WEB-INF/lib" />
347 1311 berkley
       <copy file="${build.dir}/${name}.jar"
348 822 jones
             tofile="${installdir}/WEB-INF/lib/${name}.jar" />
349 1311 berkley
       <copy file="${xmlp}"
350 1376 tao
             tofile="${installdir}/WEB-INF/lib/xercesImpl.jar" />
351 1311 berkley
       <copy file="${xalan}"
352 923 jones
             tofile="${installdir}/WEB-INF/lib/xalan.jar" />
353 1311 berkley
       <copy file="${apis}"
354 923 jones
             tofile="${installdir}/WEB-INF/lib/xml-apis.jar" />
355 1311 berkley
       <copy file="${jdbc}"
356 1522 berkley
             tofile="${installdir}/WEB-INF/lib/jdbc.jar" />
357 1311 berkley
       <copy file="${cos}"
358 822 jones
             tofile="${installdir}/WEB-INF/lib/cos.jar" />
359 939 tao
       <copy file="${morpho}"
360 1470 tao
             tofile="${installdir}/WEB-INF/lib/morpho.jar" />
361
       <copy file="${emlparser}"
362 1522 berkley
             tofile="${installdir}/WEB-INF/lib/eml.jar" />
363 1470 tao
       <copy file="${configxml}"
364
             tofile="${installdir}/WEB-INF/lib/configxml.jar" />
365 1578 tao
       <copy file="${itislib}"
366
             tofile="${installdir}/WEB-INF/lib/itislib.jar" />
367 1729 tao
       <copy file="lib/web.xml.${tomcatversion}"
368 822 jones
             tofile="${installdir}/WEB-INF/web.xml" />
369
       <copy todir="${build.img}" filtering="no">
370
         <fileset dir="lib">
371
           <include name="**/*.jpg"/>
372
           <include name="**/*.png"/>
373
           <include name="**/*.gif"/>
374
         </fileset>
375
       </copy>
376
       <copy todir="${installdir}" filtering="yes">
377
         <fileset dir="lib">
378
           <exclude name="*.jar"/>
379
           <exclude name="*.properties"/>
380
           <exclude name="web.xml"/>
381
           <exclude name="**/srbrmi*"/>
382 1437 berkley
           <exclude name="**/*.jpg"/>
383
           <exclude name="**/*.png"/>
384
           <exclude name="**/*.gif"/>
385 822 jones
         </fileset>
386
       </copy>
387 877 jones
       <echo>
388
             ***********************************************************
389
              Remember to register the default DTDs by running the
390
              "${build.src}/loaddtd.sql script". This is most easily
391
              done by using the "ant dtdsql" which will run it for you.
392
             ***********************************************************
393
       </echo>
394 1311 berkley
   </target>
395 1744 tao
396
   <target name="installMSSQL" if="MSSQL" depends="installCommon">
397
      <echo> Install MSSQL</echo>
398
      <copy file="${jdbc-add1}"
399
             tofile="${installdir}/WEB-INF/lib/msutil.jar" />
400
       <copy file="${jdbc-add2}"
401
             tofile="${installdir}/WEB-INF/lib/mssqlserver.jar" />
402
   </target>
403
404
    <target name="installother" if="other" depends="installCommon">
405
        <echo> Install Other Database</echo>
406
   </target>
407
408
   <target name="install" depends="installMSSQL, installother">
409
410
   </target>
411
412
413 1311 berkley
414 971 tao
   <target name="test" depends="install">
415
      <!-- copy and compile the tests into a jar file -->
416 1116 tao
      <mkdir dir="${build.metacattest}"/>
417 1049 tao
      <javac srcdir="${junittestsdir}"
418 1116 tao
             destdir="${build.metacattest}"
419 1049 tao
             classpath="${cpath}:${build.dir}/${name}.jar"
420 1612 tao
             debug="on"
421 1311 berkley
       includes="**/*.java" />
422 204 jones
423 1311 berkley
      <jar jarfile="${build.dir}/${name}-junittests.jar"
424
        basedir="${build.metacattest}"
425
                includes="**/*.class" />
426 971 tao
427
      <!-- use the ant "junit" task to run JUnit tests. -->
428
      <junit printsummary="yes" haltonfailure="no" fork="no"
429
             haltonerror="no">
430
        <classpath>
431 1049 tao
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-junittests.jar" />
432 971 tao
        </classpath>
433
434
        <formatter type="plain" />
435
436
        <batchtest fork="yes" todir="${build.dir}">
437 1116 tao
          <fileset dir="${build.metacattest}">
438
            <include name="**/*.class" />
439 971 tao
          </fileset>
440
        </batchtest>
441
     </junit>
442
   </target>
443 1103 tao
444 1500 tao
    <target name="runonetest" depends="install">
445
      <!-- copy and compile the tests into a jar file -->
446
      <!--<property name="testtorun" value="SubTreeTest"/> -->
447
      <echo>testtorun: ${testtorun}</echo>
448
      <mkdir dir="${build.metacattest}"/>
449
      <javac srcdir="${junittestsdir}"
450
             destdir="${build.metacattest}"
451
             classpath="${cpath}:${build.dir}/${name}.jar"
452
       includes="**/*.java" />
453
454
      <jar jarfile="${build.dir}/${name}-junittests.jar"
455
        basedir="${build.metacattest}"
456
                includes="**/*.class" />
457
458
      <!-- use the ant "junit" task to run JUnit tests. -->
459
      <junit printsummary="yes" haltonfailure="no" fork="no"
460
             haltonerror="no">
461
        <classpath>
462
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-junittests.jar" />
463
        </classpath>
464
465
        <formatter type="plain" />
466
467
        <batchtest fork="yes" todir="${build.dir}">
468
          <fileset dir="${build.metacattest}">
469 1522 berkley
470 1500 tao
            <include name="**/${testtorun}.class" />
471
          </fileset>
472
        </batchtest>
473
     </junit>
474
   </target>
475
476 1103 tao
  <target name="gethttpclient" depends="prepare">
477 1311 berkley
  <!--mkdir dir="${morphosourcedir}" -->
478 1487 tao
        <cvs cvsRoot="${cvsroot}"
479 1103 tao
             package="morpho"
480
             dest="." />
481 1107 tao
        <ant dir="${morphosourcedir}" inheritAll="false"  target="jar" />
482 1103 tao
   </target>
483
484
   <!-- run this target, we need to check out a another morpho souce dir was checked out. -->
485
   <target name="nettest" depends="install">
486
      <echo>***********************************
487 1311 berkley
      Please run ant gethttpclient first!
488
      ***********************************
489 1103 tao
      </echo>
490
      <!-- copy and compile the tests into a jar file -->
491 1116 tao
      <mkdir dir="${build.metacatnettest}"/>
492 1103 tao
      <javac srcdir="${junitnettestsdir}"
493 1116 tao
             destdir="${build.metacatnettest}"
494 1103 tao
             classpath="${cpath}:${build.dir}/${name}.jar:${httpclient}"
495
             includes="**/*.java" />
496
497
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
498 1116 tao
                    basedir="${build.metacatnettest}"
499 1103 tao
                    includes="**/*.class" />
500
501
      <!-- use the ant "junit" task to run JUnit tests. -->
502 1107 tao
      <junit printsummary="yes" haltonfailure="no" fork="yes"
503 1103 tao
             haltonerror="no">
504 1107 tao
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
505 1103 tao
        <classpath>
506
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${httpclient}:${build.dir}/${name}-junitnettests.jar:${itis}" />
507
        </classpath>
508
509
        <formatter type="plain" />
510
511
        <batchtest fork="yes" todir="${build.dir}">
512 1116 tao
          <fileset dir="${build.metacatnettest}">
513
            <include name="**/*.class" />
514 1103 tao
          </fileset>
515
        </batchtest>
516
     </junit>
517 1311 berkley
   </target>
518 1103 tao
519 1522 berkley
   <target name="servletclean" depends="clean">
520
     <delete dir="${installdir}" />
521
   </target>
522
523
524 113 jones
   <target name="clean" depends="init">
525 822 jones
       <delete dir="${build.dir}" />
526 113 jones
   </target>
527
528 516 jones
   <target name="jdoc" depends="prepare">
529 822 jones
       <javadoc packagenames="edu.ucsb.nceas.*"
530 516 jones
           sourcepath="${build.src}"
531
           destdir="${build.javadocs}"
532 113 jones
           author="true"
533
           version="true"
534
           use="true"
535 348 jones
           windowtitle="${Name} API"
536
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
537 113 jones
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;"
538
       />
539
   </target>
540
541 1724 tao
   <target name="dist" depends="jar,protocol,jdoc,getdtd,getschema">
542 806 jones
      <mkdir dir="${dist.dir}"/>
543
      <delete dir="${ver.dir}" />
544
      <mkdir dir="${ver.dir}"/>
545
      <copy todir="${ver.dir}">
546 1311 berkley
        <fileset dir="."
547 882 jones
            excludes="**/CVS* **/.#* **/src* **/test* **/build* **/docs* ${dist.dir}"/>
548 806 jones
      </copy>
549
      <copy todir="${ver.dir}" file="build.xml"/>
550
      <copy todir="${ver.dir}/lib" file="${build.dir}/metacat.jar"/>
551
      <copy todir="${ver.dir}/lib" file="${build.dir}/protocol.jar"/>
552 882 jones
553
      <copy todir="${ver.dir}/docs" filtering="yes">
554
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
555
      </copy>
556
      <copy todir="${ver.dir}/docs" filtering="no">
557
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
558
      </copy>
559 806 jones
      <copy todir="${ver.dir}/docs/dev">
560
        <fileset dir="${build.dir}/docs"/>
561
      </copy>
562 917 berkley
      <copy todir="${ver.dir}/src">
563
        <fileset dir="${build.dir}/src"/>
564
      </copy>
565
566 992 berkley
      <delete dir="./${ver.dir}/${build.dir}"/>
567
      <delete dir="./${ver.dir}/dist"/>
568 882 jones
      <delete file="./${name}-${release}.zip"/>
569 1312 tao
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
570 882 jones
      <delete file="./${name}-${release}.tar.gz" />
571 1312 tao
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
572 1311 berkley
      <gzip zipfile="./${name}-${release}.tar.gz"
573 882 jones
                src="./${name}-${release}.tar"/>
574
      <delete file="./${name}-${release}.tar" />
575 1311 berkley
  </target>
576 806 jones
577
  <target name="distsrc" depends="dist">
578
      <mkdir dir="${ver.src}"/>
579
      <copy todir="${ver.src}">
580
        <fileset dir="./src"/>
581
      </copy>
582
583 882 jones
      <delete file="./${name}-src-${release}.zip"/>
584
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
585
      <delete file="./${name}-src-${release}.tar.gz" />
586
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
587 1311 berkley
      <gzip zipfile="./${name}-src-${release}.tar.gz"
588 882 jones
                src="./${name}-src-${release}.tar"/>
589
      <delete file="./${name}-src-${release}.tar" />
590 807 jones
      <delete dir="${dist.dir}"/>
591 1311 berkley
  </target>
592 806 jones
593 1702 tao
   <target name="stylesheettest">
594
     <xslt in="${input}" out="eml.html" style="lib/style/eml2/eml-2.0.0.xsl">
595
      <param name="displaymodule" expression="${displaymodule}"/>
596
      <param name="docid" expression="${input}"/>
597
      <param name="entitytype" expression="${entitytype}"/>
598
      <param name="entityindex" expression="${entityindex}"/>
599
      <outputproperty name="method" value="html"/>
600
      <outputproperty name="standalone" value="yes"/>
601
      <outputproperty name="encoding" value="iso8859_1"/>
602
      <outputproperty name="indent" value="yes"/>
603
    </xslt>
604
  </target>
605 1716 berkley
606 113 jones
</project>