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 2277 jones
  <property environment="env"/>
34 1929 brooke
  <property file="build.properties"/>  <!-- USER SPECIFIC PROPS -->
35
36
  <target name="check-db">
37
    <condition property="use-oracle">
38
      <equals arg1="${database}" arg2="oracle" />
39
    </condition>
40
    <condition property="use-postgresql">
41
      <equals arg1="${database}" arg2="postgresql" />
42
    </condition>
43
    <condition property="use-sqlserver">
44
      <equals arg1="${database}" arg2="sqlserver" />
45
    </condition>
46
  </target>
47
48
  <target name="oracle" if="use-oracle">
49 931 jones
     <!-- Customize these properties if you are using oracle -->
50 1929 brooke
     <echo message="Using oracle..."/>
51 925 berkley
     <property name="dbDriver" value="oracle.jdbc.driver.OracleDriver"/>
52
     <property name="dbAdapter" value="edu.ucsb.nceas.dbadapter.OracleAdapter"/>
53 1929 brooke
     <property name="jdbc" value="${jdbc_base}/classes111.zip" />
54 1744 tao
     <!-- Property to indicate is not MSSQL installation-->
55
     <property name="other" value="yes"/>
56 2175 tao
     <property name="install-sql"
57 2103 jones
               value="xmltables.sql" />
58 2175 tao
     <property name="upgrade-1.2-sql"
59 2103 jones
               value="upgrade-db-to-1.2.sql" />
60 2175 tao
     <property name="upgrade-1.3-sql"
61 2103 jones
               value="upgrade-db-to-1.3.sql" />
62 2175 tao
     <property name="upgrade-1.4-sql"
63 2103 jones
               value="upgrade-db-to-1.4.sql" />
64 925 berkley
   </target>
65 1311 berkley
66 1929 brooke
   <target name="postgresql" if="use-postgresql">
67 931 jones
     <!-- Customize these properties if you are using postgres -->
68 1929 brooke
     <echo message="Using PostgreSQL..."/>
69 925 berkley
     <property name="dbDriver" value="org.postgresql.Driver"/>
70 1311 berkley
     <property name="dbAdapter"
71 931 jones
               value="edu.ucsb.nceas.dbadapter.PostgresqlAdapter"/>
72 1716 berkley
     <property name="jdbc" value="lib/jdbc7.1-1.2.jar" />
73 1744 tao
     <!-- Property to indicate is not MSSQL installation-->
74
     <property name="other" value="yes"/>
75 2175 tao
     <property name="install-sql"
76 2277 jones
               value="xmltables-postgres.sql" />
77 2175 tao
     <property name="upgrade-1.2-sql"
78 2277 jones
               value="upgrade-db-to-1.2-postgres.sql" />
79 2175 tao
     <property name="upgrade-1.3-sql"
80 2277 jones
               value="upgrade-db-to-1.3-postgres.sql" />
81 2175 tao
     <property name="upgrade-1.4-sql"
82 2277 jones
               value="upgrade-db-to-1.4-postgres.sql" />
83 1744 tao
    </target>
84 2175 tao
85 1929 brooke
   <target name="sqlserver" if="use-sqlserver">
86 1739 tao
     <!-- Customize these properties if you are using SQL server -->
87 1929 brooke
     <echo message="Using SQL Server..."/>
88 1739 tao
     <property name="dbDriver" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
89
     <property name="dbAdapter"
90
               value="edu.ucsb.nceas.dbadapter.SqlserverAdapter"/>
91 2296 sgarg
     <property name="jdbc" value="${jdbc_base}/msbase.jar" />
92
     <property name="jdbc-add1" value="${jdbc_base}/msutil.jar" />
93
     <property name="jdbc-add2" value="${jdbc_base}/mssqlserver.jar" />
94 1744 tao
     <!-- Property to indicate is a MSSQL installation-->
95
     <property name="MSSQL" value="yes"/>
96 2175 tao
     <property name="install-sql"
97 2118 costa
               value="xmltables-sqlserver.sql" />
98 1739 tao
   </target>
99 1311 berkley
100 1929 brooke
   <target name="config" depends="check-db,oracle,postgresql,sqlserver">
101 1814 tao
      <!-- usr for client testing, generally you don't need change-->
102 2277 jones
      <property name="mcuser" value="uid=jones,o=NCEAS,dc=ecoinformatics,dc=org"/>
103 1783 jones
      <property name="mcpassword" value=""/>
104 1801 tao
      <property name="mcanotheruser" value="uid=jtao,o=LTER,dc=ecoinformatics,dc=org"/>
105
      <property name="mcanotherpassword" value=""/>
106
107 1827 jones
      <property name="debug" value="on" />
108 2053 sgarg
      <property name="debuglevel" value="55" />
109 1716 berkley
110 1522 berkley
      <property name="morphosourcedir" value="../morpho" />
111 1570 tao
      <property name="defaultcontenttype" value="application/octet-stream" />
112 1780 jones
      <property name="utilitiesdir" value="../utilities" />
113 2175 tao
114 931 jones
      <!-- Make sure these paths match the location of the jar files
115
           on your system, the defaults should usually work -->
116 1941 brooke
      <condition property="jsdk" value="${tomcat}/lib/common/servlet.jar">
117
        <equals arg1="${tomcatversion}" arg2="tomcat3" />
118
      </condition>
119
      <condition property="jsdk" value="${tomcat}/common/lib/servlet.jar">
120
        <equals arg1="${tomcatversion}" arg2="tomcat4" />
121
      </condition>
122 2011 cjones
      <condition property="jsdk" value="${tomcat}/common/lib/servlet-api.jar">
123
        <equals arg1="${tomcatversion}" arg2="tomcat5" />
124
      </condition>
125 1941 brooke
      <echo>*********** tomcatversion = ${tomcatversion}</echo>
126
      <echo>*********** set jsdk to ${jsdk}</echo>
127 1311 berkley
      <property name="xmlp"
128 1376 tao
                value="lib/xercesImpl.jar" />
129 1311 berkley
      <property name="cos"
130 931 jones
                value="lib/cos.jar" />
131 939 tao
      <property name="morpho"
132
                value="lib/morpho.jar" />
133 931 jones
      <property name="xalan"
134
                value="lib/xalan/xalan.jar" />
135
      <property name="apis"
136
                value="lib/xalan/xml-apis.jar" />
137 1103 tao
      <property name="httpclient"
138 1780 jones
                value="lib/httpclient.jar" />
139 1470 tao
      <property name="emlparser"
