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 1929 brooke
34
  <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 2103 jones
               value="xmltables_postgres.sql" />
77 2175 tao
     <property name="upgrade-1.2-sql"
78 2103 jones
               value="upgrade-db-to-1.2_postgres.sql" />
79 2175 tao
     <property name="upgrade-1.3-sql"
80 2103 jones
               value="upgrade-db-to-1.3_postgres.sql" />
81 2175 tao
     <property name="upgrade-1.4-sql"
82 2103 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 1801 tao
      <property name="mcuser" value="uid=tao,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
      <property name="testtorun" value="MetacatClientTest" />
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
           <include name="*.*"/>
575
           <exclude name="*.png"/>
576
           <exclude name="*.gif"/>
577 2210 jones
           <exclude name="*.jpg"/>
578 2052 sgarg
       </fileset>
579
      </copy>
580 2054 sgarg
     <copy todir="${installdir}/style/skins/${skin-name}" filtering="no">
581
       <fileset dir="lib/style/skins/${skin-name}">
582
           <include name="*.png"/>
583
           <include name="*.gif"/>
584 2210 jones
           <include name="*.jpg"/>
585 2054 sgarg
       </fileset>
586
      </copy>
587 2210 jones
      <mkdir dir="${installdir}/style/skins/${skin-name}/images" />
588
     <copy todir="${installdir}/style/skins/${skin-name}/images" filtering="no">
589
       <fileset dir="lib/style/skins/${skin-name}/images">
590
           <include name="*.png"/>
591
           <include name="*.gif"/>
592
           <include name="*.jpg"/>
593
       </fileset>
594
      </copy>
595 2052 sgarg
596
      <echo message="Install Skin completed." />
597
   </target>
598
599 1952 jones
   <target name="war" depends="warPrepare,warMSSQL"
600
            description="Create a web archive (WAR) for servlet deployment">
601 2175 tao
       <war destfile="${build.dir}/${context}.war"
602 1952 jones
            webxml="${build.war}/web.xml">
603
         <fileset dir="${war.context}"/>
604
         <lib dir="${war.lib}"/>
605
         <webinf dir="${war.webinf}"/>
606
       </war>
607
   </target>
608
609 2059 costa
   <target name="warPrepare" depends="jar,clientjar,harvesterjar"
610 1952 jones
            description="Prepare files for creating a web archive (WAR)">
611
612
       <property name="war.lib" value="${build.war}/lib" />
613
       <property name="war.webinf" value="${build.war}/WEB-INF" />
614
       <property name="war.context" value="${build.war}/${context}" />
615
       <mkdir dir="${war.lib}" />
616
       <mkdir dir="${war.webinf}" />
617
       <mkdir dir="${war.context}" />
618
619
       <copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
620
       <copy file="${build.dir}/${name}-client.jar" todir="${war.lib}" />
621 2059 costa
       <copy file="${build.dir}/harvester.jar" todir="${war.lib}" />
622 1952 jones
       <copy todir="${war.lib}" filtering="no">
623 1823 jones
         <fileset dir="lib">
624
           <include name="*.jar"/>
625
         </fileset>
626
         <fileset dir="lib/xalan">
627
           <include name="*.jar"/>
628
         </fileset>
629
       </copy>
630 1952 jones
       <copy file="${jdbc}" tofile="${war.lib}/jdbc.jar" />
631 1729 tao
       <copy file="lib/web.xml.${tomcatversion}"
632 1952 jones
             tofile="${build.war}/web.xml" />
633
       <copy file="lib/metacat.properties" todir="${war.webinf}"
634 1951 jones
             filtering="yes" />
635 1952 jones
       <copy todir="${war.context}" filtering="no">
636 822 jones
         <fileset dir="lib">
637
           <include name="**/*.jpg"/>
638
           <include name="**/*.png"/>
639
           <include name="**/*.gif"/>
640
         </fileset>
641
       </copy>
642 1952 jones
       <copy todir="${war.context}" filtering="yes">
643 822 jones
         <fileset dir="lib">
644
           <exclude name="*.jar"/>
645
           <exclude name="*.properties"/>
646
           <exclude name="web.xml"/>
647 1437 berkley
           <exclude name="**/*.jpg"/>
648
           <exclude name="**/*.png"/>
