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 1807 tao
               value="jdbc:oracle:thin:@pine.nceas.ucsb.edu:1521:knb"/>
37 925 berkley
     <property name="dbDriver" value="oracle.jdbc.driver.OracleDriver"/>
38
     <property name="dbAdapter" value="edu.ucsb.nceas.dbadapter.OracleAdapter"/>
39 1801 tao
     <property name="oracle_home" value="/usr/local/oracle/8.1.6" />
40 925 berkley
     <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 1801 tao
   <target name="config" depends="oracle">
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 1807 tao
      <property name="user" value="knb"/>
81 1801 tao
82
      <property name="password" value="tdataint"/>
83
      <property name="mcuser" value="uid=tao,o=NCEAS,dc=ecoinformatics,dc=org"/>
84 1783 jones
      <property name="mcpassword" value=""/>
85 1801 tao
      <property name="mcanotheruser" value="uid=jtao,o=LTER,dc=ecoinformatics,dc=org"/>
86
      <property name="mcanotherpassword" value=""/>
87
88 1729 tao
      <!-- Tomcat version, if you use tomcat 3, please fill it "tomcat3". If you using tomcat4, please fill it "tomcat4"-->
89 1771 tao
      <property name="tomcatversion" value="tomcat4"/>
90 1716 berkley
91 1744 tao
      <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 1807 tao
      <property name="debuglevel" value="55" />
96 1716 berkley
97 1292 tao
      <property name="forcereplicationwaitingtime" value="30000"/>
98 1523 tao
      <property name="cvsroot"
99 1722 tao
                value=":ext:tao@cvs.ecoinformatics.org:/cvs" />
100 1311 berkley
      <property name="web-base-url"
101 931 jones
                value="http://knb.ecoinformatics.org"/>
102
      <property name="default-style" value="knb" />
103 1522 berkley
      <property name="morphosourcedir" value="../morpho" />
104 1570 tao
      <property name="defaultcontenttype" value="application/octet-stream" />
105 1780 jones
      <property name="utilitiesdir" value="../utilities" />
106 1811 tao
      <property name="java2wsdl.tool" value="org.apache.axis.wsdl.Java2WSDL" />
107
      <property name="wsdldecorator.tool" value="org.globus.ogsa.tools.wsdl.DecorateWSDL" />
108
      <property name="wsdl.tool" value="org.globus.ogsa.tools.wsdl.GSDL2Java"/>
109
      <property environment="env"/>
110
      <property name="binding.file" value="${env.GLOBUS_LOCATION}/schema/ogsi/ogsi_bindings.wsdl"/>
111
112 931 jones
      <!-- Make sure these paths match the location of the jar files
113
           on your system, the defaults should usually work -->
114 1311 berkley
      <property name="jsdk"
115 1742 tao
                value="${tomcat}/common/lib/servlet.jar" />
116 1311 berkley
      <property name="xmlp"
117 1376 tao
                value="lib/xercesImpl.jar" />
118 1311 berkley
      <property name="srb"
119 931 jones
                value="lib/srbrmi" />
120 1311 berkley
      <property name="cos"
121 931 jones
                value="lib/cos.jar" />
122 939 tao
      <property name="morpho"
123
                value="lib/morpho.jar" />
124 931 jones
      <property name="xalan"
125
                value="lib/xalan/xalan.jar" />
126
      <property name="apis"
127
                value="lib/xalan/xml-apis.jar" />
128 1103 tao
      <property name="httpclient"
129 1780 jones
                value="lib/httpclient.jar" />
130 1470 tao
      <property name="emlparser"
131
                value="lib/eml.jar" />
132
      <property name="configxml"
133
                value="lib/configxml.jar" />
134 1578 tao
      <property name="itislib"
135
                value="lib/itislib.jar" />
136 1487 tao
      <property name="emlparser"
137
                value="lib/eml.jar" />
138 1780 jones
      <property name="util"
139
                value="lib/utilities.jar" />
140 1103 tao
  </target>
141
142 931 jones
   <target name="init" depends="config">
143
      <!-- It is less likely you'll need to make any changes from here down,
144
           but customization is possible -->
145
      <property name="installdir" value="${webapps}/${context}" />
146 348 jones
      <property name="name" value="metacat"/>