140
                value="lib/eml.jar" />
141
      <property name="configxml"
142
                value="lib/configxml.jar" />
143 1578 tao
      <property name="itislib"
144
                value="lib/itislib.jar" />
145 1487 tao
      <property name="emlparser"
146 2175 tao
147 1487 tao
                value="lib/eml.jar" />
148 1780 jones
      <property name="util"
149
                value="lib/utilities.jar" />
150 1103 tao
  </target>
151
152 931 jones
   <target name="init" depends="config">
153
      <!-- It is less likely you'll need to make any changes from here down,
154
           but customization is possible -->
155 1929 brooke
      <property name="installdir"          value="${webapps}/${context}" />
156
      <property name="temp-dir"            value="/tmp/${context}" />
157
      <property name="name"                value="metacat"/>
158
      <property name="Name"                value="MetaCat"/>
159
      <property name="debugprefix"         value="${Name}:"/>
160 1990 jones
      <property name="release"             value="1.4.0"/>
161 1929 brooke
      <property name="replication-path"    value="/${context}/servlet/replication"/>
162 2299 costa
      <property name="harvester-registration-login-path" value="/${context}/servlet/HarvesterRegistrationLogin"/>
163
      <property name="harvester-registration-path"       value="/${context}/servlet/HarvesterRegistration"/>
164 1952 jones
      <property name="servlet-path"        value="/${context}/metacat"/>
165 1929 brooke
      <property name="html-path"           value="/${context}"/>
166 2180 tao
      <property name="systemidserver"      value="http://${httpserver}"/>
167 2175 tao
      <property name="style-common-relpath"
168 1933 brooke
                                           value="/style/common"/>
169 2175 tao
      <property name="style-common-cvsrelpath"
170 1938 brooke
                                           value="lib${style-common-relpath}"/>
171 2175 tao
      <property name="style-common-fullpath"
172 1933 brooke
                                           value="/${installdir}${style-common-relpath}"/>
173 2175 tao
      <property name="style-common-path"
174 1933 brooke
                                           value="/${context}${style-common-relpath}"/>
175 1929 brooke
      <property name="style-skins-relpath" value="/style/skins"/>
176
      <property name="style-skins-path"    value="/${context}${style-skins-relpath}"/>
177
      <property name="replication-log"     value="/tmp/metacatreplication.log"/>
178 1579 tao
      <property name="replicationerrorlog" value="/tmp/metacatreplication.err"/>
179 1929 brooke
      <property name="config-dir"          value="${webapps}/${style-skins-path}" />
180
      <property name="eml-module"          value="eml" />
181
      <property name="eml-version"         value="2.0.0beta6" />
182
      <property name="eml-tag"             value="EML_2_0_0_BETA_6_FOR_METACAT" />
183 2232 sgarg
      <property name="eml2_0_0-tag"        value="RELEASE_EML_2_0_0_UPDATE_1" />
184
      <property name="eml2_0_1-tag"        value="RELEASE_EML_2_0_1" />
185 2228 sgarg
      <property name="eml2_0_0namespace"   value="eml://ecoinformatics.org/eml-2.0.0" />
186
      <property name="eml2_0_1namespace"   value="eml://ecoinformatics.org/eml-2.0.1" />
187
      <property name="eml2_1_0namespace"   value="eml://ecoinformatics.org/eml-2.1.0" />
188 1929 brooke
      <property name="stmmlnamespace"      value="http://www.xml-cml.org/schema/stmml" />
189 1933 brooke
      <property name="eml-css"             value="eml_xsl.css"/>
190
      <property name="eml-module.default.css"
191
                                           value="default.css"/>
192 1929 brooke
      <property name="conversion-module"   value="webmdentry" />
193 348 jones
194 1929 brooke
      <!-- Config for registry variables -->
195 1933 brooke
      <property name="scope"               value="obfs"/>
196
      <property name="responseForm"        value="genericResponse.tmpl"/>
197
      <property name="entryForm"           value="entryForm.tmpl"/>
198
      <property name="guide"               value="genericGuide.tmpl"/>
199 1929 brooke
      <property name="confirmData" value="confirmData.tmpl"/>
200
      <property name="deleteData" value="deleteData.tmpl"/>
201
      <property name="genericHeader" value="genericHeader.tmpl"/>
202
      <property name="genericFooter" value="genericFooter.tmpl"/>
203
      <property name="adminname" value="KNB Support"/>
204
      <property name="recipient" value="knb-software\@nceas.ucsb.edu"/>
205
      <filter token="scope" value="${scope}"/>
206
      <filter token="responseForm" value="${responseForm}"/>
207
      <filter token="entryForm" value="${entryForm}"/>
208 2175 tao
      <filter token="guide" value="${guide}"/>
209 1929 brooke
      <filter token="confirmData" value="${confirmData}"/>
210
      <filter token="deleteData" value="${deleteData}"/>
211
      <filter token="genericHeader" value="${genericHeader}"/>
212
      <filter token="genericFooter" value="${genericFooter}"/>
213
      <filter token="adminname" value="${adminname}"/>
214
      <filter token="recipient" value="${recipient}"/>
215
216 1311 berkley
      <property name="cpath"
217 1986 jones
                value="${xmlp}:${xalan}:${apis}:${jdbc}:${jsdk}:${cos}:${morpho}:${emlparser}:${jdbc-add1}:${jdbc-add2}:${util}:${httpclient}"/>
218 882 jones
219
      <filter token="docrooturl" value="./" />
220 588 berkley
      <filter token="jdbc-connect" value="${jdbc-connect}"/>
221 882 jones
      <filter token="dbDriver" value="${dbDriver}"/>
222 915 berkley
      <filter token="dbAdapter" value="${dbAdapter}"/>
223 614 bojilova
      <filter token="install-dir" value="${installdir}"/>
224 1929 brooke
      <filter token="temp-dir" value="${temp-dir}"/>
225 586 berkley
      <filter token="server" value="${server}"/>
226 977 tao
      <filter token="systemidserver" value="${systemidserver}"/>
227 1929 brooke
      <filter token="cgi-prefix" value="${cgi-prefix}"/>
228
      <filter token="ldapUrl" value="${ldapUrl}"/>
229 586 berkley
      <filter token="replication-log" value="${replication-log}"/>
230 1579 tao
      <filter token="replicationerrorlog" value="${replicationerrorlog}"/>
231 348 jones
      <filter token="release" value="${release}"/>
232
      <filter token="servlet-path" value="${servlet-path}"/>