649
           <exclude name="**/*.gif"/>
650 822 jones
         </fileset>
651
       </copy>
652 1952 jones
       <copy todir="${war.context}" filtering="no">
653 1929 brooke
         <fileset dir="lib">
654
           <include name="**/*.jpg"/>
655
           <include name="**/*.png"/>
656
           <include name="**/*.gif"/>
657
         </fileset>
658
       </copy>
659 1311 berkley
   </target>
660 1929 brooke
661 1952 jones
   <target name="warMSSQL" if="MSSQL" depends="warPrepare">
662
      <copy file="${jdbc-add1}" tofile="${war.lib}/msutil.jar" />
663
       <copy file="${jdbc-add2}" tofile="${war.lib}/mssqlserver.jar" />
664 1929 brooke
   </target>
665
666 2175 tao
   <target name="getConversionXSL" depends="prepare"
667 1954 jones
            unless="styles.not.needed"
668 1939 brooke
            description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
669 1929 brooke
     <echo>Enter CVS password: </echo>
670
     <cvs cvsRoot="${cvsroot-alternate}"
671
          package="${conversion-module}"
672
          dest="${build.tmp}" />
673
   </target>
674
675 2135 costa
   <target name="testprep" depends="jar,clientjar,harvesterjar">
676 1783 jones
      <mkdir dir="${build.tests}"/>
677
      <copy todir="${build.tests}" filtering="yes">
678
        <fileset dir="${testdir}">
679
          <include name="edu/**"/>
680
        </fileset>
681
      </copy>
682 971 tao
      <!-- copy and compile the tests into a jar file -->
683 1783 jones
      <javac srcdir="${build.tests}"
684
             destdir="${build.tests}"
685 2135 costa
             classpath="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/harvester.jar"
686 1612 tao
             debug="on"
687 1311 berkley
       includes="**/*.java" />
688 204 jones
689 1311 berkley
      <jar jarfile="${build.dir}/${name}-junittests.jar"
690 1783 jones
        basedir="${build.tests}"
691 1311 berkley
                includes="**/*.class" />
692 1822 jones
   </target>
693 971 tao
694 1939 brooke
   <target name="test" depends="testprep"
695
            description="Uses the ant junit task to run all JUnit tests">
696 1822 jones
697 971 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
698 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
699 971 tao
             haltonerror="no">
700 1783 jones
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
701 971 tao
        <classpath>
702 1783 jones
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/${name}-junittests.jar" />
703 971 tao
        </classpath>
704
705
        <formatter type="plain" />
706
707
        <batchtest fork="yes" todir="${build.dir}">
708 1783 jones
          <fileset dir="${build.tests}">
709 1116 tao
            <include name="**/*.class" />
710 971 tao
          </fileset>
711
        </batchtest>
712
     </junit>
713
   </target>
714 1103 tao
715 1939 brooke
    <target name="runonetest" depends="testprep"
716
            description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
717 1500 tao
718 1939 brooke
              <echo>testtorun: ${testtorun}</echo>
719
720 1500 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
721 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
722 1500 tao
             haltonerror="no">
723 2044 tao
        <!--<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>-->
724 1500 tao
        <classpath>
725 1783 jones
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/${name}-junittests.jar" />
726 1500 tao
        </classpath>
727
728
        <formatter type="plain" />
729
730
        <batchtest fork="yes" todir="${build.dir}">
731 1783 jones
          <fileset dir="${build.tests}">
732 1500 tao
            <include name="**/${testtorun}.class" />
733
          </fileset>
734
        </batchtest>
735
     </junit>
736
   </target>
737
738 2175 tao
   <target name="testharvester"
739 2135 costa
           depends="testprep"
740
           description="Uses the ant junit task to test only the Harvester code">
741 2175 tao
     <junit printsummary="yes"
742
            haltonfailure="off"
743 2135 costa
            fork="yes"
744
            haltonerror="off">
745
       <classpath>
746
         <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/harvester.jar:${build.dir}/${name}-junittests.jar" />
747
       </classpath>
748
       <formatter type="plain" />
749
       <batchtest fork="yes" todir="${build.dir}">
750
         <fileset dir="${build.tests}">
751
           <include name="**/harvesterClient/*.class" />
752
         </fileset>
753
       </batchtest>
754
     </junit>