147
      <property name="Name" value="MetaCat"/>
148 1538 berkley
      <property name="debugprefix" value="${Name}:"/>
149 1339 tao
      <property name="release" value="1.2.1"/>
150 1311 berkley
      <property name="replication-path"
151 931 jones
                value="/${context}/servlet/replication"/>
152
      <property name="servlet-path" value="/${context}/servlet/metacat"/>
153
      <property name="html-path" value="/${context}"/>
154 1437 berkley
      <property name="image-path" value="/${context}" />
155 931 jones
      <property name="style-path" value="/${context}/style"/>
156 923 jones
      <property name="replication-log" value="/tmp/metacatreplication.log"/>
157 1579 tao
      <property name="replicationerrorlog" value="/tmp/metacatreplication.err"/>
158 832 jones
      <property name="config-dir" value="${installdir}" />
159 924 jones
      <property name="eml-module" value="eml" />
160 877 jones
      <property name="eml-version" value="2.0.0beta6" />
161 1227 tao
      <property name="eml-tag" value="RELEASE_EML_2_0_0_BETA_6_REV1" />
162 1722 tao
      <property name="eml2-tag" value="STMML_SCHEMA_UPDATE" />
163 1570 tao
      <property name="eml2namespace" value="eml://ecoinformatics.org/eml-2.0.0" />
164 1718 tao
      <property name="stmmlnamespace" value="http://www.xml-cml.org/schema/stmml" />
165 348 jones
166 1311 berkley
      <property name="cpath"
167 1780 jones
                value="${xmlp}:${xalan}:${apis}:${jdbc}:${jsdk}:${srb}:${cos}:${morpho}:${emlparser}:${jdbc-add1}:${jdbc-add2}:${util}:${httpclient}"/>
168 882 jones
169
      <filter token="docrooturl" value="./" />
170 588 berkley
      <filter token="jdbc-connect" value="${jdbc-connect}"/>
171 882 jones
      <filter token="dbDriver" value="${dbDriver}"/>
172 915 berkley
      <filter token="dbAdapter" value="${dbAdapter}"/>
173 614 bojilova
      <filter token="install-dir" value="${installdir}"/>
174 586 berkley
      <filter token="server" value="${server}"/>
175 977 tao
      <filter token="systemidserver" value="${systemidserver}"/>
176 586 berkley
      <filter token="replication-log" value="${replication-log}"/>
177 1579 tao
      <filter token="replicationerrorlog" value="${replicationerrorlog}"/>
178 348 jones
      <filter token="release" value="${release}"/>
179
      <filter token="servlet-path" value="${servlet-path}"/>
180 359 bojilova
      <filter token="html-path" value="${html-path}"/>
181 362 jones
      <filter token="user" value="${user}"/>
182
      <filter token="password" value="${password}"/>
183 1783 jones
      <filter token="mcuser" value="${mcuser}"/>
184
      <filter token="mcpassword" value="${mcpassword}"/>
185 1801 tao
      <filter token="mcanotheruser" value="${mcanotheruser}"/>
186
      <filter token="mcanotherpassword" value="${mcanotherpassword}"/>
187 409 berkley
      <filter token="image-path" value="${image-path}"/>
188 828 jones
      <filter token="style-path" value="${style-path}"/>
189 506 jones
      <filter token="web-base-url" value="${web-base-url}"/>
190 525 berkley
      <filter token="replication-path" value="${replication-path}"/>
191 832 jones
      <filter token="config-dir" value="${config-dir}"/>
192
      <filter token="default-style" value="${default-style}"/>
193 877 jones
      <filter token="eml-version" value="${eml-version}"/>
194 1570 tao
      <filter token="eml2namespace" value="${eml2namespace}"/>
195 1718 tao
      <filter token="stmmlnamespace" value="${stmmlnamespace}"/>
196 1009 tao
      <filter token="context" value="${context}"/>
197 1292 tao
      <filter token="forcereplicationwaitingtime" value="${forcereplicationwaitingtime}" />
198 1051 tao
      <filter token="debuglevel" value="${debuglevel}" />
199 1079 tao
      <filter token="datafilepath" value="${datafilepath}" />