233 359 bojilova
      <filter token="html-path" value="${html-path}"/>
234 362 jones
      <filter token="user" value="${user}"/>
235
      <filter token="password" value="${password}"/>
236 1783 jones
      <filter token="mcuser" value="${mcuser}"/>
237
      <filter token="mcpassword" value="${mcpassword}"/>
238 1801 tao
      <filter token="mcanotheruser" value="${mcanotheruser}"/>
239
      <filter token="mcanotherpassword" value="${mcanotherpassword}"/>
240 1929 brooke
      <filter token="knb-site-url" value="${knb-site-url}"/>
241 1933 brooke
      <filter token="eml-css" value="${eml-css}"/>
242 1929 brooke
      <filter token="style-skins-relpath" value="${style-skins-relpath}"/>
243
      <filter token="style-skins-path" value="${style-skins-path}"/>
244
      <filter token="style-common-relpath" value="${style-common-relpath}"/>
245
      <filter token="style-common-fullpath" value="${style-common-fullpath}"/>
246
      <filter token="style-common-path" value="${style-common-path}"/>
247
      <!-- The "style-path" filter is used by the eml xsl stylesheets!!  -->
248
      <filter token="style-path" value="${style-skins-path}"/>
249 525 berkley
      <filter token="replication-path" value="${replication-path}"/>
250 2299 costa
      <filter token="harvester-registration-login-path" value="${harvester-registration-login-path}"/>
251
      <filter token="harvester-registration-path" value="${harvester-registration-path}"/>
252 832 jones
      <filter token="config-dir" value="${config-dir}"/>
253
      <filter token="default-style" value="${default-style}"/>
254 877 jones
      <filter token="eml-version" value="${eml-version}"/>
255 2175 tao
      <filter token="eml2_0_0namespace" value="${eml2_0_0namespace}"/>
256 2228 sgarg
      <filter token="eml2_0_1namespace" value="${eml2_0_1namespace}"/>
257 2175 tao
      <filter token="eml2_1_0namespace" value="${eml2_1_0namespace}"/>
258 1718 tao
      <filter token="stmmlnamespace" value="${stmmlnamespace}"/>
259 1009 tao
      <filter token="context" value="${context}"/>
260 1292 tao
      <filter token="forcereplicationwaitingtime" value="${forcereplicationwaitingtime}" />
261 1051 tao
      <filter token="debuglevel" value="${debuglevel}" />
262 1079 tao
      <filter token="datafilepath" value="${datafilepath}" />
263 1455 tao
      <filter token="inlinedatafilepath" value="${inlinedatafilepath}" />
264 1522 berkley
      <filter token="defaultcontenttype" value="${defaultcontenttype}" />
265 1538 berkley
      <filter token="debugprefix" value="${debugprefix}"/>
266 2308 jones
      <filter token="administrators" value="${administrators}"/>
267 1487 tao
268 254 jones
      <property name="srcdir" value="./src" />
269 1783 jones
      <property name="testdir" value="./test" />
270 2277 jones
      <property name="testtorun" value="BuildIndexTest" />
271 1116 tao
      <property name="junittestsdir" value="./test/edu/ucsb/nceas/metacattest" />
272
      <property name="junitnettestsdir" value="./test/edu/ucsb/nceas/metacatnettest" />
273 348 jones
      <property name="build.dir" value="./build"/>
274
      <property name="build.src" value="${build.dir}/src"/>
275
      <property name="build.dest" value="${build.dir}/classes"/>
276 516 jones
      <property name="build.docs" value="${build.dir}/docs"/>
277 348 jones
      <property name="build.samples" value="${build.dir}/samples"/>
278
      <property name="build.tests" value="${build.dir}/tests"/>
279 1778 tao
      <property name="build.tmp" value="${build.dir}/tmp"/>
280 1116 tao
      <property name="build.metacattest" value="${build.tests}/metacattest"/>
281
      <property name="build.metacatnettest" value="${build.tests}/metacatnettest"/>
282 348 jones
      <property name="build.data" value="${build.dir}/data"/>
283 806 jones
      <property name="build.javadocs" value="${build.dir}/docs/api"/>
284 1952 jones
      <property name="build.war" value="${build.dir}/war"/>
285 348 jones
286 882 jones
      <property name="dist.dir" value="dist"/>
287 806 jones
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
288
      <property name="ver.src" value="${ver.dir}/src"/>
289
290 254 jones
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
291 113 jones
   </target>
292 1311 berkley
293 348 jones
   <target name="prepare" depends="init">
294
      <mkdir dir="${build.dir}"/>
295
      <mkdir dir="${build.src}"/>
296
      <mkdir dir="${build.dest}"/>
297 516 jones
      <mkdir dir="${build.javadocs}"/>
298 1778 tao
      <mkdir dir="${build.tmp}"/>
299 348 jones
300 822 jones
      <copy todir="${build.src}" filtering="yes">
301
        <fileset dir="${srcdir}">
302
          <include name="edu/**"/>
303
          <include name="com/**"/>
304 877 jones
          <include name="**/*.sql"/>
305 822 jones
          <exclude name="**/CVS*"/>
306
          <exclude name="**/.#*"/>
307
        </fileset>
308
      </copy>
309 2175 tao
      <available file="build/tmp/${conversion-module}" type="dir"
310 1954 jones
                 property="styles.not.needed"/>
311 348 jones
   </target>
312
313 1939 brooke
   <target name="compile" depends="prepare,utilities"
314 1986 jones
    description="Compiles java code to build dir, and copies metacat props files there">
315 1939 brooke
316 1311 berkley
       <javac srcdir="${build.src}"
317
              destdir="${build.dest}"
318
              classpath="${cpath}"
319 1827 jones
              debug="${debug}"
320 2135 costa
              excludes="**/*.sql **/stringclient/** **/client/*.java **/harvesterClient/*.java"/>
321 1311 berkley
   </target>
322 113 jones
323 1939 brooke
   <target name="jar" depends="compile"
324
    description="Compiles and jars metacat java code to metacat.jar in build dir">
325
326 353 jones
       <delete file="${build.dir}/${name}.jar" />
327 635 jones
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
328 2135 costa
            excludes="**/protocols/ **/harvesterClient/" />
329 1311 berkley
   </target>
330
331 1939 brooke
   <target name="protocol" depends="compile"
332
    description="Compiles and jars protocol java code to protocol.jar in build dir">
333 635 jones
       <delete file="${build.dir}/protocol.jar" />
334
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
335
            includes="**/protocols/" />