755
   </target>
756
757 1939 brooke
  <target name="gethttpclient" depends="prepare"
758
            description="checks out and compiles morpho httpclient code">
759 1311 berkley
  <!--mkdir dir="${morphosourcedir}" -->
760 1487 tao
        <cvs cvsRoot="${cvsroot}"
761 1103 tao
             package="morpho"
762
             dest="." />
763 1107 tao
        <ant dir="${morphosourcedir}" inheritAll="false"  target="jar" />
764 1103 tao
   </target>
765
766
   <!-- run this target, we need to check out a another morpho souce dir was checked out. -->
767 1939 brooke
   <target name="nettest" depends="install"
768
            description="compiles and runs the metacatnettest code">
769 2175 tao
770 1103 tao
      <echo>***********************************
771 1311 berkley
      Please run ant gethttpclient first!
772
      ***********************************
773 1103 tao
      </echo>
774
      <!-- copy and compile the tests into a jar file -->
775 1116 tao
      <mkdir dir="${build.metacatnettest}"/>
776 1103 tao
      <javac srcdir="${junitnettestsdir}"
777 1116 tao
             destdir="${build.metacatnettest}"
778 1103 tao
             classpath="${cpath}:${build.dir}/${name}.jar:${httpclient}"
779
             includes="**/*.java" />
780
781
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
782 1116 tao
                    basedir="${build.metacatnettest}"
783 1103 tao
                    includes="**/*.class" />
784
785
      <!-- use the ant "junit" task to run JUnit tests. -->
786 1107 tao
      <junit printsummary="yes" haltonfailure="no" fork="yes"
787 1103 tao
             haltonerror="no">
788 1107 tao
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
789 1103 tao
        <classpath>
790 1807 tao
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${httpclient}:${build.dir}/${name}-junitnettests.jar:${itislib}" />
791 1103 tao
        </classpath>
792
793
        <formatter type="plain" />
794
795
        <batchtest fork="yes" todir="${build.dir}">
796 1116 tao
          <fileset dir="${build.metacatnettest}">
797
            <include name="**/*.class" />
798 1103 tao
          </fileset>
799
        </batchtest>
800
     </junit>
801 1311 berkley
   </target>
802 1103 tao
803 1939 brooke
   <target name="cleanweb" depends="clean"
804
            description="deletes tomcat web context dir and all its contents">
805 1522 berkley
     <delete dir="${installdir}" />
806
   </target>
807
808
809 1939 brooke
   <target name="clean" depends="init"
810
            description="deletes build dir and any files copied to cvs sandbox by build process (jars, xsl) Currently *not* schema/DTDs">
811 822 jones
       <delete dir="${build.dir}" />
812 1822 jones
       <delete file="lib/httpclient.jar" />
813
       <delete file="lib/utilities.jar" />
814 1939 brooke
       <delete includeEmptyDirs="true" failonerror="false">
815
         <fileset dir="${style-common-cvsrelpath}">
816
           <include name="${eml-css}" />
817
           <include name="eml-*/*.xsl" />
818
           <include name="eml-*" />
819
         </fileset>
820
     </delete>
821 113 jones
   </target>
822
823 1939 brooke
   <target name="jdoc" depends="prepare"
824
            description="generates javadoc documentation">
825 822 jones
       <javadoc packagenames="edu.ucsb.nceas.*"
826 516 jones
           sourcepath="${build.src}"
827
           destdir="${build.javadocs}"
828 113 jones
           author="true"
829
           version="true"
830
           use="true"
831 348 jones
           windowtitle="${Name} API"
832
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
833 113 jones
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;"
834
       />
835
   </target>
836
837 1939 brooke
   <target name="dist" depends="jar,protocol,jdoc,geteml"
838
            description="prepares a full release distribution">
839 806 jones
      <mkdir dir="${dist.dir}"/>
840
      <delete dir="${ver.dir}" />
841
      <mkdir dir="${ver.dir}"/>
842
      <copy todir="${ver.dir}">
843 1311 berkley
        <fileset dir="."
844 882 jones
            excludes="**/CVS* **/.#* **/src* **/test* **/build* **/docs* ${dist.dir}"/>
845 806 jones
      </copy>
846
      <copy todir="${ver.dir}" file="build.xml"/>