200 1455 tao
      <filter token="inlinedatafilepath" value="${inlinedatafilepath}" />
201 1522 berkley
      <filter token="defaultcontenttype" value="${defaultcontenttype}" />
202 1538 berkley
      <filter token="debugprefix" value="${debugprefix}"/>
203 1487 tao
204 254 jones
      <property name="srcdir" value="./src" />
205 1783 jones
      <property name="testdir" value="./test" />
206
      <property name="testtorun" value="MetacatClientTest" />
207 1116 tao
      <property name="junittestsdir" value="./test/edu/ucsb/nceas/metacattest" />
208
      <property name="junitnettestsdir" value="./test/edu/ucsb/nceas/metacatnettest" />
209 348 jones
      <property name="build.dir" value="./build"/>
210
      <property name="build.src" value="${build.dir}/src"/>
211
      <property name="build.dest" value="${build.dir}/classes"/>
212 516 jones
      <property name="build.docs" value="${build.dir}/docs"/>
213 348 jones
      <property name="build.samples" value="${build.dir}/samples"/>
214
      <property name="build.tests" value="${build.dir}/tests"/>
215 1778 tao
      <property name="build.tmp" value="${build.dir}/tmp"/>
216 1116 tao
      <property name="build.metacattest" value="${build.tests}/metacattest"/>
217
      <property name="build.metacatnettest" value="${build.tests}/metacatnettest"/>
218 348 jones
      <property name="build.data" value="${build.dir}/data"/>
219 806 jones
      <property name="build.javadocs" value="${build.dir}/docs/api"/>
220 1437 berkley
      <property name="build.img" value="${installdir}"/>
221 348 jones
222 882 jones
      <property name="dist.dir" value="dist"/>
223 806 jones
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
224
      <property name="ver.src" value="${ver.dir}/src"/>
225
226 254 jones
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
227 1811 tao
      <path id="webservicepath">
228
        <pathelement location="."/>
229
        <pathelement location="${env.JAVA_HOME}/../lib/tools.jar"/>
230
        <pathelement location="${build.dest}"/>
231
        <fileset dir="${env.GLOBUS_LOCATION}/lib">
232
           <include name="*.jar"/>
233
        </fileset>
234
      </path>
235 113 jones
   </target>
236 1311 berkley
237 348 jones
   <target name="prepare" depends="init">
238
      <mkdir dir="${build.dir}"/>
239
      <mkdir dir="${build.src}"/>
240
      <mkdir dir="${build.dest}"/>
241 516 jones
      <mkdir dir="${build.javadocs}"/>
242 1778 tao
      <mkdir dir="${build.tmp}"/>
243 348 jones
244 822 jones
      <copy todir="${build.src}" filtering="yes">
245
        <fileset dir="${srcdir}">
246
          <include name="edu/**"/>
247
          <include name="com/**"/>
248 877 jones
          <include name="**/*.sql"/>
249 822 jones
          <exclude name="**/CVS*"/>
250
          <exclude name="**/.#*"/>
251 1702 tao
          <exclude name="edu/ucsb/nceas/metacat/harvesterClient/*.*"/>
252 822 jones
        </fileset>
253
      </copy>
254 348 jones
   </target>
255
256
   <target name="compile" depends="prepare">
257 1311 berkley
       <javac srcdir="${build.src}"
258
              destdir="${build.dest}"
259
              classpath="${cpath}"
260
              excludes="**/*.sql" />
261
       <copy file="lib/metacat.properties"
262
             tofile="${build.dest}/${package.home}/metacat.properties"
263 822 jones
             filtering="yes" />
264 1311 berkley
       <copy file="lib/srbProps.properties"
265 822 jones
             tofile="${build.dest}/${package.home}/srbProps.properties"/>
266 1311 berkley
   </target>
267 113 jones
268 204 jones
   <target name="jar" depends="compile">
269 353 jones
       <delete file="${build.dir}/${name}.jar" />
270 822 jones
       <copy todir="${build.dest}">
271
         <fileset dir="lib/srbrmi"/>
272
       </copy>
273 635 jones
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
274
            excludes="**/protocols/" />
275 1311 berkley
   </target>
276
277 635 jones
   <target name="protocol" depends="compile">
278
       <delete file="${build.dir}/protocol.jar" />