336 1311 berkley
   </target>
337 113 jones
338 1780 jones
   <target name="utilities" depends="config">
339 1796 jones
     <ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
340
     <ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
341 1780 jones
     <copy file="${utilitiesdir}/lib/httpclient.jar" todir="lib" />
342
     <copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
343
   </target>
344
345 1939 brooke
   <target name="client" depends="utilities, prepare"
346
    description="Compiles metacat-client java code to build dir">
347 1780 jones
       <javac srcdir="${build.src}"
348
              destdir="${build.dest}"
349
              classpath="${cpath}"
350
              includes="edu/ucsb/nceas/metacat/client/*" />
351
   </target>
352
353 1939 brooke
   <target name="clientjar" depends="client"
354
    description="Compiles and jars metacat-client java code to metacat-client.jar in build dir">
355 1780 jones
       <delete file="${build.dir}/${name}-client.jar" />
356
       <jar jarfile="${build.dir}/${name}-client.jar" basedir="${build.dest}"
357
            includes="**/metacat/client/" />
358
   </target>
359
360 2059 costa
   <target name="harvester" depends="client"
361 1950 costa
           description="Compiles harvester java code to build dir">
362
       <echo message="classpath is:   ${cpath}"/>
363
       <javac srcdir="${build.src}"
364
              destdir="${build.dest}"
365
              classpath="${cpath}"
366
              includes="edu/ucsb/nceas/metacat/harvesterClient/*" />
367
   </target>
368
369
   <target name="harvesterjar" depends="harvester"
370 2059 costa
           description="Compiles and jars harvester java code to harvester.jar in build dir">
371
       <delete file="${build.dir}/harvester.jar" />
372
       <jar jarfile="${build.dir}/harvester.jar" basedir="${build.dest}"
373 1950 costa
            includes="**/metacat/harvesterClient/" />
374
   </target>
375
376 2175 tao
   <target  name="geteml" depends="getemlpre2,geteml2+"
377 1939 brooke
            description="Calls getemlpre2 and geteml2+ targets" />
378
379
   <target name="getemlpre2" depends="prepare"
380
   description="Checks EML-beta6 out of cvs and copies dtds and xsl to your metacat cvs sandbox">
381 1612 tao
     <echo>Enter CVS password: </echo>
382
     <cvs cvsRoot="${cvsroot}"
383
          package="${eml-module}"
384
          tag="${eml-tag}"
385 1939 brooke
          dest="${build.tmp}/eml_${eml-tag}" />
386 1612 tao
     <mkdir dir="lib/dtd" />
387
     <copy todir="lib/dtd" filtering="yes">
388 1939 brooke
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}">
389 1612 tao
         <include name="*.dtd"/>
390
       </fileset>
391
       <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
392
     </copy>
393 2228 sgarg
394
     <copy todir="${style-common-cvsrelpath}" filtering="yes">
395
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}/style">
396
       <include name="**/*.xsl"/>
397
     </fileset>
398
     </copy>
399 1939 brooke
   </target>
400
401
   <target name="geteml2+" depends="prepare"
402
   description="Checks eml-2 out of cvs and copies schema and xsl to your metacat cvs sandbox">
403
     <echo>Enter CVS password: </echo>
404 1612 tao
     <cvs cvsRoot="${cvsroot}"
405
          package="${eml-module}"
406 2228 sgarg
          tag="${eml2_0_0-tag}"
407
          dest="${build.tmp}/eml_${eml2_0_0-tag}" />
408
     <mkdir dir="lib/schema/eml-2.0.0" />
409
     <copy todir="lib/schema/eml-2.0.0" filtering="yes">
410
       <fileset dir="${build.tmp}/eml_${eml2_0_0-tag}/${eml-module}">
411 1612 tao
         <include name="*.xsd"/>
412
       </fileset>
413 2175 tao
414 1939 brooke
       <!-- shouldn't we have a mapper here like this??
415
       <mapper type="glob" from="eml-*.xsd" to="eml-*-${eml-version}.xsd" />
416 2175 tao
417
       Jing's code didn't nave one - does it need to be added?
418 1939 brooke
       NOTE that eml-version is set to beta 6, so this would need changing -->
419 2175 tao
420 1612 tao
     </copy>
421 1939 brooke
     <antcall target="copyxsl">
422 2228 sgarg
        <param name="cvs.tagname" value="${eml2_0_0-tag}" />
423
        <param name="dirname" value="eml-2.0.0" />
424 1939 brooke
     </antcall>
425 2228 sgarg
426
     <echo>Enter CVS password: </echo>
427
     <cvs cvsRoot="${cvsroot}"
428
          package="${eml-module}"
429
          tag="${eml2_0_1-tag}"
430
          dest="${build.tmp}/eml_${eml2_0_1-tag}" />
431
     <mkdir dir="lib/schema/eml-2.0.1" />
432
     <copy todir="lib/schema/eml-2.0.1" filtering="yes">
433
       <fileset dir="${build.tmp}/eml_${eml2_0_1-tag}/${eml-module}">
434
         <include name="*.xsd"/>
435
       </fileset>
436
     </copy>
437
     <antcall target="copyxsl">
438
        <param name="cvs.tagname" value="${eml2_0_1-tag}" />
439
        <param name="dirname" value="eml-2.0.1" />
440
     </antcall>
441 1939 brooke
   </target>
442
443 2175 tao
444
445
   <target  name="copyxsl"
446 1939 brooke
   description="Copies xsl stylesheets from checkout in build/tmp to your metacat cvs sandbox">
447
448
     <delete file="${style-common-cvsrelpath}/${eml-css}"/>
449 2175 tao
450 2228 sgarg
     <copy todir="${style-common-cvsrelpath}/${dirname}" filtering="yes">
451
       <fileset dir="${build.tmp}/eml_${cvs.tagname}/${eml-module}/style/eml">
452 1929 brooke
       <include name="**/*.xsl"/>
453 1612 tao
     </fileset>
454
     </copy>
455 1939 brooke
456 2175 tao
457
     <!-- now copy default css from eml module and put it in style-common-path
458 1933 brooke
          dir with a new name, so other skin-specific css can import it if reqd -->
459 1939 brooke
     <copy file="${build.tmp}/eml_${cvs.tagname}/${eml-module}/${eml-module.default.css}"
460 1938 brooke
           tofile="${style-common-cvsrelpath}/${eml-css}" />
461 1612 tao
462 1463 tao
   </target>
463 2175 tao
464
465
466 1939 brooke
   <target name="dtdschemasql" depends="prepare"