847
      <copy todir="${ver.dir}/lib" file="${build.dir}/metacat.jar"/>
848
      <copy todir="${ver.dir}/lib" file="${build.dir}/protocol.jar"/>
849 882 jones
850
      <copy todir="${ver.dir}/docs" filtering="yes">
851
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
852
      </copy>
853
      <copy todir="${ver.dir}/docs" filtering="no">
854
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
855
      </copy>
856 806 jones
      <copy todir="${ver.dir}/docs/dev">
857
        <fileset dir="${build.dir}/docs"/>
858
      </copy>
859 917 berkley
      <copy todir="${ver.dir}/src">
860
        <fileset dir="${build.dir}/src"/>
861
      </copy>
862
863 992 berkley
      <delete dir="./${ver.dir}/${build.dir}"/>
864
      <delete dir="./${ver.dir}/dist"/>
865 882 jones
      <delete file="./${name}-${release}.zip"/>
866 1312 tao
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
867 882 jones
      <delete file="./${name}-${release}.tar.gz" />
868 1312 tao
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
869 1311 berkley
      <gzip zipfile="./${name}-${release}.tar.gz"
870 882 jones
                src="./${name}-${release}.tar"/>
871
      <delete file="./${name}-${release}.tar" />
872 1311 berkley
  </target>
873 806 jones
874 1939 brooke
  <target name="distsrc" depends="dist"
875
            description="prepares a source distribution">
876 806 jones
      <mkdir dir="${ver.src}"/>
877
      <copy todir="${ver.src}">
878
        <fileset dir="./src"/>
879
      </copy>
880
881 882 jones
      <delete file="./${name}-src-${release}.zip"/>
882
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
883
      <delete file="./${name}-src-${release}.tar.gz" />
884
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
885 1311 berkley
      <gzip zipfile="./${name}-src-${release}.tar.gz"
886 882 jones
                src="./${name}-src-${release}.tar"/>
887
      <delete file="./${name}-src-${release}.tar" />
888 807 jones
      <delete dir="${dist.dir}"/>
889 1311 berkley
  </target>
890 806 jones
891 1702 tao
   <target name="stylesheettest">
892 1939 brooke
     <xslt in="${input}" out="eml.html" style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
893 1702 tao
      <param name="displaymodule" expression="${displaymodule}"/>
894
      <param name="docid" expression="${input}"/>
895
      <param name="entitytype" expression="${entitytype}"/>
896
      <param name="entityindex" expression="${entityindex}"/>
897
      <outputproperty name="method" value="html"/>
898
      <outputproperty name="standalone" value="yes"/>
899
      <outputproperty name="encoding" value="iso8859_1"/>
900
      <outputproperty name="indent" value="yes"/>
901
    </xslt>
902
  </target>
903 2175 tao
904 1819 tao
 <target name="gridinit" depends="init">
905
   <property name="java2wsdl.tool" value="org.apache.axis.wsdl.Java2WSDL" />
906
   <property name="wsdldecorator.tool" value="org.globus.ogsa.tools.wsdl.DecorateWSDL" />
907
   <property name="wsdl.tool" value="org.globus.ogsa.tools.wsdl.GSDL2Java"/>
908
   <property environment="env"/>
909
   <property name="binding.file" value="${env.GLOBUS_LOCATION}/schema/ogsi/ogsi_bindings.wsdl"/>
910 1820 tao
    <path id="webservicepath">
911
        <pathelement location="."/>
912
        <pathelement location="${env.JAVA_HOME}/../lib/tools.jar"/>
913
        <pathelement location="${build.dest}"/>
914
        <fileset dir="${env.GLOBUS_LOCATION}/lib">
915
           <include name="*.jar"/>
916
        </fileset>
917
      </path>
918 1819 tao
</target>
919
920 1821 tao
 <target name="gridprepare" depends="gridinit, prepare">
921 2175 tao
 </target>
922
923 1821 tao
  <target name="compileinterface" depends="clean, gridprepare">
924 1817 tao
    <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/${interface.name}.java" />
925 1811 tao
  </target>
926 2175 tao
927 1811 tao
  <target name="generateWSDL" depends="compileinterface">
928
    <echo message="Generating wsdl from ${interface.name} interface"/>
929
    <java classname="${java2wsdl.tool}"