279
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
280
            includes="**/protocols/" />
281 1311 berkley
   </target>
282 113 jones
283 1780 jones
   <target name="utilities" depends="config">
284 1796 jones
     <ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
285
     <ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
286 1780 jones
     <copy file="${utilitiesdir}/lib/httpclient.jar" todir="lib" />
287
     <copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
288
   </target>
289
290
   <target name="client" depends="utilities, prepare">
291
       <javac srcdir="${build.src}"
292
              destdir="${build.dest}"
293
              classpath="${cpath}"
294
              includes="edu/ucsb/nceas/metacat/client/*" />
295
   </target>
296
297
   <target name="clientjar" depends="client">
298
       <delete file="${build.dir}/${name}-client.jar" />
299
       <jar jarfile="${build.dir}/${name}-client.jar" basedir="${build.dest}"
300
            includes="**/metacat/client/" />
301
   </target>
302
303 1612 tao
   <target name="getdtdschema" depends="prepare">
304
     <echo>Enter CVS password: </echo>
305
     <cvs cvsRoot="${cvsroot}"
306
          package="${eml-module}"
307
          tag="${eml-tag}"
308 1778 tao
          dest="${build.tmp}" />
309 1612 tao
     <mkdir dir="lib/dtd" />
310
     <copy todir="lib/dtd" filtering="yes">
311 1778 tao
       <fileset dir="${build.tmp}/${eml-module}">
312 1612 tao
         <include name="*.dtd"/>
313
       </fileset>
314
       <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
315
     </copy>
316
     <echo>Enter CVS password: </echo>
317
     <cvs cvsRoot="${cvsroot}"
318
          package="${eml-module}"
319
          tag="${eml2-tag}"
320 1778 tao
          dest="${build.tmp}" />
321 1612 tao
     <mkdir dir="lib/schema" />
322
     <copy todir="lib/schema" filtering="yes">
323 1778 tao
       <fileset dir="${build.tmp}/${eml-module}">
324 1612 tao
         <include name="*.xsd"/>
325
       </fileset>
326
     </copy>
327
     <copy todir="lib/style">
328 1778 tao
       <fileset dir="${build.tmp}/${eml-module}/style">
329 1612 tao
       <include name="*.xsl"/>
330
     </fileset>
331
     </copy>
332
   </target>
333
334 877 jones
   <target name="getdtd" depends="prepare">
335 1307 jones
     <echo>Enter CVS password: </echo>
336
     <cvs cvsRoot="${cvsroot}"
337
          package="${eml-module}"
338
          tag="${eml-tag}"
339 1778 tao
          dest="${build.tmp}" />
340 1307 jones
     <mkdir dir="lib/dtd" />
341
     <copy todir="lib/dtd" filtering="yes">
342 1778 tao
       <fileset dir="${build.tmp}/${eml-module}">
343 1307 jones
         <include name="*.dtd"/>
344
       </fileset>
345
       <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
346
     </copy>
347 1463 tao
   </target>
348 1522 berkley
349 1463 tao
   <target name="getschema" depends="prepare">
350
     <echo>Enter CVS password: </echo>
351
     <cvs cvsRoot="${cvsroot}"
352
          package="${eml-module}"
353
          tag="${eml2-tag}"
354 1778 tao
          dest="${build.tmp}" />
355 1463 tao
     <mkdir dir="lib/schema" />
356
     <copy todir="lib/schema" filtering="yes">
357 1778 tao
       <fileset dir="${build.tmp}/${eml-module}">
358 1463 tao
         <include name="*.xsd"/>
359
       </fileset>
360
     </copy>
361 1314 tao
     <copy todir="lib/style">
362 1778 tao
       <fileset dir="${build.tmp}/${eml-module}/style">
363 1311 berkley
       <include name="*.xsl"/>
364
     </fileset>
365 1307 jones
     </copy>
366 1522 berkley
   </target>
367 877 jones
368 1593 tao
   <target name="dtdschemasql" depends="prepare">
369 877 jones
     <echo/>
370
     <echo>Registering the DTDs with the new Metacat instance...</echo>
371
     <sql driver="${dbDriver}"
372 1744 tao
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
373 877 jones
          url="${jdbc-connect}"