467
   description="Registers the DTDs with the new Metacat instance">
468 877 jones
     <echo/>
469
     <echo>Registering the DTDs with the new Metacat instance...</echo>
470
     <sql driver="${dbDriver}"
471 1744 tao
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
472 877 jones
          url="${jdbc-connect}"
473
          userid="${user}"
474
          password="${password}"
475 1593 tao
          src="${build.src}/loaddtdschema.sql" />
476 877 jones
   </target>
477 1716 berkley
478 1939 brooke
   <target name="schemasql" depends="prepare"
479
            description="Registers the Schema with the new Metacat instance">
480 1570 tao
     <echo/>
481 1939 brooke
     <echo>Registering the Schema with the new Metacat instance...</echo>
482 1570 tao
     <sql driver="${dbDriver}"
483 1744 tao
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
484 1570 tao
          url="${jdbc-connect}"
485
          userid="${user}"
486
          password="${password}"
487
          src="${build.src}/loadschema.sql" />
488
   </target>
489 2175 tao
490 1939 brooke
   <target name="installdb" depends="prepare"
491
            description="Installs the database tables">
492 1827 jones
     <echo/>
493
     <echo>Installing the database tables...</echo>
494
     <sql driver="${dbDriver}"
495
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
496
          url="${jdbc-connect}"
497
          userid="${user}"
498
          password="${password}"
499 2103 jones
          src="${build.src}/${install-sql}" />
500 1827 jones
   </target>
501
502 1939 brooke
   <target name="upgrade12" depends="prepare"
503
            description="Updates the database tables to upgrade to version 1.2">
504 1827 jones
     <echo/>
505
     <echo>Updating the database tables to upgrade to version 1.2...</echo>
506
     <sql driver="${dbDriver}"
507
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
508
          url="${jdbc-connect}"
509
          userid="${user}"
510
          password="${password}"
511 2103 jones
          src="${build.src}/${upgrade-1.2-sql}" />
512 1827 jones
   </target>
513
514 1939 brooke
   <target name="upgrade13" depends="prepare"
515
            description="Updates the database tables to upgrade to version 1.3">
516 1827 jones
     <echo/>
517
     <echo>Updating the database tables to upgrade to version 1.3...</echo>
518
     <sql driver="${dbDriver}"
519
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
520
          url="${jdbc-connect}"
521
          userid="${user}"
522
          password="${password}"
523 2103 jones
          src="${build.src}/${upgrade-1.3-sql}" />
524 1827 jones
   </target>
525
526 2103 jones
   <target name="upgrade14" depends="prepare"
527
            description="Updates the database tables to upgrade to version 1.4">
528
     <echo/>
529
     <echo>Updating the database tables to upgrade to version 1.4...</echo>
530
     <sql driver="${dbDriver}"
531
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
532
          url="${jdbc-connect}"
533
          userid="${user}"
534
          password="${password}"
535
          src="${build.src}/${upgrade-1.4-sql}" />
536
   </target>
537
538 1952 jones
   <target name="install" depends="war" description="* Full Install *">
539 1079 tao
       <mkdir dir="${datafilepath}" />
540 1455 tao
       <mkdir dir="${inlinedatafilepath}" />
541 1079 tao
       <chmod dir="${datafilepath}" perm="ug+w" />
542 1929 brooke
       <mkdir dir="${temp-dir}"/>
543
       <chmod dir="${temp-dir}" perm="ug+w" />
544 1952 jones
       <copy file="${build.dir}/${context}.war" todir="${webapps}"/>
545
   </target>
546 2175 tao
547
   <target name="upgrade" depends="install"
548 1952 jones
          description="* Upgrade an existing metacat installation with a new version *">
549
       <unwar src="${webapps}/${context}.war" dest="${webapps}/${context}" />
550
   </target>
551
552 2175 tao
   <target name="install-registry" depends="init,getConversionXSL"
553 1952 jones
            description="Install Registry">
554 2175 tao
555 1952 jones
      <copy file="${srcdir}/perl/register-dataset.cgi"
556
            todir="${inst.cgi.dir}" filtering="yes"/>
557
      <chmod file="${inst.cgi.dir}/register-dataset.cgi" perm="ugo+x" />
558 2175 tao
559 1952 jones
      <mkdir dir="${temp-dir}" />
560
     <copy todir="${temp-dir}" filtering="yes">
561
       <fileset dir="${build.tmp}/${conversion-module}/lib/style">
562
         <include name="*.xsl"/>
563
         <include name="*.xml"/>
564
       </fileset>
565
     </copy>
566
567
      <echo message="Install Registry completed." />
568
   </target>
569
570 2175 tao
   <target name="install-skin" depends="init"
571 2052 sgarg
            description="Install a Skin">
572
573 2175 tao
      <input message="Please enter name of the skin"
574 2052 sgarg
             addproperty="skin-name"/>
575
576
      <mkdir dir="${installdir}/style/skins/${skin-name}" />
577
      <copy todir="${installdir}/style/skins/${skin-name}" filtering="yes">
578
       <fileset dir="lib/style/skins/${skin-name}">
579 2054 sgarg
           <exclude name="*.png"/>
580
           <exclude name="*.gif"/>
581 2210 jones
           <exclude name="*.jpg"/>
582 2277 jones
           <exclude name="**/CVS*"/>
583
           <exclude name="**/.#*"/>
584 2052 sgarg
       </fileset>
585
      </copy>
586 2054 sgarg
     <copy todir="${installdir}/style/skins/${skin-name}" filtering="no">
587
       <fileset dir="lib/style/skins/${skin-name}">
588
           <include name="*.png"/>
589
           <include name="*.gif"/>
590 2210 jones
           <include name="*.jpg"/>
591 2277 jones
           <exclude name="**/CVS*"/>
592
           <exclude name="**/.#*"/>
593 2054 sgarg
       </fileset>
594
      </copy>
595 2277 jones
      <!--
596 2210 jones
      <mkdir dir="${installdir}/style/skins/${skin-name}/images" />
597
     <copy todir="${installdir}/style/skins/${skin-name}/images" filtering="no">
598
       <fileset dir="lib/style/skins/${skin-name}/images">
599
           <include name="*.png"/>
600
           <include name="*.gif"/>
601
           <include name="*.jpg"/>
602
       </fileset>
603
      </copy>
604 2277 jones
      -->
605 2052 sgarg
606
      <echo message="Install Skin completed." />
607
   </target>
