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