374
          userid="${user}"
375
          password="${password}"
376 1593 tao
          src="${build.src}/loaddtdschema.sql" />
377 877 jones
   </target>
378 1716 berkley
379 1570 tao
   <target name="schemasql" depends="prepare">
380
     <echo/>
381
     <echo>Registering the DTDs with the new Metacat instance...</echo>
382
     <sql driver="${dbDriver}"
383 1744 tao
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
384 1570 tao
          url="${jdbc-connect}"
385
          userid="${user}"
386
          password="${password}"
387
          src="${build.src}/loadschema.sql" />
388
   </target>
389 1801 tao
390 1744 tao
   <target name="installCommon" depends="jar">
391 1079 tao
       <mkdir dir="${datafilepath}" />
392 1455 tao
       <mkdir dir="${inlinedatafilepath}" />
393 1079 tao
       <chmod dir="${datafilepath}" perm="ug+w" />
394 329 jones
       <mkdir dir="${installdir}/WEB-INF/lib" />
395 1311 berkley
       <copy file="${build.dir}/${name}.jar"
396 822 jones
             tofile="${installdir}/WEB-INF/lib/${name}.jar" />
397 1311 berkley
       <copy file="${xmlp}"
398 1376 tao
             tofile="${installdir}/WEB-INF/lib/xercesImpl.jar" />
399 1311 berkley
       <copy file="${xalan}"
400 923 jones
             tofile="${installdir}/WEB-INF/lib/xalan.jar" />
401 1311 berkley
       <copy file="${apis}"
402 923 jones
             tofile="${installdir}/WEB-INF/lib/xml-apis.jar" />
403 1311 berkley
       <copy file="${jdbc}"
404 1522 berkley
             tofile="${installdir}/WEB-INF/lib/jdbc.jar" />
405 1311 berkley
       <copy file="${cos}"
406 822 jones
             tofile="${installdir}/WEB-INF/lib/cos.jar" />
407 939 tao
       <copy file="${morpho}"
408 1470 tao
             tofile="${installdir}/WEB-INF/lib/morpho.jar" />
409
       <copy file="${emlparser}"
410 1522 berkley
             tofile="${installdir}/WEB-INF/lib/eml.jar" />
411 1470 tao
       <copy file="${configxml}"
412
             tofile="${installdir}/WEB-INF/lib/configxml.jar" />
413 1578 tao
       <copy file="${itislib}"
414
             tofile="${installdir}/WEB-INF/lib/itislib.jar" />
415 1729 tao
       <copy file="lib/web.xml.${tomcatversion}"
416 822 jones
             tofile="${installdir}/WEB-INF/web.xml" />
417
       <copy todir="${build.img}" filtering="no">
418
         <fileset dir="lib">
419
           <include name="**/*.jpg"/>
420
           <include name="**/*.png"/>
421
           <include name="**/*.gif"/>
422
         </fileset>
423
       </copy>
424
       <copy todir="${installdir}" filtering="yes">
425
         <fileset dir="lib">
426
           <exclude name="*.jar"/>
427
           <exclude name="*.properties"/>
428
           <exclude name="web.xml"/>
429
           <exclude name="**/srbrmi*"/>
430 1437 berkley
           <exclude name="**/*.jpg"/>
431
           <exclude name="**/*.png"/>
432
           <exclude name="**/*.gif"/>
433 822 jones
         </fileset>
434
       </copy>
435 877 jones
       <echo>
436
             ***********************************************************
437
              Remember to register the default DTDs by running the
438
              "${build.src}/loaddtd.sql script". This is most easily
439
              done by using the "ant dtdsql" which will run it for you.
440
             ***********************************************************
441
       </echo>
442 1311 berkley
   </target>
443 1744 tao
444
   <target name="installMSSQL" if="MSSQL" depends="installCommon">
445
      <echo> Install MSSQL</echo>
446
      <copy file="${jdbc-add1}"
447
             tofile="${installdir}/WEB-INF/lib/msutil.jar" />
448
       <copy file="${jdbc-add2}"
449
             tofile="${installdir}/WEB-INF/lib/mssqlserver.jar" />
450
   </target>
451
452
    <target name="installother" if="other" depends="installCommon">
453
        <echo> Install Other Database</echo>