608
609 1952 jones
   <target name="war" depends="warPrepare,warMSSQL"
610
            description="Create a web archive (WAR) for servlet deployment">
611 2175 tao
       <war destfile="${build.dir}/${context}.war"
612 1952 jones
            webxml="${build.war}/web.xml">
613
         <fileset dir="${war.context}"/>
614
         <lib dir="${war.lib}"/>
615
         <webinf dir="${war.webinf}"/>
616
       </war>
617
   </target>
618
619 2059 costa
   <target name="warPrepare" depends="jar,clientjar,harvesterjar"
620 1952 jones
            description="Prepare files for creating a web archive (WAR)">
621
622
       <property name="war.lib" value="${build.war}/lib" />
623
       <property name="war.webinf" value="${build.war}/WEB-INF" />
624
       <property name="war.context" value="${build.war}/${context}" />
625
       <mkdir dir="${war.lib}" />
626
       <mkdir dir="${war.webinf}" />
627
       <mkdir dir="${war.context}" />
628
629
       <copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
630
       <copy file="${build.dir}/${name}-client.jar" todir="${war.lib}" />
631 2059 costa
       <copy file="${build.dir}/harvester.jar" todir="${war.lib}" />
632 1952 jones
       <copy todir="${war.lib}" filtering="no">
633 1823 jones
         <fileset dir="lib">
634
           <include name="*.jar"/>
635
         </fileset>
636
         <fileset dir="lib/xalan">
637
           <include name="*.jar"/>
638
         </fileset>
639
       </copy>
640 1952 jones
       <copy file="${jdbc}" tofile="${war.lib}/jdbc.jar" />
641 1729 tao
       <copy file="lib/web.xml.${tomcatversion}"
642 1952 jones
             tofile="${build.war}/web.xml" />
643
       <copy file="lib/metacat.properties" todir="${war.webinf}"
644 1951 jones
             filtering="yes" />
645 1952 jones
       <copy todir="${war.context}" filtering="no">
646 822 jones
         <fileset dir="lib">
647
           <include name="**/*.jpg"/>
648
           <include name="**/*.png"/>
649
           <include name="**/*.gif"/>
650
         </fileset>
651
       </copy>
652 1952 jones
       <copy todir="${war.context}" filtering="yes">
653 822 jones
         <fileset dir="lib">
654
           <exclude name="*.jar"/>
655
           <exclude name="*.properties"/>
656
           <exclude name="web.xml"/>
657 1437 berkley
           <exclude name="**/*.jpg"/>
658
           <exclude name="**/*.png"/>
659
           <exclude name="**/*.gif"/>
660 822 jones
         </fileset>
661
       </copy>
662 1952 jones
       <copy todir="${war.context}" filtering="no">
663 1929 brooke
         <fileset dir="lib">
664
           <include name="**/*.jpg"/>
665
           <include name="**/*.png"/>
666
           <include name="**/*.gif"/>
667
         </fileset>
668
       </copy>
669 1311 berkley
   </target>
670 1929 brooke
671 1952 jones
   <target name="warMSSQL" if="MSSQL" depends="warPrepare">
672
      <copy file="${jdbc-add1}" tofile="${war.lib}/msutil.jar" />
673
       <copy file="${jdbc-add2}" tofile="${war.lib}/mssqlserver.jar" />
674 1929 brooke
   </target>
675
676 2175 tao
   <target name="getConversionXSL" depends="prepare"
677 1954 jones
            unless="styles.not.needed"
678 1939 brooke
            description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
679 1929 brooke
     <echo>Enter CVS password: </echo>
680
     <cvs cvsRoot="${cvsroot-alternate}"
681
          package="${conversion-module}"
682
          dest="${build.tmp}" />
683
   </target>
684
685 2135 costa
   <target name="testprep" depends="jar,clientjar,harvesterjar">
686 1783 jones
      <mkdir dir="${build.tests}"/>
687
      <copy todir="${build.tests}" filtering="yes">
688
        <fileset dir="${testdir}">
689
          <include name="edu/**"/>
690
        </fileset>
691
      </copy>
692 971 tao
      <!-- copy and compile the tests into a jar file -->
693 1783 jones
      <javac srcdir="${build.tests}"
694
             destdir="${build.tests}"
695 2135 costa
             classpath="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/harvester.jar"
696 1612 tao
             debug="on"
697 1311 berkley
       includes="**/*.java" />
698 204 jones
699 1311 berkley
      <jar jarfile="${build.dir}/${name}-junittests.jar"
700 1783 jones
        basedir="${build.tests}"
701 1311 berkley
                includes="**/*.class" />
702 1822 jones
   </target>
703 971 tao
704 1939 brooke
   <target name="test" depends="testprep"
705
            description="Uses the ant junit task to run all JUnit tests">
706 1822 jones
707 971 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
708 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
709 971 tao
             haltonerror="no">
710 1783 jones
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
711 971 tao
        <classpath>
712 1783 jones
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/${name}-junittests.jar" />
713 971 tao
        </classpath>
714
715
        <formatter type="plain" />
716
717
        <batchtest fork="yes" todir="${build.dir}">
718 1783 jones
          <fileset dir="${build.tests}">
719 1116 tao
            <include name="**/*.class" />
720 971 tao
          </fileset>
721
        </batchtest>
722
     </junit>
723
   </target>
724 1103 tao
725 1939 brooke
    <target name="runonetest" depends="testprep"
726
            description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
727 1500 tao
728 1939 brooke
              <echo>testtorun: ${testtorun}</echo>
729
730 1500 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
731 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
732 1500 tao
             haltonerror="no">
733 2044 tao
        <!--<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>-->
734 1500 tao
        <classpath>
735 1783 jones
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/${name}-junittests.jar" />
736 1500 tao
        </classpath>
737
738
        <formatter type="plain" />
739
740
        <batchtest fork="yes" todir="${build.dir}">
741 1783 jones
          <fileset dir="${build.tests}">
742 1500 tao
            <include name="**/${testtorun}.class" />
743
          </fileset>
744
        </batchtest>
745
     </junit>
746
   </target>
747
748 2175 tao
   <target name="testharvester"
749 2135 costa
           depends="testprep"
750
           description="Uses the ant junit task to test only the Harvester code">
751 2175 tao
     <junit printsummary="yes"
752
            haltonfailure="off"
753 2135 costa
            fork="yes"
754
            haltonerror="off">
755
       <classpath>
756
         <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/harvester.jar:${build.dir}/${name}-junittests.jar" />
757
       </classpath>
758
       <formatter type="plain" />
