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 2317 jones
      <condition property="utilities.required">
292
        <or>
293
          <not><available file="lib/httpclient.jar"/></not>
294
          <not><available file="lib/utilities.jar"/></not>
295
        </or>
296
      </condition>
297 2318 jones
      <condition property="eml.required">
298
        <or>
299
          <not><available file="lib/schema/eml-2.0.1/eml.xsd"/></not>
300
          <not><available file="lib/schema/eml-2.0.0/eml.xsd"/></not>
301
          <not><available file="lib/dtd/eml-dataset-2.0.0beta6.dtd"/></not>
302
        </or>
303
      </condition>
304 113 jones
   </target>
305 1311 berkley
306 348 jones
   <target name="prepare" depends="init">
307
      <mkdir dir="${build.dir}"/>
308
      <mkdir dir="${build.src}"/>
309
      <mkdir dir="${build.dest}"/>
310 516 jones
      <mkdir dir="${build.javadocs}"/>
311 1778 tao
      <mkdir dir="${build.tmp}"/>
312 348 jones
313 822 jones
      <copy todir="${build.src}" filtering="yes">
314
        <fileset dir="${srcdir}">
315
          <include name="edu/**"/>
316
          <include name="com/**"/>
317 877 jones
          <include name="**/*.sql"/>
318 822 jones
          <exclude name="**/CVS*"/>
319
          <exclude name="**/.#*"/>
320
        </fileset>
321
      </copy>
322 2175 tao
      <available file="build/tmp/${conversion-module}" type="dir"
323 1954 jones
                 property="styles.not.needed"/>
324 348 jones
   </target>
325
326 1939 brooke
   <target name="compile" depends="prepare,utilities"
327 1986 jones
    description="Compiles java code to build dir, and copies metacat props files there">
328 1939 brooke
329 1311 berkley
       <javac srcdir="${build.src}"
330
              destdir="${build.dest}"
331
              classpath="${cpath}"
332 1827 jones
              debug="${debug}"
333 2135 costa
              excludes="**/*.sql **/stringclient/** **/client/*.java **/harvesterClient/*.java"/>
334 1311 berkley
   </target>
335 113 jones
336 2322 jones
   <target name="jar" depends="compile,geteml"
337 1939 brooke
    description="Compiles and jars metacat java code to metacat.jar in build dir">
338
339 353 jones
       <delete file="${build.dir}/${name}.jar" />
340 635 jones
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
341 2135 costa
            excludes="**/protocols/ **/harvesterClient/" />
342 1311 berkley
   </target>
343
344 1939 brooke
   <target name="protocol" depends="compile"
345
    description="Compiles and jars protocol java code to protocol.jar in build dir">
346 635 jones
       <delete file="${build.dir}/protocol.jar" />
347
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
348
            includes="**/protocols/" />
349 1311 berkley
   </target>
350 113 jones
351 2317 jones
   <target name="utilities" depends="config" if="utilities.required">
352 1796 jones
     <ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
353
     <ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
354 1780 jones
     <copy file="${utilitiesdir}/lib/httpclient.jar" todir="lib" />
355
     <copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
356
   </target>
357
358 1939 brooke
   <target name="client" depends="utilities, prepare"
359
    description="Compiles metacat-client java code to build dir">
360 1780 jones
       <javac srcdir="${build.src}"
361
              destdir="${build.dest}"
362
              classpath="${cpath}"
363
              includes="edu/ucsb/nceas/metacat/client/*" />
364
   </target>
365
366 1939 brooke
   <target name="clientjar" depends="client"
367
    description="Compiles and jars metacat-client java code to metacat-client.jar in build dir">
368 1780 jones
       <delete file="${build.dir}/${name}-client.jar" />
369
       <jar jarfile="${build.dir}/${name}-client.jar" basedir="${build.dest}"
370
            includes="**/metacat/client/" />
371
   </target>
372
373 2059 costa
   <target name="harvester" depends="client"
374 1950 costa
           description="Compiles harvester java code to build dir">
375
       <echo message="classpath is:   ${cpath}"/>
376
       <javac srcdir="${build.src}"
377
              destdir="${build.dest}"
378
              classpath="${cpath}"
379
              includes="edu/ucsb/nceas/metacat/harvesterClient/*" />
380
   </target>
381
382
   <target name="harvesterjar" depends="harvester"
383 2059 costa
           description="Compiles and jars harvester java code to harvester.jar in build dir">