454
   </target>
455
456
   <target name="install" depends="installMSSQL, installother">
457
458
   </target>
459
460 1783 jones
   <target name="testprep" depends="install">
461
      <mkdir dir="${build.tests}"/>
462
      <copy todir="${build.tests}" filtering="yes">
463
        <fileset dir="${testdir}">
464
          <include name="edu/**"/>
465
        </fileset>
466
      </copy>
467
   </target>
468 1311 berkley
469 1783 jones
   <target name="test" depends="testprep">
470 971 tao
      <!-- copy and compile the tests into a jar file -->
471 1783 jones
      <javac srcdir="${build.tests}"
472
             destdir="${build.tests}"
473 1049 tao
             classpath="${cpath}:${build.dir}/${name}.jar"
474 1612 tao
             debug="on"
475 1311 berkley
       includes="**/*.java" />
476 204 jones
477 1311 berkley
      <jar jarfile="${build.dir}/${name}-junittests.jar"
478 1783 jones
        basedir="${build.tests}"
479 1311 berkley
                includes="**/*.class" />
480 971 tao
481
      <!-- use the ant "junit" task to run JUnit tests. -->
482 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
483 971 tao
             haltonerror="no">
484 1783 jones
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
485 971 tao
        <classpath>
486 1783 jones
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/${name}-junittests.jar" />
487 971 tao
        </classpath>
488
489
        <formatter type="plain" />
490
491
        <batchtest fork="yes" todir="${build.dir}">
492 1783 jones
          <fileset dir="${build.tests}">
493 1116 tao
            <include name="**/*.class" />
494 971 tao
          </fileset>
495
        </batchtest>
496
     </junit>
497
   </target>
498 1103 tao
499 1783 jones
    <target name="runonetest" depends="testprep">
500 1500 tao
      <!-- copy and compile the tests into a jar file -->
501
      <!--<property name="testtorun" value="SubTreeTest"/> -->
502
      <echo>testtorun: ${testtorun}</echo>
503 1783 jones
      <javac srcdir="${build.tests}"
504
             destdir="${build.tests}"
505 1500 tao
             classpath="${cpath}:${build.dir}/${name}.jar"
506 1791 jones
             debug="on"
507 1500 tao
       includes="**/*.java" />
508
509
      <jar jarfile="${build.dir}/${name}-junittests.jar"
510 1783 jones
        basedir="${build.tests}"
511 1500 tao
                includes="**/*.class" />
512
513
      <!-- use the ant "junit" task to run JUnit tests. -->
514 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
515 1500 tao
             haltonerror="no">
516 1783 jones
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
517 1500 tao
        <classpath>
518 1783 jones
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/${name}-junittests.jar" />
519 1500 tao
        </classpath>
520
521
        <formatter type="plain" />
522
523
        <batchtest fork="yes" todir="${build.dir}">
524 1783 jones
          <fileset dir="${build.tests}">
525 1500 tao
            <include name="**/${testtorun}.class" />
526
          </fileset>
527
        </batchtest>
528
     </junit>
529
   </target>
530
531 1103 tao
  <target name="gethttpclient" depends="prepare">
532 1311 berkley
  <!--mkdir dir="${morphosourcedir}" -->
533 1487 tao
        <cvs cvsRoot="${cvsroot}"
534 1103 tao
             package="morpho"
535
             dest="." />
536 1107 tao
        <ant dir="${morphosourcedir}" inheritAll="false"  target="jar" />
537 1103 tao
   </target>
538
539
   <!-- run this target, we need to check out a another morpho souce dir was checked out. -->
540
   <target name="nettest" depends="install">
541
      <echo>***********************************
542 1311 berkley
      Please run ant gethttpclient first!
543
      ***********************************
544 1103 tao
      </echo>
545
      <!-- copy and compile the tests into a jar file -->
546 1116 tao
      <mkdir dir="${build.metacatnettest}"/>
547 1103 tao
      <javac srcdir="${junitnettestsdir}"
548 1116 tao
             destdir="${build.metacatnettest}"
549 1103 tao
             classpath="${cpath}:${build.dir}/${name}.jar:${httpclient}"
550
             includes="**/*.java" />