759
       <batchtest fork="yes" todir="${build.dir}">
760
         <fileset dir="${build.tests}">
761
           <include name="**/harvesterClient/*.class" />
762
         </fileset>
763
       </batchtest>
764
     </junit>
765
   </target>
766
767 1939 brooke
  <target name="gethttpclient" depends="prepare"
768
            description="checks out and compiles morpho httpclient code">
769 1311 berkley
  <!--mkdir dir="${morphosourcedir}" -->
770 1487 tao
        <cvs cvsRoot="${cvsroot}"
771 1103 tao
             package="morpho"
772
             dest="." />
773 1107 tao
        <ant dir="${morphosourcedir}" inheritAll="false"  target="jar" />
774 1103 tao
   </target>
775
776
   <!-- run this target, we need to check out a another morpho souce dir was checked out. -->
777 1939 brooke
   <target name="nettest" depends="install"
778
            description="compiles and runs the metacatnettest code">
779 2175 tao
780 1103 tao
      <echo>***********************************
781 1311 berkley
      Please run ant gethttpclient first!
782
      ***********************************
783 1103 tao
      </echo>
784
      <!-- copy and compile the tests into a jar file -->
785 1116 tao
      <mkdir dir="${build.metacatnettest}"/>
786 1103 tao
      <javac srcdir="${junitnettestsdir}"
787 1116 tao
             destdir="${build.metacatnettest}"
788 1103 tao
             classpath="${cpath}:${build.dir}/${name}.jar:${httpclient}"
789
             includes="**/*.java" />
790
791
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
792 1116 tao
                    basedir="${build.metacatnettest}"
793 1103 tao
                    includes="**/*.class" />
794
795
      <!-- use the ant "junit" task to run JUnit tests. -->
796 1107 tao
      <junit printsummary="yes" haltonfailure="no" fork="yes"
797 1103 tao
             haltonerror="no">
798 1107 tao
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
799 1103 tao
        <classpath>
800 1807 tao
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${httpclient}:${build.dir}/${name}-junitnettests.jar:${itislib}" />
801 1103 tao
        </classpath>
802
803
        <formatter type="plain" />
804
805
        <batchtest fork="yes" todir="${build.dir}">
806 1116 tao
          <fileset dir="${build.metacatnettest}">
807
            <include name="**/*.class" />
808 1103 tao
          </fileset>
809
        </batchtest>
810
     </junit>
811 1311 berkley
   </target>
812 1103 tao
813 1939 brooke
   <target name="cleanweb" depends="clean"
814
            description="deletes tomcat web context dir and all its contents">
815 1522 berkley
     <delete dir="${installdir}" />
816
   </target>
817
818
819 1939 brooke
   <target name="clean" depends="init"
820
            description="deletes build dir and any files copied to cvs sandbox by build process (jars, xsl) Currently *not* schema/DTDs">
821 822 jones
       <delete dir="${build.dir}" />
822 1822 jones
       <delete file="lib/httpclient.jar" />
823
       <delete file="lib/utilities.jar" />
824 1939 brooke
       <delete includeEmptyDirs="true" failonerror="false">
825
         <fileset dir="${style-common-cvsrelpath}">
826
           <include name="${eml-css}" />
827
           <include name="eml-*/*.xsl" />
828
           <include name="eml-*" />
829
         </fileset>
830
     </delete>
831 113 jones
   </target>
832
833 1939 brooke
   <target name="jdoc" depends="prepare"
834
            description="generates javadoc documentation">
835 822 jones
       <javadoc packagenames="edu.ucsb.nceas.*"
836 516 jones
           sourcepath="${build.src}"
837
           destdir="${build.javadocs}"
838 113 jones
           author="true"
839
           version="true"
840
           use="true"
841 348 jones
           windowtitle="${Name} API"
842
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
843 113 jones
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;"
844
       />
845
   </target>
846
847 1939 brooke
   <target name="dist" depends="jar,protocol,jdoc,geteml"
848
            description="prepares a full release distribution">
849 806 jones
      <mkdir dir="${dist.dir}"/>
850
      <delete dir="${ver.dir}" />
851
      <mkdir dir="${ver.dir}"/>
852
      <copy todir="${ver.dir}">
853 1311 berkley
        <fileset dir="."
854 882 jones
            excludes="**/CVS* **/.#* **/src* **/test* **/build* **/docs* ${dist.dir}"/>
855 806 jones
      </copy>
856
      <copy todir="${ver.dir}" file="build.xml"/>
857
      <copy todir="${ver.dir}/lib" file="${build.dir}/metacat.jar"/>
858
      <copy todir="${ver.dir}/lib" file="${build.dir}/protocol.jar"/>
859 882 jones
860
      <copy todir="${ver.dir}/docs" filtering="yes">
861
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
862
      </copy>
863
      <copy todir="${ver.dir}/docs" filtering="no">
864
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
865
      </copy>
866 806 jones
      <copy todir="${ver.dir}/docs/dev">
867
        <fileset dir="${build.dir}/docs"/>
868
      </copy>
869 917 berkley
      <copy todir="${ver.dir}/src">
870
        <fileset dir="${build.dir}/src"/>
871
      </copy>
872
873 992 berkley
      <delete dir="./${ver.dir}/${build.dir}"/>
874
      <delete dir="./${ver.dir}/dist"/>
875 882 jones
      <delete file="./${name}-${release}.zip"/>
876 1312 tao
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
877 882 jones
      <delete file="./${name}-${release}.tar.gz" />
878 1312 tao
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
879 1311 berkley
      <gzip zipfile="./${name}-${release}.tar.gz"
880 882 jones
                src="./${name}-${release}.tar"/>
881
      <delete file="./${name}-${release}.tar" />
882 1311 berkley
  </target>
883 806 jones
884 1939 brooke
  <target name="distsrc" depends="dist"
885
            description="prepares a source distribution">
886 806 jones
      <mkdir dir="${ver.src}"/>
887
      <copy todir="${ver.src}">
888
        <fileset dir="./src"/>
889
      </copy>
890
891 882 jones
      <delete file="./${name}-src-${release}.zip"/>
892
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
893
      <delete file="./${name}-src-${release}.tar.gz" />
894
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
895 1311 berkley
      <gzip zipfile="./${name}-src-${release}.tar.gz"
896 882 jones
                src="./${name}-src-${release}.tar"/>
897
      <delete file="./${name}-src-${release}.tar" />
898 807 jones
      <delete dir="${dist.dir}"/>