384
       <delete file="${build.dir}/harvester.jar" />
385
       <jar jarfile="${build.dir}/harvester.jar" basedir="${build.dest}"
386 1950 costa
            includes="**/metacat/harvesterClient/" />
387
   </target>
388
389 2318 jones
   <target  name="geteml" depends="getemlpre2,geteml2+" if="eml.required"
390 1939 brooke
            description="Calls getemlpre2 and geteml2+ targets" />
391
392 2318 jones
   <target name="getemlpre2" depends="prepare" if="eml.required"
393 1939 brooke
   description="Checks EML-beta6 out of cvs and copies dtds and xsl to your metacat cvs sandbox">
394 1612 tao
     <echo>Enter CVS password: </echo>
395
     <cvs cvsRoot="${cvsroot}"
396
          package="${eml-module}"
397
          tag="${eml-tag}"
398 1939 brooke
          dest="${build.tmp}/eml_${eml-tag}" />
399 1612 tao
     <mkdir dir="lib/dtd" />
400
     <copy todir="lib/dtd" filtering="yes">
401 1939 brooke
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}">
402 1612 tao
         <include name="*.dtd"/>
403
       </fileset>
404
       <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
405
     </copy>
406 2228 sgarg
407
     <copy todir="${style-common-cvsrelpath}" filtering="yes">
408
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}/style">
409
       <include name="**/*.xsl"/>
410
     </fileset>
411
     </copy>
412 1939 brooke
   </target>
413
414 2318 jones
   <target name="geteml2+" depends="prepare" if="eml.required"
415 1939 brooke
   description="Checks eml-2 out of cvs and copies schema and xsl to your metacat cvs sandbox">
416
     <echo>Enter CVS password: </echo>
417 1612 tao
     <cvs cvsRoot="${cvsroot}"
418
          package="${eml-module}"
419 2228 sgarg
          tag="${eml2_0_0-tag}"
420
          dest="${build.tmp}/eml_${eml2_0_0-tag}" />
421
     <mkdir dir="lib/schema/eml-2.0.0" />
422
     <copy todir="lib/schema/eml-2.0.0" filtering="yes">
423
       <fileset dir="${build.tmp}/eml_${eml2_0_0-tag}/${eml-module}">
424 1612 tao
         <include name="*.xsd"/>
425
       </fileset>
426 2175 tao
427 1939 brooke
       <!-- shouldn't we have a mapper here like this??
428
       <mapper type="glob" from="eml-*.xsd" to="eml-*-${eml-version}.xsd" />
429 2175 tao
430
       Jing's code didn't nave one - does it need to be added?
431 1939 brooke
       NOTE that eml-version is set to beta 6, so this would need changing -->
432 2175 tao
433 1612 tao
     </copy>
434 1939 brooke
     <antcall target="copyxsl">
435 2228 sgarg
        <param name="cvs.tagname" value="${eml2_0_0-tag}" />
436
        <param name="dirname" value="eml-2.0.0" />
437 1939 brooke
     </antcall>
438 2228 sgarg
439
     <echo>Enter CVS password: </echo>
440
     <cvs cvsRoot="${cvsroot}"
441
          package="${eml-module}"
442
          tag="${eml2_0_1-tag}"
443
          dest="${build.tmp}/eml_${eml2_0_1-tag}" />
444
     <mkdir dir="lib/schema/eml-2.0.1" />
445
     <copy todir="lib/schema/eml-2.0.1" filtering="yes">
446
       <fileset dir="${build.tmp}/eml_${eml2_0_1-tag}/${eml-module}">
447
         <include name="*.xsd"/>
448
       </fileset>
449
     </copy>
450
     <antcall target="copyxsl">
451
        <param name="cvs.tagname" value="${eml2_0_1-tag}" />
452
        <param name="dirname" value="eml-2.0.1" />
453
     </antcall>
454 1939 brooke
   </target>
455
456 2175 tao
457
458
   <target  name="copyxsl"
459 1939 brooke
   description="Copies xsl stylesheets from checkout in build/tmp to your metacat cvs sandbox">
460
461
     <delete file="${style-common-cvsrelpath}/${eml-css}"/>
462 2175 tao
463 2228 sgarg
     <copy todir="${style-common-cvsrelpath}/${dirname}" filtering="yes">
464
       <fileset dir="${build.tmp}/eml_${cvs.tagname}/${eml-module}/style/eml">