551
552
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
553 1116 tao
                    basedir="${build.metacatnettest}"
554 1103 tao
                    includes="**/*.class" />
555
556
      <!-- use the ant "junit" task to run JUnit tests. -->
557 1107 tao
      <junit printsummary="yes" haltonfailure="no" fork="yes"
558 1103 tao
             haltonerror="no">
559 1107 tao
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
560 1103 tao
        <classpath>
561 1807 tao
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${httpclient}:${build.dir}/${name}-junitnettests.jar:${itislib}" />
562 1103 tao
        </classpath>
563
564
        <formatter type="plain" />
565
566
        <batchtest fork="yes" todir="${build.dir}">
567 1116 tao
          <fileset dir="${build.metacatnettest}">
568
            <include name="**/*.class" />
569 1103 tao
          </fileset>
570
        </batchtest>
571
     </junit>
572 1311 berkley
   </target>
573 1103 tao
574 1522 berkley
   <target name="servletclean" depends="clean">
575
     <delete dir="${installdir}" />
576
   </target>
577
578
579 113 jones
   <target name="clean" depends="init">
580 822 jones
       <delete dir="${build.dir}" />
581 113 jones
   </target>
582
583 516 jones
   <target name="jdoc" depends="prepare">
584 822 jones
       <javadoc packagenames="edu.ucsb.nceas.*"
585 516 jones
           sourcepath="${build.src}"
586
           destdir="${build.javadocs}"
587 113 jones
           author="true"
588
           version="true"
589
           use="true"
590 348 jones
           windowtitle="${Name} API"
591
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
592 113 jones
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;"
593
       />
594
   </target>
595
596 1724 tao
   <target name="dist" depends="jar,protocol,jdoc,getdtd,getschema">
597 806 jones
      <mkdir dir="${dist.dir}"/>
598
      <delete dir="${ver.dir}" />
599
      <mkdir dir="${ver.dir}"/>
600
      <copy todir="${ver.dir}">
601 1311 berkley
        <fileset dir="."
602 882 jones
            excludes="**/CVS* **/.#* **/src* **/test* **/build* **/docs* ${dist.dir}"/>
603 806 jones
      </copy>
604
      <copy todir="${ver.dir}" file="build.xml"/>
605
      <copy todir="${ver.dir}/lib" file="${build.dir}/metacat.jar"/>
606
      <copy todir="${ver.dir}/lib" file="${build.dir}/protocol.jar"/>
607 882 jones
608
      <copy todir="${ver.dir}/docs" filtering="yes">
609
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
610
      </copy>
611
      <copy todir="${ver.dir}/docs" filtering="no">
612
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
613
      </copy>
614 806 jones
      <copy todir="${ver.dir}/docs/dev">
615
        <fileset dir="${build.dir}/docs"/>
616
      </copy>
617 917 berkley
      <copy todir="${ver.dir}/src">
618
        <fileset dir="${build.dir}/src"/>
619
      </copy>
620
621 992 berkley
      <delete dir="./${ver.dir}/${build.dir}"/>
622
      <delete dir="./${ver.dir}/dist"/>
623 882 jones
      <delete file="./${name}-${release}.zip"/>
624 1312 tao
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
625 882 jones
      <delete file="./${name}-${release}.tar.gz" />
626 1312 tao
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
627 1311 berkley
      <gzip zipfile="./${name}-${release}.tar.gz"
628 882 jones
                src="./${name}-${release}.tar"/>
629
      <delete file="./${name}-${release}.tar" />
630 1311 berkley
  </target>
631 806 jones
632
  <target name="distsrc" depends="dist">
633
      <mkdir dir="${ver.src}"/>
634
      <copy todir="${ver.src}">
635
        <fileset dir="./src"/>
636
      </copy>
637
638 882 jones
      <delete file="./${name}-src-${release}.zip"/>
639
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
640
      <delete file="./${name}-src-${release}.tar.gz" />
641
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
642 1311 berkley
      <gzip zipfile="./${name}-src-${release}.tar.gz"
643 882 jones
                src="./${name}-src-${release}.tar"/>
644
      <delete file="./${name}-src-${release}.tar" />
645 807 jones
      <delete dir="${dist.dir}"/>
646 1311 berkley
  </target>