930 1814 tao
          dir="${build.src}" fork="yes"
931 1811 tao
          classpathref="webservicepath"  failonerror="true" >
932
      <arg value="-P"/>
933
      <arg value="${interface.name}PortType"/>
934
      <arg value="-S"/>
935
      <arg value="${interface.name}Service"/>
936
      <arg value="-y"/>
937
      <arg value="WRAPPED"/>
938
      <arg value="-u"/>
939
      <arg value="LITERAL"/>
940
      <arg value="-l"/>
941
      <arg value="http://localhost/ogsa/services/${interface.name}Service"/>
942
      <arg value="-n"/>
943
      <arg value="http://${services.namespace}/${interface.name}"/>
944
      <arg value="${interface.package}.${interface.name}"/>
945
    </java>
946
  </target>
947 2175 tao
948 1811 tao
   <target name="decorateWSDL" depends="generateWSDL">
949
      <property name="wsdl.file" value="${interface.name}Service.wsdl"/>
950 1814 tao
      <java classname="${wsdldecorator.tool}" dir="${build.src}"
951 1811 tao
            fork="yes"
952
            classpathref="webservicepath" failonerror="true" >
953
        <arg value="${binding.file}"/>
954
        <arg value="${wsdl.file}"/>
955
      </java>
956
   </target>
957 2175 tao
958 1811 tao
   <target name="generatestubs" depends="decorateWSDL">
959
      <echo message=" Generating stubs " />
960 1814 tao
      <echo message="wsdl file is ${wsdl.file}"/>
961
      <echo message="build.src is ${build.src}"/>
962 1811 tao
      <java classname="${wsdl.tool}" dir="${build.src}" fork="yes"
963
            classpathref="webservicepath" failonerror="true" >
964 1814 tao
         <arg value="${wsdl.file}"/>
965 1811 tao
    </java>
966
  </target>
967 2175 tao
968 1811 tao
  <target name="compileStubsAndImpl" depends="generatestubs, utilities">
969
     <echo message=" Compiling stubs " />
970
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" includes="**/${interface.name}/*.java" />
971
     <echo message=" Compiling impl " />
972
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" classpath="./lib/utilities.jar" includes="**/impl/*.java" />
973
  </target>
974 2175 tao
975 1811 tao
  <target name="jarStubsAndImpl" depends="compileStubsAndImpl">
976
     <echo message=" jar stubs classes " />
977
     <jar destfile="${build.dir}/${interface.name}-stubs.jar" basedir="${build.dest}" includes="**/${interface.name}/*.class" />
978
     <echo message=" jar impl classes " />
979
     <jar destfile="${build.dir}/${interface.name}.jar" basedir="${build.dest}" includes="**/impl/*.class" />
980
  </target>
981 2175 tao
982 1811 tao
  <target name="gar" depends="jarStubsAndImpl">
983
     <echo message=" jar the gar file"/>
984
     <mkdir dir="${build.dir}/gar"/>
985
     <mkdir dir="${build.dir}/gar/schema/edu"/>
986
     <copy file="${build.dir}/${interface.name}.jar" todir="${build.dir}/gar" />
987
     <copy file="${build.dir}/${interface.name}-stubs.jar" todir="${build.dir}/gar" />
988 1814 tao
     <copy file="lib/utilities.jar" todir="${build.dir}/gar" />
989
     <copy file="lib/server-deploy.wsdd" todir="${build.dir}/gar" />
990
     <copy file="${build.src}/${interface.name}Service.wsdl" todir="${build.dir}/gar/schema/edu" />
991
     <jar destfile="lib/${interface.name}.gar" basedir="${build.dir}/gar"/>
992 1811 tao
  </target>
993 2175 tao
994 1814 tao
  <target name="compilewebclient" depends="prepare">
995
     <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/application/*.java" classpathref="webservicepath" />
996
  </target>
997 2175 tao
998 1814 tao
  <target name="runwebclient" depends="compilewebclient">
999 2175 tao
     <java classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
1000 1814 tao
           dir="${build.dest}" fork="yes"
1001
           classpathref="webservicepath" classpath="./lib/utilities.jar" failonerror="true">
1002
         <arg value="${serviceUrl}"/>
1003
         <arg value="${docid}"/>
1004
     </java>
1005
  </target>
1006 113 jones
</project>