465 1929 brooke
       <include name="**/*.xsl"/>
466 1612 tao
     </fileset>
467
     </copy>
468 1939 brooke
469 2175 tao
470
     <!-- now copy default css from eml module and put it in style-common-path
471 1933 brooke
          dir with a new name, so other skin-specific css can import it if reqd -->
472 1939 brooke
     <copy file="${build.tmp}/eml_${cvs.tagname}/${eml-module}/${eml-module.default.css}"
473 1938 brooke
           tofile="${style-common-cvsrelpath}/${eml-css}" />
474 1612 tao
475 1463 tao
   </target>
476 2175 tao
477
478
479 2322 jones
   <target name="register-schemas" depends="prepare"
480
   description="Registers the Schemas with a new Metacat instance">
481 877 jones
     <echo/>
482 2322 jones
     <echo>Registering the Schemas with the new Metacat instance...</echo>
483 877 jones
     <sql driver="${dbDriver}"
484 1744 tao
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
485 877 jones
          url="${jdbc-connect}"
486
          userid="${user}"
487
          password="${password}"
488 1593 tao
          src="${build.src}/loaddtdschema.sql" />
489 877 jones
   </target>
490 1716 berkley
491 1939 brooke
   <target name="installdb" depends="prepare"
492
            description="Installs the database tables">
493 1827 jones
     <echo/>
494
     <echo>Installing the database tables...</echo>
495
     <sql driver="${dbDriver}"
496
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
497
          url="${jdbc-connect}"
498
          userid="${user}"
499
          password="${password}"
500 2103 jones
          src="${build.src}/${install-sql}" />
501 1827 jones
   </target>
502
503 1939 brooke
   <target name="upgrade12" depends="prepare"
504
            description="Updates the database tables to upgrade to version 1.2">
505 1827 jones
     <echo/>
506
     <echo>Updating the database tables to upgrade to version 1.2...</echo>
507
     <sql driver="${dbDriver}"
508
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
509
          url="${jdbc-connect}"
510
          userid="${user}"
511
          password="${password}"
512 2103 jones
          src="${build.src}/${upgrade-1.2-sql}" />
513 1827 jones
   </target>
514
515 1939 brooke
   <target name="upgrade13" depends="prepare"
516
            description="Updates the database tables to upgrade to version 1.3">
517 1827 jones
     <echo/>
518
     <echo>Updating the database tables to upgrade to version 1.3...</echo>
519
     <sql driver="${dbDriver}"
520
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
521
          url="${jdbc-connect}"
522
          userid="${user}"
523
          password="${password}"
524 2103 jones
          src="${build.src}/${upgrade-1.3-sql}" />
525 1827 jones
   </target>
526
527 2103 jones
   <target name="upgrade14" depends="prepare"
528
            description="Updates the database tables to upgrade to version 1.4">
529
     <echo/>
530
     <echo>Updating the database tables to upgrade to version 1.4...</echo>
531
     <sql driver="${dbDriver}"
532
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
533
          url="${jdbc-connect}"
534
          userid="${user}"
535
          password="${password}"
536
          src="${build.src}/${upgrade-1.4-sql}" />
537
   </target>
538
539 1952 jones
   <target name="install" depends="war" description="* Full Install *">
540 1079 tao
       <mkdir dir="${datafilepath}" />
541 1455 tao
       <mkdir dir="${inlinedatafilepath}" />
542 1079 tao
       <chmod dir="${datafilepath}" perm="ug+w" />
543 1929 brooke
       <mkdir dir="${temp-dir}"/>
544
       <chmod dir="${temp-dir}" perm="ug+w" />
545 1952 jones
       <copy file="${build.dir}/${context}.war" todir="${webapps}"/>
546
   </target>
547 2175 tao
548
   <target name="upgrade" depends="install"
549 1952 jones
          description="* Upgrade an existing metacat installation with a new version *">
550
       <unwar src="${webapps}/${context}.war" dest="${webapps}/${context}" />
551
   </target>
552
553 2175 tao
   <target name="install-registry" depends="init,getConversionXSL"
554 1952 jones
            description="Install Registry">
555 2175 tao
556 1952 jones
      <copy file="${srcdir}/perl/register-dataset.cgi"
557
            todir="${inst.cgi.dir}" filtering="yes"/>
558
      <chmod file="${inst.cgi.dir}/register-dataset.cgi" perm="ugo+x" />