647 806 jones
648 1702 tao
   <target name="stylesheettest">
649
     <xslt in="${input}" out="eml.html" style="lib/style/eml2/eml-2.0.0.xsl">
650
      <param name="displaymodule" expression="${displaymodule}"/>
651
      <param name="docid" expression="${input}"/>
652
      <param name="entitytype" expression="${entitytype}"/>
653
      <param name="entityindex" expression="${entityindex}"/>
654
      <outputproperty name="method" value="html"/>
655
      <outputproperty name="standalone" value="yes"/>
656
      <outputproperty name="encoding" value="iso8859_1"/>
657
      <outputproperty name="indent" value="yes"/>
658
    </xslt>
659
  </target>
660 1811 tao
661
662
663
  <target name="compileinterface" depends="clean,prepare">
664
    <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/${interface.name}.java" />
665
  </target>
666
667
  <target name="generateWSDL" depends="compileinterface">
668
    <echo message="Generating wsdl from ${interface.name} interface"/>
669
    <java classname="${java2wsdl.tool}"
670
          dir="${build.dir}" fork="yes"
671
          classpathref="webservicepath"  failonerror="true" >
672
      <arg value="-P"/>
673
      <arg value="${interface.name}PortType"/>
674
      <arg value="-S"/>
675
      <arg value="${interface.name}Service"/>
676
      <arg value="-y"/>
677
      <arg value="WRAPPED"/>
678
      <arg value="-u"/>
679
      <arg value="LITERAL"/>
680
      <arg value="-l"/>
681
      <arg value="http://localhost/ogsa/services/${interface.name}Service"/>
682
      <arg value="-n"/>
683
      <arg value="http://${services.namespace}/${interface.name}"/>
684
      <arg value="${interface.package}.${interface.name}"/>
685
    </java>
686
  </target>
687
688
   <target name="decorateWSDL" depends="generateWSDL">
689
      <property name="wsdl.file" value="${interface.name}Service.wsdl"/>
690
      <java classname="${wsdldecorator.tool}" dir="${build.dir}"
691
            fork="yes"
692
            classpathref="webservicepath" failonerror="true" >
693
        <arg value="${binding.file}"/>
694
        <arg value="${wsdl.file}"/>
695
      </java>
696
   </target>
697
698
   <target name="generatestubs" depends="decorateWSDL">
699
      <echo message=" Generating stubs " />
700
      <java classname="${wsdl.tool}" dir="${build.src}" fork="yes"
701
            classpathref="webservicepath" failonerror="true" >
702
         <arg value="../${wsdl.file}"/>
703
    </java>
704
  </target>
705
706
  <target name="compileStubsAndImpl" depends="generatestubs, utilities">
707
     <echo message=" Compiling stubs " />
708
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" includes="**/${interface.name}/*.java" />
709
     <echo message=" Compiling impl " />
710
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" classpath="./lib/utilities.jar" includes="**/impl/*.java" />
711
  </target>
712
713
  <target name="jarStubsAndImpl" depends="compileStubsAndImpl">
714
     <echo message=" jar stubs classes " />
715
     <jar destfile="${build.dir}/${interface.name}-stubs.jar" basedir="${build.dest}" includes="**/${interface.name}/*.class" />
716
     <echo message=" jar impl classes " />
717
     <jar destfile="${build.dir}/${interface.name}.jar" basedir="${build.dest}" includes="**/impl/*.class" />
718
  </target>
719
720
  <target name="gar" depends="jarStubsAndImpl">
721
     <echo message=" jar the gar file"/>
722
     <mkdir dir="${build.dir}/gar"/>
723
     <mkdir dir="${build.dir}/gar/schema/edu"/>
724
     <copy file="${build.dir}/${interface.name}.jar" todir="${build.dir}/gar" />
725
     <copy file="${build.dir}/${interface.name}-stubs.jar" todir="${build.dir}/gar" />
726
     <copy file="server-deploy.wsdd" todir="${build.dir}/gar" />
727
     <copy file="${build.dir}/${interface.name}Service.wsdl" todir="${build.dir}/gar/schema/edu" />
728
     <jar destfile="${interface.name}.gar" basedir="${build.dir}/gar"/>
729
  </target>
730 113 jones
</project>