899 1311 berkley
  </target>
900 806 jones
901 1702 tao
   <target name="stylesheettest">
902 1939 brooke
     <xslt in="${input}" out="eml.html" style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
903 1702 tao
      <param name="displaymodule" expression="${displaymodule}"/>
904
      <param name="docid" expression="${input}"/>
905
      <param name="entitytype" expression="${entitytype}"/>
906
      <param name="entityindex" expression="${entityindex}"/>
907
      <outputproperty name="method" value="html"/>
908
      <outputproperty name="standalone" value="yes"/>
909
      <outputproperty name="encoding" value="iso8859_1"/>
910
      <outputproperty name="indent" value="yes"/>
911
    </xslt>
912
  </target>
913 2175 tao
914 1819 tao
 <target name="gridinit" depends="init">
915
   <property name="java2wsdl.tool" value="org.apache.axis.wsdl.Java2WSDL" />
916
   <property name="wsdldecorator.tool" value="org.globus.ogsa.tools.wsdl.DecorateWSDL" />
917
   <property name="wsdl.tool" value="org.globus.ogsa.tools.wsdl.GSDL2Java"/>
918
   <property environment="env"/>
919
   <property name="binding.file" value="${env.GLOBUS_LOCATION}/schema/ogsi/ogsi_bindings.wsdl"/>
920 1820 tao
    <path id="webservicepath">
921
        <pathelement location="."/>
922
        <pathelement location="${env.JAVA_HOME}/../lib/tools.jar"/>
923
        <pathelement location="${build.dest}"/>
924
        <fileset dir="${env.GLOBUS_LOCATION}/lib">
925
           <include name="*.jar"/>
926
        </fileset>
927
      </path>
928 1819 tao
</target>
929
930 1821 tao
 <target name="gridprepare" depends="gridinit, prepare">
931 2175 tao
 </target>
932
933 1821 tao
  <target name="compileinterface" depends="clean, gridprepare">
934 1817 tao
    <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/${interface.name}.java" />
935 1811 tao
  </target>
936 2175 tao
937 1811 tao
  <target name="generateWSDL" depends="compileinterface">
938
    <echo message="Generating wsdl from ${interface.name} interface"/>
939
    <java classname="${java2wsdl.tool}"
940 1814 tao
          dir="${build.src}" fork="yes"
941 1811 tao
          classpathref="webservicepath"  failonerror="true" >
942
      <arg value="-P"/>
943
      <arg value="${interface.name}PortType"/>
944
      <arg value="-S"/>
945
      <arg value="${interface.name}Service"/>
946
      <arg value="-y"/>
947
      <arg value="WRAPPED"/>
948
      <arg value="-u"/>
949
      <arg value="LITERAL"/>
950
      <arg value="-l"/>
951
      <arg value="http://localhost/ogsa/services/${interface.name}Service"/>
952
      <arg value="-n"/>
953
      <arg value="http://${services.namespace}/${interface.name}"/>
954
      <arg value="${interface.package}.${interface.name}"/>
955
    </java>
956
  </target>
957 2175 tao
958 1811 tao
   <target name="decorateWSDL" depends="generateWSDL">
959
      <property name="wsdl.file" value="${interface.name}Service.wsdl"/>
960 1814 tao
      <java classname="${wsdldecorator.tool}" dir="${build.src}"
961 1811 tao
            fork="yes"
962
            classpathref="webservicepath" failonerror="true" >
963
        <arg value="${binding.file}"/>
964
        <arg value="${wsdl.file}"/>
965
      </java>
966
   </target>
967 2175 tao
968 1811 tao
   <target name="generatestubs" depends="decorateWSDL">
969
      <echo message=" Generating stubs " />
970 1814 tao
      <echo message="wsdl file is ${wsdl.file}"/>
971
      <echo message="build.src is ${build.src}"/>
972 1811 tao
      <java classname="${wsdl.tool}" dir="${build.src}" fork="yes"
973
            classpathref="webservicepath" failonerror="true" >
974 1814 tao
         <arg value="${wsdl.file}"/>
975 1811 tao
    </java>
976
  </target>
977 2175 tao
978 1811 tao
  <target name="compileStubsAndImpl" depends="generatestubs, utilities">
979
     <echo message=" Compiling stubs " />
980
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" includes="**/${interface.name}/*.java" />
981
     <echo message=" Compiling impl " />
982
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" classpath="./lib/utilities.jar" includes="**/impl/*.java" />
983
  </target>
984 2175 tao
985 1811 tao
  <target name="jarStubsAndImpl" depends="compileStubsAndImpl">
986
     <echo message=" jar stubs classes " />
987
     <jar destfile="${build.dir}/${interface.name}-stubs.jar" basedir="${build.dest}" includes="**/${interface.name}/*.class" />
988
     <echo message=" jar impl classes " />
989
     <jar destfile="${build.dir}/${interface.name}.jar" basedir="${build.dest}" includes="**/impl/*.class" />
990
  </target>
991 2175 tao
992 1811 tao
  <target name="gar" depends="jarStubsAndImpl">
993
     <echo message=" jar the gar file"/>
994
     <mkdir dir="${build.dir}/gar"/>
995
     <mkdir dir="${build.dir}/gar/schema/edu"/>
996
     <copy file="${build.dir}/${interface.name}.jar" todir="${build.dir}/gar" />
997
     <copy file="${build.dir}/${interface.name}-stubs.jar" todir="${build.dir}/gar" />
998 1814 tao
     <copy file="lib/utilities.jar" todir="${build.dir}/gar" />
999
     <copy file="lib/server-deploy.wsdd" todir="${build.dir}/gar" />
1000
     <copy file="${build.src}/${interface.name}Service.wsdl" todir="${build.dir}/gar/schema/edu" />
1001
     <jar destfile="lib/${interface.name}.gar" basedir="${build.dir}/gar"/>
1002 1811 tao
  </target>
1003 2175 tao
1004 1814 tao
  <target name="compilewebclient" depends="prepare">
1005
     <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/application/*.java" classpathref="webservicepath" />
1006
  </target>
1007 2175 tao
1008 1814 tao
  <target name="runwebclient" depends="compilewebclient">
1009 2175 tao
     <java classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
1010 1814 tao
           dir="${build.dest}" fork="yes"
1011
           classpathref="webservicepath" classpath="./lib/utilities.jar" failonerror="true">
1012
         <arg value="${serviceUrl}"/>
1013
         <arg value="${docid}"/>
1014
     </java>
1015
  </target>
1016 113 jones
</project>