559 2175 tao
560 1952 jones
      <mkdir dir="${temp-dir}" />
561
     <copy todir="${temp-dir}" filtering="yes">
562
       <fileset dir="${build.tmp}/${conversion-module}/lib/style">
563
         <include name="*.xsl"/>
564
         <include name="*.xml"/>
565
       </fileset>
566
     </copy>
567
568
      <echo message="Install Registry completed." />
569
   </target>
570
571 2175 tao
   <target name="install-skin" depends="init"
572 2052 sgarg
            description="Install a Skin">
573
574 2175 tao
      <input message="Please enter name of the skin"
575 2052 sgarg
             addproperty="skin-name"/>
576
577
      <mkdir dir="${installdir}/style/skins/${skin-name}" />
578
      <copy todir="${installdir}/style/skins/${skin-name}" filtering="yes">
579
       <fileset dir="lib/style/skins/${skin-name}">
580 2054 sgarg
           <exclude name="*.png"/>
581
           <exclude name="*.gif"/>
582 2210 jones
           <exclude name="*.jpg"/>
583 2277 jones
           <exclude name="**/CVS*"/>
584
           <exclude name="**/.#*"/>
585 2052 sgarg
       </fileset>
586
      </copy>
587 2054 sgarg
     <copy todir="${installdir}/style/skins/${skin-name}" filtering="no">
588
       <fileset dir="lib/style/skins/${skin-name}">
589
           <include name="*.png"/>
590
           <include name="*.gif"/>
591 2210 jones
           <include name="*.jpg"/>
592 2277 jones
           <exclude name="**/CVS*"/>
593
           <exclude name="**/.#*"/>
594 2054 sgarg
       </fileset>
595
      </copy>
596 2277 jones
      <!--
597 2210 jones
      <mkdir dir="${installdir}/style/skins/${skin-name}/images" />
598
     <copy todir="${installdir}/style/skins/${skin-name}/images" filtering="no">
599
       <fileset dir="lib/style/skins/${skin-name}/images">
600
           <include name="*.png"/>
601
           <include name="*.gif"/>
602
           <include name="*.jpg"/>
603
       </fileset>
604
      </copy>
605 2277 jones
      -->
606 2052 sgarg
607
      <echo message="Install Skin completed." />
608
   </target>
609
610 1952 jones
   <target name="war" depends="warPrepare,warMSSQL"
611
            description="Create a web archive (WAR) for servlet deployment">
612 2175 tao
       <war destfile="${build.dir}/${context}.war"
613 1952 jones
            webxml="${build.war}/web.xml">
614
         <fileset dir="${war.context}"/>
615
         <lib dir="${war.lib}"/>
616
         <webinf dir="${war.webinf}"/>
617
       </war>
618
   </target>
619
620 2059 costa
   <target name="warPrepare" depends="jar,clientjar,harvesterjar"
621 1952 jones
            description="Prepare files for creating a web archive (WAR)">
622
623
       <property name="war.lib" value="${build.war}/lib" />
624
       <property name="war.webinf" value="${build.war}/WEB-INF" />
625
       <property name="war.context" value="${build.war}/${context}" />
626
       <mkdir dir="${war.lib}" />
627
       <mkdir dir="${war.webinf}" />
628
       <mkdir dir="${war.context}" />
629
630
       <copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
631
       <copy file="${build.dir}/${name}-client.jar" todir="${war.lib}" />
632 2059 costa
       <copy file="${build.dir}/harvester.jar" todir="${war.lib}" />
633 1952 jones
       <copy todir="${war.lib}" filtering="no">
634 1823 jones
         <fileset dir="lib">
635
           <include name="*.jar"/>
636
         </fileset>
637
         <fileset dir="lib/xalan">
638
           <include name="*.jar"/>
639
         </fileset>
640
       </copy>
641 1952 jones
       <copy file="${jdbc}" tofile="${war.lib}/jdbc.jar" />
642 1729 tao
       <copy file="lib/web.xml.${tomcatversion}"
643 1952 jones
             tofile="${build.war}/web.xml" />
644
       <copy file="lib/metacat.properties" todir="${war.webinf}"
645 1951 jones
             filtering="yes" />
646 1952 jones
       <copy todir="${war.context}" filtering="no">
647 822 jones
         <fileset dir="lib">
648
           <include name="**/*.jpg"/>
649
           <include name="**/*.png"/>
650
           <include name="**/*.gif"/>
651
         </fileset>
652
       </copy>
653 1952 jones
       <copy todir="${war.context}" filtering="yes">
654 822 jones
         <fileset dir="lib">
655
           <exclude name="*.jar"/>
656
           <exclude name="*.properties"/>
657
           <exclude name="web.xml"/>
658 1437 berkley
           <exclude name="**/*.jpg"/>
659
           <exclude name="**/*.png"/>
660
           <exclude name="**/*.gif"/>
661 822 jones
         </fileset>
662
       </copy>
663 1952 jones
       <copy todir="${war.context}" filtering="no">
664 1929 brooke
         <fileset dir="lib">
665
           <include name="**/*.jpg"/>
666
           <include name="**/*.png"/>
667
           <include name="**/*.gif"/>
668
         </fileset>
669
       </copy>
670 1311 berkley
   </target>
671 1929 brooke
672 1952 jones
   <target name="warMSSQL" if="MSSQL" depends="warPrepare">
673
      <copy file="${jdbc-add1}" tofile="${war.lib}/msutil.jar" />
674
       <copy file="${jdbc-add2}" tofile="${war.lib}/mssqlserver.jar" />
675 1929 brooke
   </target>
676
677 2175 tao
   <target name="getConversionXSL" depends="prepare"
678 1954 jones
            unless="styles.not.needed"
679 1939 brooke
            description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
680 1929 brooke
     <echo>Enter CVS password: </echo>
681
     <cvs cvsRoot="${cvsroot-alternate}"
682
          package="${conversion-module}"
683
          dest="${build.tmp}" />
684
   </target>
685
686 2135 costa
   <target name="testprep" depends="jar,clientjar,harvesterjar">
687 1783 jones
      <mkdir dir="${build.tests}"/>
688
      <copy todir="${build.tests}" filtering="yes">
689
        <fileset dir="${testdir}">
690
          <include name="edu/**"/>
691
        </fileset>
692
      </copy>
693 971 tao
      <!-- copy and compile the tests into a jar file -->
694 1783 jones
      <javac srcdir="${build.tests}"
695
             destdir="${build.tests}"
696 2135 costa
             classpath="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/harvester.jar"
697 1612 tao
             debug="on"
698 1311 berkley
       includes="**/*.java" />
699 204 jones
700 1311 berkley
      <jar jarfile="${build.dir}/${name}-junittests.jar"
701 1783 jones
        basedir="${build.tests}"
702 1311 berkley
                includes="**/*.class" />
703 1822 jones
   </target>
704 971 tao
705 1939 brooke
   <target name="test" depends="testprep"
706
            description="Uses the ant junit task to run all JUnit tests">
707 1822 jones
708 971 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
709 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
710 971 tao
             haltonerror="no">
711 1783 jones
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
712 971 tao
        <classpath>
713 1783 jones
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/${name}-junittests.jar" />
714 971 tao
        </classpath>
715
716
        <formatter type="plain" />
717
718
        <batchtest fork="yes" todir="${build.dir}">
719 1783 jones
          <fileset dir="${build.tests}">
720 1116 tao
            <include name="**/*.class" />
721 971 tao
          </fileset>
722
        </batchtest>
723
     </junit>
724
   </target>
725 1103 tao
726 1939 brooke
    <target name="runonetest" depends="testprep"
727
            description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
728 1500 tao
729 1939 brooke
              <echo>testtorun: ${testtorun}</echo>
730
731 1500 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
732 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
733 1500 tao
             haltonerror="no">
734 2044 tao
        <!--<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>-->
735 1500 tao
        <classpath>
736 1783 jones
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/${name}-junittests.jar" />
737 1500 tao
        </classpath>
738
739
        <formatter type="plain" />
740
741
        <batchtest fork="yes" todir="${build.dir}">
742 1783 jones
          <fileset dir="${build.tests}">
743 1500 tao
            <include name="**/${testtorun}.class" />
744
          </fileset>
745
        </batchtest>
746
     </junit>
747
   </target>
748
749 2175 tao
   <target name="testharvester"
750 2135 costa
           depends="testprep"
751
           description="Uses the ant junit task to test only the Harvester code">
752 2175 tao
     <junit printsummary="yes"
753
            haltonfailure="off"
754 2135 costa
            fork="yes"
755
            haltonerror="off">
756
       <classpath>
757
         <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/harvester.jar:${build.dir}/${name}-junittests.jar" />
758
       </classpath>
759
       <formatter type="plain" />
760
       <batchtest fork="yes" todir="${build.dir}">
761
         <fileset dir="${build.tests}">
762
           <include name="**/harvesterClient/*.class" />
763
         </fileset>
764
       </batchtest>
765
     </junit>
766
   </target>
767
768 1939 brooke
  <target name="gethttpclient" depends="prepare"
769
            description="checks out and compiles morpho httpclient code">
770 1311 berkley
  <!--mkdir dir="${morphosourcedir}" -->
771 1487 tao
        <cvs cvsRoot="${cvsroot}"
772 1103 tao
             package="morpho"
773
             dest="." />
774 1107 tao
        <ant dir="${morphosourcedir}" inheritAll="false"  target="jar" />
775 1103 tao
   </target>
776
777
   <!-- run this target, we need to check out a another morpho souce dir was checked out. -->
778 1939 brooke
   <target name="nettest" depends="install"
779
            description="compiles and runs the metacatnettest code">
780 2175 tao
781 1103 tao
      <echo>***********************************
782 1311 berkley
      Please run ant gethttpclient first!
783
      ***********************************
784 1103 tao
      </echo>
785
      <!-- copy and compile the tests into a jar file -->
786 1116 tao
      <mkdir dir="${build.metacatnettest}"/>
787 1103 tao
      <javac srcdir="${junitnettestsdir}"
788 1116 tao
             destdir="${build.metacatnettest}"
789 1103 tao
             classpath="${cpath}:${build.dir}/${name}.jar:${httpclient}"
790
             includes="**/*.java" />
791
792
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
793 1116 tao
                    basedir="${build.metacatnettest}"
794 1103 tao
                    includes="**/*.class" />
795
796
      <!-- use the ant "junit" task to run JUnit tests. -->
797 1107 tao
      <junit printsummary="yes" haltonfailure="no" fork="yes"
798 1103 tao
             haltonerror="no">
799 1107 tao
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
800 1103 tao
        <classpath>
801 1807 tao
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${httpclient}:${build.dir}/${name}-junitnettests.jar:${itislib}" />
802 1103 tao
        </classpath>
803
804
        <formatter type="plain" />
805
806
        <batchtest fork="yes" todir="${build.dir}">
807 1116 tao
          <fileset dir="${build.metacatnettest}">
808
            <include name="**/*.class" />
809 1103 tao
          </fileset>
810
        </batchtest>
811
     </junit>
812 1311 berkley
   </target>
813 1103 tao
814 1939 brooke
   <target name="cleanweb" depends="clean"
815
            description="deletes tomcat web context dir and all its contents">
816 1522 berkley
     <delete dir="${installdir}" />
817
   </target>
818
819
820 1939 brooke
   <target name="clean" depends="init"
821 2320 jones
            description="deletes build dir and files that can be regenerated form the release">
822 822 jones
       <delete dir="${build.dir}" />
823 2320 jones
   </target>
824
825
   <target name="fullclean" depends="clean"
826
            description="deletes even jars that depend on external sources such as stylesheets and jars">
827
       <delete file="lib/httpclient.jar" />
828
       <delete file="lib/utilities.jar" />
829 1939 brooke
       <delete includeEmptyDirs="true" failonerror="false">
830
         <fileset dir="${style-common-cvsrelpath}">
831
           <include name="${eml-css}" />
832
           <include name="eml-*/*.xsl" />
833
           <include name="eml-*" />
834
         </fileset>
835 2320 jones
       </delete>
836 113 jones
   </target>
837
838 1939 brooke
   <target name="jdoc" depends="prepare"
839
            description="generates javadoc documentation">
840 822 jones
       <javadoc packagenames="edu.ucsb.nceas.*"
841 516 jones
           sourcepath="${build.src}"
842
           destdir="${build.javadocs}"
843 2319 jones
           classpath="${cpath}"
844 113 jones
           author="true"
845
           version="true"
846
           use="true"
847 348 jones
           windowtitle="${Name} API"
848
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
849 113 jones
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;"
850
       />
851
   </target>
852
853 2317 jones
   <target name="dist" depends="geteml,jar,protocol,jdoc"
854 1939 brooke
            description="prepares a full release distribution">
855 806 jones
      <mkdir dir="${dist.dir}"/>
856
      <delete dir="${ver.dir}" />
857
      <mkdir dir="${ver.dir}"/>
858
      <copy todir="${ver.dir}">
859 1311 berkley
        <fileset dir="."
860 2323 jones
            excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/**"/>
861 806 jones
      </copy>
862
      <copy todir="${ver.dir}" file="build.xml"/>
863 2317 jones
      <copy todir="${ver.dir}" file="build.properties"/>
864 882 jones
865
      <copy todir="${ver.dir}/docs" filtering="yes">
866
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
867
      </copy>
868
      <copy todir="${ver.dir}/docs" filtering="no">
869
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
870
      </copy>
871 806 jones
      <copy todir="${ver.dir}/docs/dev">
872
        <fileset dir="${build.dir}/docs"/>
873
      </copy>
874 917 berkley
      <copy todir="${ver.dir}/src">
875
        <fileset dir="${build.dir}/src"/>
876
      </copy>
877
878 2323 jones
      <!--
879 992 berkley
      <delete dir="./${ver.dir}/${build.dir}"/>
880
      <delete dir="./${ver.dir}/dist"/>
881 2323 jones
      -->
882 882 jones
      <delete file="./${name}-${release}.zip"/>
883 1312 tao
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
884 882 jones
      <delete file="./${name}-${release}.tar.gz" />
885 1312 tao
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
886 1311 berkley
      <gzip zipfile="./${name}-${release}.tar.gz"
887 882 jones
                src="./${name}-${release}.tar"/>
888
      <delete file="./${name}-${release}.tar" />
889 1311 berkley
  </target>
890 806 jones
891 1939 brooke
  <target name="distsrc" depends="dist"
892
            description="prepares a source distribution">
893 806 jones
      <mkdir dir="${ver.src}"/>
894
      <copy todir="${ver.src}">
895
        <fileset dir="./src"/>
896
      </copy>
897
898 882 jones
      <delete file="./${name}-src-${release}.zip"/>
899
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
900
      <delete file="./${name}-src-${release}.tar.gz" />
901
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
902 1311 berkley
      <gzip zipfile="./${name}-src-${release}.tar.gz"
903 882 jones
                src="./${name}-src-${release}.tar"/>
904
      <delete file="./${name}-src-${release}.tar" />
905 807 jones
      <delete dir="${dist.dir}"/>
906 1311 berkley
  </target>
907 806 jones
908 1702 tao
   <target name="stylesheettest">
909 1939 brooke
     <xslt in="${input}" out="eml.html" style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
910 1702 tao
      <param name="displaymodule" expression="${displaymodule}"/>
911
      <param name="docid" expression="${input}"/>
912
      <param name="entitytype" expression="${entitytype}"/>
913
      <param name="entityindex" expression="${entityindex}"/>
914
      <outputproperty name="method" value="html"/>
915
      <outputproperty name="standalone" value="yes"/>
916
      <outputproperty name="encoding" value="iso8859_1"/>
917
      <outputproperty name="indent" value="yes"/>
918
    </xslt>
919
  </target>
920 2175 tao
921 1819 tao
 <target name="gridinit" depends="init">
922
   <property name="java2wsdl.tool" value="org.apache.axis.wsdl.Java2WSDL" />
923
   <property name="wsdldecorator.tool" value="org.globus.ogsa.tools.wsdl.DecorateWSDL" />
924
   <property name="wsdl.tool" value="org.globus.ogsa.tools.wsdl.GSDL2Java"/>
925
   <property environment="env"/>
926
   <property name="binding.file" value="${env.GLOBUS_LOCATION}/schema/ogsi/ogsi_bindings.wsdl"/>
927 1820 tao
    <path id="webservicepath">
928
        <pathelement location="."/>
929
        <pathelement location="${env.JAVA_HOME}/../lib/tools.jar"/>
930
        <pathelement location="${build.dest}"/>
931
        <fileset dir="${env.GLOBUS_LOCATION}/lib">
932
           <include name="*.jar"/>
933
        </fileset>
934
      </path>
935 1819 tao
</target>
936
937 1821 tao
 <target name="gridprepare" depends="gridinit, prepare">
938 2175 tao
 </target>
939
940 1821 tao
  <target name="compileinterface" depends="clean, gridprepare">
941 1817 tao
    <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/${interface.name}.java" />
942 1811 tao
  </target>
943 2175 tao
944 1811 tao
  <target name="generateWSDL" depends="compileinterface">
945
    <echo message="Generating wsdl from ${interface.name} interface"/>
946
    <java classname="${java2wsdl.tool}"
947 1814 tao
          dir="${build.src}" fork="yes"
948 1811 tao
          classpathref="webservicepath"  failonerror="true" >
949
      <arg value="-P"/>
950
      <arg value="${interface.name}PortType"/>
951
      <arg value="-S"/>
952
      <arg value="${interface.name}Service"/>
953
      <arg value="-y"/>
954
      <arg value="WRAPPED"/>
955
      <arg value="-u"/>
956
      <arg value="LITERAL"/>
957
      <arg value="-l"/>
958
      <arg value="http://localhost/ogsa/services/${interface.name}Service"/>
959
      <arg value="-n"/>
960
      <arg value="http://${services.namespace}/${interface.name}"/>
961
      <arg value="${interface.package}.${interface.name}"/>
962
    </java>
963
  </target>
964 2175 tao
965 1811 tao
   <target name="decorateWSDL" depends="generateWSDL">
966
      <property name="wsdl.file" value="${interface.name}Service.wsdl"/>
967 1814 tao
      <java classname="${wsdldecorator.tool}" dir="${build.src}"
968 1811 tao
            fork="yes"
969
            classpathref="webservicepath" failonerror="true" >
970
        <arg value="${binding.file}"/>
971
        <arg value="${wsdl.file}"/>
972
      </java>
973
   </target>
974 2175 tao
975 1811 tao
   <target name="generatestubs" depends="decorateWSDL">
976
      <echo message=" Generating stubs " />
977 1814 tao
      <echo message="wsdl file is ${wsdl.file}"/>
978
      <echo message="build.src is ${build.src}"/>
979 1811 tao
      <java classname="${wsdl.tool}" dir="${build.src}" fork="yes"
980
            classpathref="webservicepath" failonerror="true" >
981 1814 tao
         <arg value="${wsdl.file}"/>
982 1811 tao
    </java>
983
  </target>
984 2175 tao
985 1811 tao
  <target name="compileStubsAndImpl" depends="generatestubs, utilities">
986
     <echo message=" Compiling stubs " />
987
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" includes="**/${interface.name}/*.java" />
988
     <echo message=" Compiling impl " />
989
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" classpath="./lib/utilities.jar" includes="**/impl/*.java" />
990
  </target>
991 2175 tao
992 1811 tao
  <target name="jarStubsAndImpl" depends="compileStubsAndImpl">
993
     <echo message=" jar stubs classes " />
994
     <jar destfile="${build.dir}/${interface.name}-stubs.jar" basedir="${build.dest}" includes="**/${interface.name}/*.class" />
995
     <echo message=" jar impl classes " />
996
     <jar destfile="${build.dir}/${interface.name}.jar" basedir="${build.dest}" includes="**/impl/*.class" />
997
  </target>
998 2175 tao
999 1811 tao
  <target name="gar" depends="jarStubsAndImpl">
1000
     <echo message=" jar the gar file"/>
1001
     <mkdir dir="${build.dir}/gar"/>
1002
     <mkdir dir="${build.dir}/gar/schema/edu"/>
1003
     <copy file="${build.dir}/${interface.name}.jar" todir="${build.dir}/gar" />
1004
     <copy file="${build.dir}/${interface.name}-stubs.jar" todir="${build.dir}/gar" />
1005 1814 tao
     <copy file="lib/utilities.jar" todir="${build.dir}/gar" />
1006
     <copy file="lib/server-deploy.wsdd" todir="${build.dir}/gar" />
1007
     <copy file="${build.src}/${interface.name}Service.wsdl" todir="${build.dir}/gar/schema/edu" />
1008
     <jar destfile="lib/${interface.name}.gar" basedir="${build.dir}/gar"/>
1009 1811 tao
  </target>
1010 2175 tao
1011 1814 tao
  <target name="compilewebclient" depends="prepare">
1012
     <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/application/*.java" classpathref="webservicepath" />
1013
  </target>
1014 2175 tao
1015 1814 tao
  <target name="runwebclient" depends="compilewebclient">
1016 2175 tao
     <java classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
1017 1814 tao
           dir="${build.dest}" fork="yes"
1018
           classpathref="webservicepath" classpath="./lib/utilities.jar" failonerror="true">
1019
         <arg value="${serviceUrl}"/>
1020
         <arg value="${docid}"/>
1021
     </java>
1022
  </target>
1023 113 jones
</project>