Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  *   '$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
  *
9
  *    '$Author: sgarg $'
10
  *    '$Date: 2004-12-20 18:40:37 -0800 (Mon, 20 Dec 2004) $'
11
  *    '$Revision: 2344 $'
12
  *
13
  * Build file for the Ant cross-platform build system for metacat
14
  * See http://jakarta.apache.org for details on Ant
15
  *
16
  * usage: ant [compile|jar|install|jdoc]
17
  *
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
-->
32
<project name="metacat" default="jar" basedir=".">
33
  <property environment="env"/>
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
     <!-- Customize these properties if you are using oracle -->
50
     <echo message="Using oracle..."/>
51
     <property name="dbDriver" value="oracle.jdbc.driver.OracleDriver"/>
52
     <property name="dbAdapter" value="edu.ucsb.nceas.dbadapter.OracleAdapter"/>
53
     <property name="jdbc" value="${jdbc_base}/classes111.zip" />
54
     <!-- Property to indicate is not MSSQL installation-->
55
     <property name="other" value="yes"/>
56
     <property name="install-sql"
57
               value="xmltables.sql" />
58
     <property name="upgrade-1.2-sql"
59
               value="upgrade-db-to-1.2.sql" />
60
     <property name="upgrade-1.3-sql"
61
               value="upgrade-db-to-1.3.sql" />
62
     <property name="upgrade-1.4-sql"
63
               value="upgrade-db-to-1.4.sql" />
64
   </target>
65

    
66
   <target name="postgresql" if="use-postgresql">
67
     <!-- Customize these properties if you are using postgres -->
68
     <echo message="Using PostgreSQL..."/>
69
     <property name="dbDriver" value="org.postgresql.Driver"/>
70
     <property name="dbAdapter"
71
               value="edu.ucsb.nceas.dbadapter.PostgresqlAdapter"/>
72
     <property name="jdbc" value="lib/jdbc7.1-1.2.jar" />
73
     <!-- Property to indicate is not MSSQL installation-->
74
     <property name="other" value="yes"/>
75
     <property name="install-sql"
76
               value="xmltables-postgres.sql" />
77
     <property name="upgrade-1.2-sql"
78
               value="upgrade-db-to-1.2-postgres.sql" />
79
     <property name="upgrade-1.3-sql"
80
               value="upgrade-db-to-1.3-postgres.sql" />
81
     <property name="upgrade-1.4-sql"
82
               value="upgrade-db-to-1.4-postgres.sql" />
83
    </target>
84

    
85
   <target name="sqlserver" if="use-sqlserver">
86
     <!-- Customize these properties if you are using SQL server -->
87
     <echo message="Using SQL Server..."/>
88
     <property name="dbDriver" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
89
     <property name="dbAdapter"
90
               value="edu.ucsb.nceas.dbadapter.SqlserverAdapter"/>
91
     <property name="jdbc" value="${jdbc_base}/msbase.jar" />
92
     <property name="jdbc-add1" value="${jdbc_base}/msutil.jar" />
93
     <property name="jdbc-add2" value="${jdbc_base}/mssqlserver.jar" />
94
     <!-- Property to indicate is a MSSQL installation-->
95
     <property name="MSSQL" value="yes"/>
96
     <property name="install-sql"
97
               value="xmltables-sqlserver.sql" />
98
   </target>
99

    
100
   <target name="config" depends="check-db,oracle,postgresql,sqlserver">
101
      <!-- usr for client testing, generally you don't need change-->
102
      <property name="mcuser" value="uid=jones,o=NCEAS,dc=ecoinformatics,dc=org"/>
103
      <property name="mcpassword" value=""/>
104
      <property name="mcanotheruser" value="uid=jtao,o=LTER,dc=ecoinformatics,dc=org"/>
105
      <property name="mcanotherpassword" value=""/>
106

    
107
      <property name="debug" value="on" />
108
      <property name="debuglevel" value="55" />
109

    
110
      <property name="morphosourcedir" value="../morpho" />
111
      <property name="defaultcontenttype" value="application/octet-stream" />
112
      <property name="utilitiesdir" value="../utilities" />
113

    
114
      <!-- Make sure these paths match the location of the jar files
115
           on your system, the defaults should usually work -->
116
      <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
      <condition property="jsdk" value="${tomcat}/common/lib/servlet-api.jar">
123
        <equals arg1="${tomcatversion}" arg2="tomcat5" />
124
      </condition>
125
      <echo>*********** tomcatversion = ${tomcatversion}</echo>
126
      <echo>*********** set jsdk to ${jsdk}</echo>
127
      <property name="xmlp"
128
                value="lib/xercesImpl.jar" />
129
      <property name="cos"
130
                value="lib/cos.jar" />
131
      <property name="morpho"
132
                value="lib/morpho.jar" />
133
      <property name="xalan"
134
                value="lib/xalan/xalan.jar" />
135
      <property name="apis"
136
                value="lib/xalan/xml-apis.jar" />
137
      <property name="httpclient"
138
                value="lib/httpclient.jar" />
139
      <property name="emlparser"
140
                value="lib/eml.jar" />
141
      <property name="configxml"
142
                value="lib/configxml.jar" />
143
      <property name="itislib"
144
                value="lib/itislib.jar" />
145
      <property name="emlparser"
146

    
147
                value="lib/eml.jar" />
148
      <property name="util"
149
                value="lib/utilities.jar" />
150
  </target>
151

    
152
   <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
      <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
      <property name="release"             value="1.4.0"/>
161
      <property name="replication-path"    value="/${context}/servlet/replication"/>
162
      <property name="harvester-registration-login-path" value="/${context}/harvesterRegistrationLogin"/>
163
      <property name="harvester-registration-path"       value="/${context}/harvesterRegistration"/>
164
      <property name="servlet-path"        value="/${context}/metacat"/>
165
      <property name="html-path"           value="/${context}"/>
166
      <property name="systemidserver"      value="http://${httpserver}"/>
167
      <property name="style-common-relpath"
168
                                           value="/style/common"/>
169
      <property name="style-common-cvsrelpath"
170
                                           value="lib${style-common-relpath}"/>
171
      <property name="style-common-fullpath"
172
                                           value="/${installdir}${style-common-relpath}"/>
173
      <property name="templates.dir"       value="${style-common-fullpath}/templates"/>
174
      <property name="style-common-path"
175
                                           value="/${context}${style-common-relpath}"/>
176
      <property name="style-skins-relpath" value="/style/skins"/>
177
      <property name="style-skins-path"    value="/${context}${style-skins-relpath}"/>
178
      <property name="replication-log"     value="/tmp/metacatreplication.log"/>
179
      <property name="replicationerrorlog" value="/tmp/metacatreplication.err"/>
180
      <property name="config-dir"          value="${webapps}/${style-skins-path}" />
181
      <property name="eml-module"          value="eml" />
182
      <property name="eml-version"         value="2.0.0beta6" />
183
      <property name="eml-tag"             value="EML_2_0_0_BETA_6_FOR_METACAT" />
184
      <property name="eml2_0_0-tag"        value="RELEASE_EML_2_0_0_UPDATE_1" />
185
      <property name="eml2_0_1-tag"        value="RELEASE_EML_2_0_1" />
186
      <property name="eml2_0_0namespace"   value="eml://ecoinformatics.org/eml-2.0.0" />
187
      <property name="eml2_0_1namespace"   value="eml://ecoinformatics.org/eml-2.0.1" />
188
      <property name="eml2_1_0namespace"   value="eml://ecoinformatics.org/eml-2.1.0" />
189
      <property name="stmmlnamespace"      value="http://www.xml-cml.org/schema/stmml" />
190
      <property name="eml-css"             value="eml_xsl.css"/>
191
      <property name="eml-module.default.css"
192
                                           value="default.css"/>
193
      <property name="conversion-module"   value="webmdentry" />
194

    
195
      <!-- Config for registry variables -->
196
      <property name="scope"               value="obfs"/>
197
      <property name="responseForm"        value="genericResponse.tmpl"/>
198
      <property name="entryForm"           value="entryForm.tmpl"/>
199
      <property name="guide"               value="genericGuide.tmpl"/>
200
      <property name="confirmData"         value="confirmData.tmpl"/>
201
      <property name="deleteData"          value="deleteData.tmpl"/>
202
      <property name="genericHeader"       value="genericHeader.tmpl"/>
203
      <property name="genericFooter"       value="genericFooter.tmpl"/>
204
      <property name="adminname"           value="KNB Support"/>
205
      <property name="recipient"           value="knb-software\@nceas.ucsb.edu"/>
206

    
207
      <property name="defaultStage"        value="initregister"/>
208
      <property name="defaultHeader"       value="genericHeader.tmpl"/>
209
      <property name="defaultFooter"       value="genericFooter.tmpl"/>
210
      <property name="defaultChangePass"   value="ldapChangePass.tmpl"/>
211
      <property name="defaultResetPass"    value="ldapResetPass.tmpl"/>
212
      <property name="changePassSuccess"   value="ldapChangePassSuccess.tmpl"/>
213
      <property name="resetPassSuccess"    value="ldapResetPassSuccess.tmpl"/>
214
      <property name="registerFailed"      value="ldapRegisterFailed.tmpl"/>
215
      <property name="registerLter"        value="ldapRegisterLter.tmpl"/>
216
      <property name="registerMatch"       value="ldapRegisterMatch.tmpl"/>
217
      <property name="registerSuccess"     value="ldapRegisterSuccess.tmpl"/>
218
      <property name="register"            value="ldapRegister.tmpl"/>
219
      <property name="searchResults"       value="searchResults.tmpl"/>
220

    
221
      <filter token="scope"                value="${scope}"/>
222
      <filter token="responseForm"         value="${responseForm}"/>
223
      <filter token="entryForm"            value="${entryForm}"/>
224
      <filter token="guide"                value="${guide}"/>
225
      <filter token="confirmData"          value="${confirmData}"/>
226
      <filter token="deleteData"           value="${deleteData}"/>
227
      <filter token="genericHeader"        value="${genericHeader}"/>
228
      <filter token="genericFooter"        value="${genericFooter}"/>
229
      <filter token="adminname"            value="${adminname}"/>
230
      <filter token="recipient"            value="${recipient}"/>
231

    
232
      <filter token="ldapurl"              value="ldap.ecoinformatics.org"/>
233
      <filter token="ldapSearchBase"       value="dc=ecoinformatics,dc=org"/>
234
      <filter token="ldap_user"            value="cn=Manager,dc=ecoinformatics,dc=org"/>
235
      <filter token="ldap_password"        value="ldap_password"/>
236
      <filter token="mailhost"             value="smtp.ecoinformatics.org"/>
237
      <filter token="sender"               value="knb-software\@nceas.ucsb.edu"/>
238
      <filter token="cgiurl"               value="http://${server}/cgi-bin/ldapweb.cgi"/>   
239

    
240
      <property name="cpath"
241
                value="${xmlp}:${xalan}:${apis}:${jdbc}:${jsdk}:${cos}:${morpho}:${emlparser}:${jdbc-add1}:${jdbc-add2}:${util}:${httpclient}"/>
242

    
243
      <filter token="docrooturl" value="./" />
244
      <filter token="jdbc-connect" value="${jdbc-connect}"/>
245
      <filter token="dbDriver" value="${dbDriver}"/>
246
      <filter token="dbAdapter" value="${dbAdapter}"/>
247
      <filter token="install-dir" value="${installdir}"/>
248
      <filter token="temp-dir" value="${temp-dir}"/>
249
      <filter token="server" value="${server}"/>
250
      <filter token="systemidserver" value="${systemidserver}"/>
251
      <filter token="cgi-prefix" value="${cgi-prefix}"/>
252
      <filter token="ldapUrl" value="${ldapUrl}"/>
253
      <filter token="replication-log" value="${replication-log}"/>
254
      <filter token="replicationerrorlog" value="${replicationerrorlog}"/>
255
      <filter token="release" value="${release}"/>
256
      <filter token="servlet-path" value="${servlet-path}"/>
257
      <filter token="html-path" value="${html-path}"/>
258
      <filter token="user" value="${user}"/>
259
      <filter token="password" value="${password}"/>
260
      <filter token="mcuser" value="${mcuser}"/>
261
      <filter token="mcpassword" value="${mcpassword}"/>
262
      <filter token="mcanotheruser" value="${mcanotheruser}"/>
263
      <filter token="mcanotherpassword" value="${mcanotherpassword}"/>
264
      <filter token="knb-site-url" value="${knb-site-url}"/>
265
      <filter token="eml-css" value="${eml-css}"/>
266
      <filter token="style-skins-relpath" value="${style-skins-relpath}"/>
267
      <filter token="style-skins-path" value="${style-skins-path}"/>
268
      <filter token="style-common-relpath" value="${style-common-relpath}"/>
269
      <filter token="style-common-fullpath" value="${style-common-fullpath}"/>
270
      <filter token="style-common-path" value="${style-common-path}"/>
271
      <filter token="templates.dir" value="${templates.dir}"/>
272

    
273
      <!-- The "style-path" filter is used by the eml xsl stylesheets!!  -->
274
      <filter token="style-path" value="${style-skins-path}"/>
275
      <filter token="replication-path" value="${replication-path}"/>
276
      <filter token="harvester-registration-login-path" value="${harvester-registration-login-path}"/>
277
      <filter token="harvester-registration-path" value="${harvester-registration-path}"/>
278
      <filter token="config-dir" value="${config-dir}"/>
279
      <filter token="default-style" value="${default-style}"/>
280
      <filter token="eml-version" value="${eml-version}"/>
281
      <filter token="eml2_0_0namespace" value="${eml2_0_0namespace}"/>
282
      <filter token="eml2_0_1namespace" value="${eml2_0_1namespace}"/>
283
      <filter token="eml2_1_0namespace" value="${eml2_1_0namespace}"/>
284
      <filter token="stmmlnamespace" value="${stmmlnamespace}"/>
285
      <filter token="context" value="${context}"/>
286
      <filter token="forcereplicationwaitingtime" value="${forcereplicationwaitingtime}" />
287
      <filter token="debuglevel" value="${debuglevel}" />
288
      <filter token="datafilepath" value="${datafilepath}" />
289
      <filter token="inlinedatafilepath" value="${inlinedatafilepath}" />
290
      <filter token="defaultcontenttype" value="${defaultcontenttype}" />
291
      <filter token="debugprefix" value="${debugprefix}"/>
292
      <filter token="administrators" value="${administrators}"/>
293

    
294
      <filter token="defaultStage" value="${defaultStage}"/>
295
      <filter token="defaultHeader" value="${defaultHeader}"/>
296
      <filter token="defaultFooter" value="${defaultFooter}"/>
297
      <filter token="defaultChangePass" value="${defaultChangePass}"/>
298
      <filter token="defaultResetPass" value="${defaultResetPass}"/>
299
      <filter token="changePassSuccess" value="${changePassSuccess}"/>
300
      <filter token="resetPassSuccess" value="${resetPassSuccess}"/>
301
      <filter token="registerFailed" value="${registerFailed}"/>
302
      <filter token="registerLter" value="${registerLter}"/>
303
      <filter token="registerMatch" value="${registerMatch}"/>
304
      <filter token="registerSuccess" value="${registerSuccess}"/>
305
      <filter token="register" value="${register}"/>
306
      <filter token="searchResults" value="${searchResults}"/>
307

    
308
      <property name="srcdir" value="./src" />
309
      <property name="testdir" value="./test" />
310
      <property name="testtorun" value="BuildIndexTest" />
311
      <property name="junittestsdir" value="./test/edu/ucsb/nceas/metacattest" />
312
      <property name="junitnettestsdir" value="./test/edu/ucsb/nceas/metacatnettest" />
313
      <property name="build.dir" value="./build"/>
314
      <property name="build.src" value="${build.dir}/src"/>
315
      <property name="build.dest" value="${build.dir}/classes"/>
316
      <property name="build.docs" value="${build.dir}/docs"/>
317
      <property name="build.samples" value="${build.dir}/samples"/>
318
      <property name="build.tests" value="${build.dir}/tests"/>
319
      <property name="build.tmp" value="${build.dir}/tmp"/>
320
      <property name="build.metacattest" value="${build.tests}/metacattest"/>
321
      <property name="build.metacatnettest" value="${build.tests}/metacatnettest"/>
322
      <property name="build.data" value="${build.dir}/data"/>
323
      <property name="build.javadocs" value="${build.dir}/docs/api"/>
324
      <property name="build.war" value="${build.dir}/war"/>
325

    
326
      <property name="dist.dir" value="dist"/>
327
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
328
      <property name="ver.src" value="${ver.dir}/src"/>
329

    
330
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
331
      <condition property="utilities.required">
332
        <or>
333
          <not><available file="lib/httpclient.jar"/></not>
334
          <not><available file="lib/utilities.jar"/></not>
335
        </or>
336
      </condition>
337
      <condition property="eml.required">
338
        <or>
339
          <not><available file="lib/schema/eml-2.0.1/eml.xsd"/></not>
340
          <not><available file="lib/schema/eml-2.0.0/eml.xsd"/></not>
341
          <not><available file="lib/dtd/eml-dataset-2.0.0beta6.dtd"/></not>
342
        </or>
343
      </condition>
344
   </target>
345

    
346
   <target name="prepare" depends="init">
347
      <mkdir dir="${build.dir}"/>
348
      <mkdir dir="${build.src}"/>
349
      <mkdir dir="${build.dest}"/>
350
      <mkdir dir="${build.javadocs}"/>
351
      <mkdir dir="${build.tmp}"/>
352

    
353
      <copy todir="${build.src}" filtering="yes">
354
        <fileset dir="${srcdir}">
355
          <include name="edu/**"/>
356
          <include name="com/**"/>
357
          <include name="**/*.sql"/>
358
          <exclude name="**/CVS*"/>
359
          <exclude name="**/.#*"/>
360
        </fileset>
361
      </copy>
362
      <available file="lib/style/common/emlb6toeml2" type="dir"
363
                 property="styles.not.needed"/>
364
   </target>
365

    
366
   <target name="compile" depends="prepare,utilities"
367
    description="Compiles java code to build dir, and copies metacat props files there">
368

    
369
       <javac srcdir="${build.src}"
370
              destdir="${build.dest}"
371
              classpath="${cpath}"
372
              debug="${debug}"
373
              excludes="**/*.sql **/stringclient/** **/client/*.java **/harvesterClient/*.java"/>
374
   </target>
375

    
376
   <target name="jar" depends="compile,geteml"
377
    description="Compiles and jars metacat java code to metacat.jar in build dir">
378

    
379
       <delete file="${build.dir}/${name}.jar" />
380
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
381
            excludes="**/protocols/ **/harvesterClient/" />
382
   </target>
383

    
384
   <target name="protocol" depends="compile"
385
    description="Compiles and jars protocol java code to protocol.jar in build dir">
386
       <delete file="${build.dir}/protocol.jar" />
387
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
388
            includes="**/protocols/" />
389
   </target>
390

    
391
   <target name="utilities" depends="config" if="utilities.required">
392
     <ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
393
     <ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
394
     <copy file="${utilitiesdir}/lib/httpclient.jar" todir="lib" />
395
     <copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
396
   </target>
397

    
398
   <target name="client" depends="utilities, prepare"
399
    description="Compiles metacat-client java code to build dir">
400
       <javac srcdir="${build.src}"
401
              destdir="${build.dest}"
402
              classpath="${cpath}"
403
              includes="edu/ucsb/nceas/metacat/client/*" />
404
   </target>
405

    
406
   <target name="clientjar" depends="client"
407
    description="Compiles and jars metacat-client java code to metacat-client.jar in build dir">
408
       <delete file="${build.dir}/${name}-client.jar" />
409
       <jar jarfile="${build.dir}/${name}-client.jar" basedir="${build.dest}"
410
            includes="**/metacat/client/" />
411
   </target>
412

    
413
   <target name="harvester" depends="client"
414
           description="Compiles harvester java code to build dir">
415
       <echo message="classpath is:   ${cpath}"/>
416
       <javac srcdir="${build.src}"
417
              destdir="${build.dest}"
418
              classpath="${cpath}"
419
              includes="edu/ucsb/nceas/metacat/harvesterClient/*" />
420
   </target>
421

    
422
   <target name="harvesterjar" depends="harvester"
423
           description="Compiles and jars harvester java code to harvester.jar in build dir">
424
       <delete file="${build.dir}/harvester.jar" />
425
       <jar jarfile="${build.dir}/harvester.jar" basedir="${build.dest}"
426
            includes="**/metacat/harvesterClient/" />
427
   </target>
428

    
429
   <target  name="geteml" depends="getemlpre2,geteml2+" if="eml.required"
430
            description="Calls getemlpre2 and geteml2+ targets" />
431

    
432
   <target name="getemlpre2" depends="prepare" if="eml.required"
433
   description="Checks EML-beta6 out of cvs and copies dtds and xsl to your metacat cvs sandbox">
434
     <echo>Enter CVS password: </echo>
435
     <cvs cvsRoot="${cvsroot}"
436
          package="${eml-module}"
437
          tag="${eml-tag}"
438
          dest="${build.tmp}/eml_${eml-tag}" />
439
     <mkdir dir="lib/dtd" />
440
     <copy todir="lib/dtd" filtering="yes">
441
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}">
442
         <include name="*.dtd"/>
443
       </fileset>
444
       <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
445
     </copy>
446

    
447
     <copy todir="${style-common-cvsrelpath}" filtering="yes">
448
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}/style">
449
       <include name="**/*.xsl"/>
450
     </fileset>
451
     </copy>
452
   </target>
453

    
454
   <target name="geteml2+" depends="prepare" if="eml.required"
455
   description="Checks eml-2 out of cvs and copies schema and xsl to your metacat cvs sandbox">
456
     <echo>Enter CVS password: </echo>
457
     <cvs cvsRoot="${cvsroot}"
458
          package="${eml-module}"
459
          tag="${eml2_0_0-tag}"
460
          dest="${build.tmp}/eml_${eml2_0_0-tag}" />
461
     <mkdir dir="lib/schema/eml-2.0.0" />
462
     <copy todir="lib/schema/eml-2.0.0" filtering="yes">
463
       <fileset dir="${build.tmp}/eml_${eml2_0_0-tag}/${eml-module}">
464
         <include name="*.xsd"/>
465
       </fileset>
466

    
467
       <!-- shouldn't we have a mapper here like this??
468
       <mapper type="glob" from="eml-*.xsd" to="eml-*-${eml-version}.xsd" />
469

    
470
       Jing's code didn't nave one - does it need to be added?
471
       NOTE that eml-version is set to beta 6, so this would need changing -->
472

    
473
     </copy>
474
     <antcall target="copyxsl">
475
        <param name="cvs.tagname" value="${eml2_0_0-tag}" />
476
        <param name="dirname" value="eml-2.0.0" />
477
     </antcall>
478

    
479
     <echo>Enter CVS password: </echo>
480
     <cvs cvsRoot="${cvsroot}"
481
          package="${eml-module}"
482
          tag="${eml2_0_1-tag}"
483
          dest="${build.tmp}/eml_${eml2_0_1-tag}" />
484
     <mkdir dir="lib/schema/eml-2.0.1" />
485
     <copy todir="lib/schema/eml-2.0.1" filtering="yes">
486
       <fileset dir="${build.tmp}/eml_${eml2_0_1-tag}/${eml-module}">
487
         <include name="*.xsd"/>
488
       </fileset>
489
     </copy>
490
     <antcall target="copyxsl">
491
        <param name="cvs.tagname" value="${eml2_0_1-tag}" />
492
        <param name="dirname" value="eml-2.0.1" />
493
     </antcall>
494
   </target>
495

    
496

    
497

    
498
   <target  name="copyxsl"
499
   description="Copies xsl stylesheets from checkout in build/tmp to your metacat cvs sandbox">
500

    
501
     <delete file="${style-common-cvsrelpath}/${eml-css}"/>
502

    
503
     <copy todir="${style-common-cvsrelpath}/${dirname}" filtering="yes">
504
       <fileset dir="${build.tmp}/eml_${cvs.tagname}/${eml-module}/style/eml">
505
       <include name="**/*.xsl"/>
506
     </fileset>
507
     </copy>
508

    
509

    
510
     <!-- now copy default css from eml module and put it in style-common-path
511
          dir with a new name, so other skin-specific css can import it if reqd -->
512
     <copy file="${build.tmp}/eml_${cvs.tagname}/${eml-module}/${eml-module.default.css}"
513
           tofile="${style-common-cvsrelpath}/${eml-css}" />
514

    
515
   </target>
516

    
517

    
518

    
519
   <target name="register-schemas" depends="prepare"
520
   description="Registers the Schemas with a new Metacat instance">
521
     <echo/>
522
     <echo>Registering the Schemas with the new Metacat instance...</echo>
523
     <sql driver="${dbDriver}"
524
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
525
          url="${jdbc-connect}"
526
          userid="${user}"
527
          password="${password}"
528
          src="${build.src}/loaddtdschema.sql" />
529
   </target>
530

    
531
   <target name="installdb" depends="prepare"
532
            description="Installs the database tables">
533
     <echo/>
534
     <echo>Installing the database tables...</echo>
535
     <sql driver="${dbDriver}"
536
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
537
          url="${jdbc-connect}"
538
          userid="${user}"
539
          password="${password}"
540
          src="${build.src}/${install-sql}" />
541
   </target>
542

    
543
   <target name="upgrade12" depends="prepare"
544
            description="Updates the database tables to upgrade to version 1.2">
545
     <echo/>
546
     <echo>Updating the database tables to upgrade to version 1.2...</echo>
547
     <sql driver="${dbDriver}"
548
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
549
          url="${jdbc-connect}"
550
          userid="${user}"
551
          password="${password}"
552
          src="${build.src}/${upgrade-1.2-sql}" />
553
   </target>
554

    
555
   <target name="upgrade13" depends="prepare"
556
            description="Updates the database tables to upgrade to version 1.3">
557
     <echo/>
558
     <echo>Updating the database tables to upgrade to version 1.3...</echo>
559
     <sql driver="${dbDriver}"
560
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
561
          url="${jdbc-connect}"
562
          userid="${user}"
563
          password="${password}"
564
          src="${build.src}/${upgrade-1.3-sql}" />
565
   </target>
566

    
567
   <target name="upgrade14" depends="prepare"
568
            description="Updates the database tables to upgrade to version 1.4">
569
     <echo/>
570
     <echo>Updating the database tables to upgrade to version 1.4...</echo>
571
     <sql driver="${dbDriver}"
572
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
573
          url="${jdbc-connect}"
574
          userid="${user}"
575
          password="${password}"
576
          src="${build.src}/${upgrade-1.4-sql}" />
577
   </target>
578

    
579
   <target name="install" depends="war" description="* Full Install *">
580
       <mkdir dir="${datafilepath}" />
581
       <mkdir dir="${inlinedatafilepath}" />
582
       <chmod dir="${datafilepath}" perm="ug+w" />
583
       <mkdir dir="${temp-dir}"/>
584
       <chmod dir="${temp-dir}" perm="ug+w" />
585
       <copy file="${build.dir}/${context}.war" todir="${webapps}"/>
586
   </target>
587

    
588
   <target name="upgrade" depends="install"
589
          description="* Upgrade an existing metacat installation with a new version *">
590
       <unwar src="${webapps}/${context}.war" dest="${webapps}/${context}" />
591
   </target>
592

    
593
   <target name="install-registry" depends="init,getConversionXSL"
594
            description="Install Registry">
595

    
596
      <copy file="${srcdir}/perl/register-dataset.cgi"
597
            todir="${inst.cgi.dir}" filtering="yes"/>
598
      <chmod file="${inst.cgi.dir}/register-dataset.cgi" perm="ugo+x" />
599

    
600
      <mkdir dir="${temp-dir}" />
601
      <copy todir="${temp-dir}" filtering="yes">
602
       <fileset dir="lib/style/common/emlb6toeml2">
603
         <include name="*.xsl"/>
604
         <include name="*.xml"/>
605
       </fileset>
606
      </copy>
607

    
608
      <echo message="Install Registry completed." />
609
   </target>
610

    
611
   <target name="install-ldap" depends="init">
612
      <copy file="${srcdir}/perl/ldapweb.cgi"
613
            todir="${inst.cgi.dir}" filtering="yes"/>
614
      <chmod file="${inst.cgi.dir}/ldapweb.cgi" perm="ugo+x" />
615
      <copy file="lib/ldapweb.cfg"
616
            todir="${inst.cgi.dir}" filtering="yes"/>
617
      <chmod file="${inst.cgi.dir}/ldapweb.cfg" perm="ugo+x" />
618
      <mkdir dir="${templates.dir}" />
619
      <copy todir="${templates.dir}" filtering="yes">
620
        <fileset dir="lib/style/common/templates">
621
            <include name="${defaultChangePass}"/>
622
            <include name="${defaultResetPass}"/>
623
            <include name="${changePassSuccess}"/>
624
            <include name="${resetPassSuccess}"/>
625
            <include name="${registerFailed}"/>
626
            <include name="${registerLter}"/>
627
            <include name="${registerMatch}"/>
628
            <include name="${registerSuccess}"/>
629
            <include name="${register}"/>
630
            <include name="${searchResults}"/>
631
        </fileset>
632
      </copy>
633
      <echo message="ldapweb install complete." />
634
   </target>
635

    
636

    
637
   <target name="install-skin" depends="init"
638
            description="Install a Skin">
639

    
640
      <input message="Please enter name of the skin"
641
             addproperty="skin-name"/>
642

    
643
      <mkdir dir="${installdir}/style/skins/${skin-name}" />
644
      <copy todir="${installdir}/style/skins/${skin-name}" filtering="yes">
645
       <fileset dir="lib/style/skins/${skin-name}">
646
           <exclude name="*.png"/>
647
           <exclude name="*.gif"/>
648
           <exclude name="*.jpg"/>
649
           <exclude name="**/CVS*"/>
650
           <exclude name="**/.#*"/>
651
       </fileset>
652
      </copy>
653
     <copy todir="${installdir}/style/skins/${skin-name}" filtering="no">
654
       <fileset dir="lib/style/skins/${skin-name}">
655
           <include name="*.png"/>
656
           <include name="*.gif"/>
657
           <include name="*.jpg"/>
658
           <exclude name="**/CVS*"/>
659
           <exclude name="**/.#*"/>
660
       </fileset>
661
      </copy>
662
      <!--
663
      <mkdir dir="${installdir}/style/skins/${skin-name}/images" />
664
     <copy todir="${installdir}/style/skins/${skin-name}/images" filtering="no">
665
       <fileset dir="lib/style/skins/${skin-name}/images">
666
           <include name="*.png"/>
667
           <include name="*.gif"/>
668
           <include name="*.jpg"/>
669
       </fileset>
670
      </copy>
671
      -->
672

    
673
      <echo message="Install Skin completed." />
674
   </target>
675

    
676
   <target name="war" depends="warPrepare,warMSSQL"
677
            description="Create a web archive (WAR) for servlet deployment">
678
       <war destfile="${build.dir}/${context}.war"
679
            webxml="${build.war}/web.xml">
680
         <fileset dir="${war.context}"/>
681
         <lib dir="${war.lib}"/>
682
         <webinf dir="${war.webinf}"/>
683
       </war>
684
   </target>
685

    
686
   <target name="warPrepare" depends="jar,clientjar,harvesterjar"
687
            description="Prepare files for creating a web archive (WAR)">
688

    
689
       <property name="war.lib" value="${build.war}/lib" />
690
       <property name="war.webinf" value="${build.war}/WEB-INF" />
691
       <property name="war.context" value="${build.war}/${context}" />
692
       <mkdir dir="${war.lib}" />
693
       <mkdir dir="${war.webinf}" />
694
       <mkdir dir="${war.context}" />
695

    
696
       <copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
697
       <copy file="${build.dir}/${name}-client.jar" todir="${war.lib}" />
698
       <copy file="${build.dir}/harvester.jar" todir="${war.lib}" />
699
       <copy todir="${war.lib}" filtering="no">
700
         <fileset dir="lib">
701
           <include name="*.jar"/>
702
         </fileset>
703
         <fileset dir="lib/xalan">
704
           <include name="*.jar"/>
705
         </fileset>
706
       </copy>
707
       <copy file="${jdbc}" tofile="${war.lib}/jdbc.jar" />
708
       <copy file="lib/web.xml.${tomcatversion}"
709
             tofile="${build.war}/web.xml" />
710
       <copy file="lib/metacat.properties" todir="${war.webinf}"
711
             filtering="yes" />
712
       <copy todir="${war.context}" filtering="no">
713
         <fileset dir="lib">
714
           <include name="**/*.jpg"/>
715
           <include name="**/*.png"/>
716
           <include name="**/*.gif"/>
717
         </fileset>
718
       </copy>
719
       <copy todir="${war.context}" filtering="yes">
720
         <fileset dir="lib">
721
           <exclude name="*.jar"/>
722
           <exclude name="*.properties"/>
723
           <exclude name="web.xml"/>
724
           <exclude name="**/*.jpg"/>
725
           <exclude name="**/*.png"/>
726
           <exclude name="**/*.gif"/>
727
         </fileset>
728
       </copy>
729
       <copy todir="${war.context}" filtering="no">
730
         <fileset dir="lib">
731
           <include name="**/*.jpg"/>
732
           <include name="**/*.png"/>
733
           <include name="**/*.gif"/>
734
         </fileset>
735
       </copy>
736
   </target>
737

    
738
   <target name="warMSSQL" if="MSSQL" depends="warPrepare">
739
      <copy file="${jdbc-add1}" tofile="${war.lib}/msutil.jar" />
740
       <copy file="${jdbc-add2}" tofile="${war.lib}/mssqlserver.jar" />
741
   </target>
742

    
743
   <target name="getConversionXSL" depends="prepare"
744
            unless="styles.not.needed"
745
            description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
746
     <echo>Enter CVS password: </echo>
747
     <cvs cvsRoot="${cvsroot-alternate}"
748
          package="${conversion-module}"
749
          dest="${build.tmp}" />
750

    
751
     <mkdir dir="lib/style/common/emlb6toeml2" />
752
      <copy todir="lib/style/common/emlb6toeml2" filtering="yes">
753
       <fileset dir="${build.tmp}/${conversion-module}/lib/style">
754
         <include name="*.xsl"/>
755
         <include name="*.xml"/>
756
       </fileset>
757
      </copy>
758
   </target>
759

    
760
   <target name="testprep" depends="jar,clientjar,harvesterjar">
761
      <mkdir dir="${build.tests}"/>
762
      <copy todir="${build.tests}" filtering="yes">
763
        <fileset dir="${testdir}">
764
          <include name="edu/**"/>
765
        </fileset>
766
      </copy>
767
      <!-- copy and compile the tests into a jar file -->
768
      <javac srcdir="${build.tests}"
769
             destdir="${build.tests}"
770
             classpath="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/harvester.jar"
771
             debug="on"
772
       includes="**/*.java" />
773

    
774
      <jar jarfile="${build.dir}/${name}-junittests.jar"
775
        basedir="${build.tests}"
776
                includes="**/*.class" />
777
   </target>
778

    
779
   <target name="test" depends="testprep"
780
            description="Uses the ant junit task to run all JUnit tests">
781

    
782
      <!-- use the ant "junit" task to run JUnit tests. -->
783
      <junit printsummary="yes" haltonfailure="no" fork="yes"
784
             haltonerror="no">
785
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
786
        <classpath>
787
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/${name}-junittests.jar" />
788
        </classpath>
789

    
790
        <formatter type="plain" />
791

    
792
        <batchtest fork="yes" todir="${build.dir}">
793
          <fileset dir="${build.tests}">
794
            <include name="**/*.class" />
795
          </fileset>
796
        </batchtest>
797
     </junit>
798
   </target>
799

    
800
    <target name="runonetest" depends="testprep"
801
            description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
802

    
803
              <echo>testtorun: ${testtorun}</echo>
804

    
805
      <!-- use the ant "junit" task to run JUnit tests. -->
806
      <junit printsummary="yes" haltonfailure="no" fork="yes"
807
             haltonerror="no">
808
        <!--<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>-->
809
        <classpath>
810
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/${name}-junittests.jar" />
811
        </classpath>
812

    
813
        <formatter type="plain" />
814

    
815
        <batchtest fork="yes" todir="${build.dir}">
816
          <fileset dir="${build.tests}">
817
            <include name="**/${testtorun}.class" />
818
          </fileset>
819
        </batchtest>
820
     </junit>
821
   </target>
822

    
823
   <target name="testharvester"
824
           depends="testprep"
825
           description="Uses the ant junit task to test only the Harvester code">
826
     <junit printsummary="yes"
827
            haltonfailure="off"
828
            fork="yes"
829
            haltonerror="off">
830
       <classpath>
831
         <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/harvester.jar:${build.dir}/${name}-junittests.jar" />
832
       </classpath>
833
       <formatter type="plain" />
834
       <batchtest fork="yes" todir="${build.dir}">
835
         <fileset dir="${build.tests}">
836
           <include name="**/harvesterClient/*.class" />
837
         </fileset>
838
       </batchtest>
839
     </junit>
840
   </target>
841

    
842
  <target name="gethttpclient" depends="prepare"
843
            description="checks out and compiles morpho httpclient code">
844
  <!--mkdir dir="${morphosourcedir}" -->
845
        <cvs cvsRoot="${cvsroot}"
846
             package="morpho"
847
             dest="." />
848
        <ant dir="${morphosourcedir}" inheritAll="false"  target="jar" />
849
   </target>
850

    
851
   <!-- run this target, we need to check out a another morpho souce dir was checked out. -->
852
   <target name="nettest" depends="install"
853
            description="compiles and runs the metacatnettest code">
854

    
855
      <echo>***********************************
856
      Please run ant gethttpclient first!
857
      ***********************************
858
      </echo>
859
      <!-- copy and compile the tests into a jar file -->
860
      <mkdir dir="${build.metacatnettest}"/>
861
      <javac srcdir="${junitnettestsdir}"
862
             destdir="${build.metacatnettest}"
863
             classpath="${cpath}:${build.dir}/${name}.jar:${httpclient}"
864
             includes="**/*.java" />
865

    
866
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
867
                    basedir="${build.metacatnettest}"
868
                    includes="**/*.class" />
869

    
870
      <!-- use the ant "junit" task to run JUnit tests. -->
871
      <junit printsummary="yes" haltonfailure="no" fork="yes"
872
             haltonerror="no">
873
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
874
        <classpath>
875
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${httpclient}:${build.dir}/${name}-junitnettests.jar:${itislib}" />
876
        </classpath>
877

    
878
        <formatter type="plain" />
879

    
880
        <batchtest fork="yes" todir="${build.dir}">
881
          <fileset dir="${build.metacatnettest}">
882
            <include name="**/*.class" />
883
          </fileset>
884
        </batchtest>
885
     </junit>
886
   </target>
887

    
888
   <target name="cleanweb" depends="clean"
889
            description="deletes tomcat web context dir and all its contents">
890
     <delete dir="${installdir}" />
891
   </target>
892

    
893

    
894
   <target name="clean" depends="init"
895
            description="deletes build dir and files that can be regenerated form the release">
896
       <delete dir="${build.dir}" />
897
   </target>
898

    
899
   <target name="fullclean" depends="clean"
900
            description="deletes even jars that depend on external sources such as stylesheets and jars">
901
       <delete file="lib/httpclient.jar" />
902
       <delete file="lib/utilities.jar" />
903
       <delete includeEmptyDirs="true" failonerror="false">
904
         <fileset dir="${style-common-cvsrelpath}">
905
           <include name="${eml-css}" />
906
           <include name="eml-*/*.xsl" />
907
           <include name="eml-*" />
908
         </fileset>
909
       </delete>
910
   </target>
911

    
912
   <target name="jdoc" depends="prepare"
913
            description="generates javadoc documentation">
914
       <javadoc packagenames="edu.ucsb.nceas.*"
915
           sourcepath="${build.src}"
916
           destdir="${build.javadocs}"
917
           classpath="${cpath}"
918
           author="true"
919
           version="true"
920
           use="true"
921
           windowtitle="${Name} API"
922
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
923
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;"
924
       />
925
   </target>
926

    
927
   <target name="dist" depends="geteml,jar,protocol,jdoc"
928
            description="prepares a full release distribution">
929
      <mkdir dir="${dist.dir}"/>
930
      <delete dir="${ver.dir}" />
931
      <mkdir dir="${ver.dir}"/>
932
      <copy todir="${ver.dir}">
933
        <fileset dir="."
934
            excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/**"/>
935
      </copy>
936
      <copy todir="${ver.dir}" file="build.xml"/>
937
      <copy todir="${ver.dir}" file="build.properties"/>
938

    
939
      <copy todir="${ver.dir}/docs" filtering="yes">
940
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
941
      </copy>
942
      <copy todir="${ver.dir}/docs" filtering="no">
943
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
944
      </copy>
945
      <copy todir="${ver.dir}/docs/dev">
946
        <fileset dir="${build.dir}/docs"/>
947
      </copy>
948
      <copy todir="${ver.dir}/src">
949
        <fileset dir="${build.dir}/src"/>
950
      </copy>
951

    
952
      <!--
953
      <delete dir="./${ver.dir}/${build.dir}"/>
954
      <delete dir="./${ver.dir}/dist"/>
955
      -->
956
      <delete file="./${name}-${release}.zip"/>
957
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
958
      <delete file="./${name}-${release}.tar.gz" />
959
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
960
      <gzip zipfile="./${name}-${release}.tar.gz"
961
                src="./${name}-${release}.tar"/>
962
      <delete file="./${name}-${release}.tar" />
963
  </target>
964

    
965
  <target name="distsrc" depends="dist"
966
            description="prepares a source distribution">
967
      <mkdir dir="${ver.src}"/>
968
      <copy todir="${ver.src}">
969
        <fileset dir="./src"/>
970
      </copy>
971

    
972
      <delete file="./${name}-src-${release}.zip"/>
973
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
974
      <delete file="./${name}-src-${release}.tar.gz" />
975
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
976
      <gzip zipfile="./${name}-src-${release}.tar.gz"
977
                src="./${name}-src-${release}.tar"/>
978
      <delete file="./${name}-src-${release}.tar" />
979
      <delete dir="${dist.dir}"/>
980
  </target>
981

    
982
   <target name="stylesheettest">
983
     <xslt in="${input}" out="eml.html" style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
984
      <param name="displaymodule" expression="${displaymodule}"/>
985
      <param name="docid" expression="${input}"/>
986
      <param name="entitytype" expression="${entitytype}"/>
987
      <param name="entityindex" expression="${entityindex}"/>
988
      <outputproperty name="method" value="html"/>
989
      <outputproperty name="standalone" value="yes"/>
990
      <outputproperty name="encoding" value="iso8859_1"/>
991
      <outputproperty name="indent" value="yes"/>
992
    </xslt>
993
  </target>
994

    
995
 <target name="gridinit" depends="init">
996
   <property name="java2wsdl.tool" value="org.apache.axis.wsdl.Java2WSDL" />
997
   <property name="wsdldecorator.tool" value="org.globus.ogsa.tools.wsdl.DecorateWSDL" />
998
   <property name="wsdl.tool" value="org.globus.ogsa.tools.wsdl.GSDL2Java"/>
999
   <property environment="env"/>
1000
   <property name="binding.file" value="${env.GLOBUS_LOCATION}/schema/ogsi/ogsi_bindings.wsdl"/>
1001
    <path id="webservicepath">
1002
        <pathelement location="."/>
1003
        <pathelement location="${env.JAVA_HOME}/../lib/tools.jar"/>
1004
        <pathelement location="${build.dest}"/>
1005
        <fileset dir="${env.GLOBUS_LOCATION}/lib">
1006
           <include name="*.jar"/>
1007
        </fileset>
1008
      </path>
1009
</target>
1010

    
1011
 <target name="gridprepare" depends="gridinit, prepare">
1012
 </target>
1013

    
1014
  <target name="compileinterface" depends="clean, gridprepare">
1015
    <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/${interface.name}.java" />
1016
  </target>
1017

    
1018
  <target name="generateWSDL" depends="compileinterface">
1019
    <echo message="Generating wsdl from ${interface.name} interface"/>
1020
    <java classname="${java2wsdl.tool}"
1021
          dir="${build.src}" fork="yes"
1022
          classpathref="webservicepath"  failonerror="true" >
1023
      <arg value="-P"/>
1024
      <arg value="${interface.name}PortType"/>
1025
      <arg value="-S"/>
1026
      <arg value="${interface.name}Service"/>
1027
      <arg value="-y"/>
1028
      <arg value="WRAPPED"/>
1029
      <arg value="-u"/>
1030
      <arg value="LITERAL"/>
1031
      <arg value="-l"/>
1032
      <arg value="http://localhost/ogsa/services/${interface.name}Service"/>
1033
      <arg value="-n"/>
1034
      <arg value="http://${services.namespace}/${interface.name}"/>
1035
      <arg value="${interface.package}.${interface.name}"/>
1036
    </java>
1037
  </target>
1038

    
1039
   <target name="decorateWSDL" depends="generateWSDL">
1040
      <property name="wsdl.file" value="${interface.name}Service.wsdl"/>
1041
      <java classname="${wsdldecorator.tool}" dir="${build.src}"
1042
            fork="yes"
1043
            classpathref="webservicepath" failonerror="true" >
1044
        <arg value="${binding.file}"/>
1045
        <arg value="${wsdl.file}"/>
1046
      </java>
1047
   </target>
1048

    
1049
   <target name="generatestubs" depends="decorateWSDL">
1050
      <echo message=" Generating stubs " />
1051
      <echo message="wsdl file is ${wsdl.file}"/>
1052
      <echo message="build.src is ${build.src}"/>
1053
      <java classname="${wsdl.tool}" dir="${build.src}" fork="yes"
1054
            classpathref="webservicepath" failonerror="true" >
1055
         <arg value="${wsdl.file}"/>
1056
    </java>
1057
  </target>
1058

    
1059
  <target name="compileStubsAndImpl" depends="generatestubs, utilities">
1060
     <echo message=" Compiling stubs " />
1061
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" includes="**/${interface.name}/*.java" />
1062
     <echo message=" Compiling impl " />
1063
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" classpath="./lib/utilities.jar" includes="**/impl/*.java" />
1064
  </target>
1065

    
1066
  <target name="jarStubsAndImpl" depends="compileStubsAndImpl">
1067
     <echo message=" jar stubs classes " />
1068
     <jar destfile="${build.dir}/${interface.name}-stubs.jar" basedir="${build.dest}" includes="**/${interface.name}/*.class" />
1069
     <echo message=" jar impl classes " />
1070
     <jar destfile="${build.dir}/${interface.name}.jar" basedir="${build.dest}" includes="**/impl/*.class" />
1071
  </target>
1072

    
1073
  <target name="gar" depends="jarStubsAndImpl">
1074
     <echo message=" jar the gar file"/>
1075
     <mkdir dir="${build.dir}/gar"/>
1076
     <mkdir dir="${build.dir}/gar/schema/edu"/>
1077
     <copy file="${build.dir}/${interface.name}.jar" todir="${build.dir}/gar" />
1078
     <copy file="${build.dir}/${interface.name}-stubs.jar" todir="${build.dir}/gar" />
1079
     <copy file="lib/utilities.jar" todir="${build.dir}/gar" />
1080
     <copy file="lib/server-deploy.wsdd" todir="${build.dir}/gar" />
1081
     <copy file="${build.src}/${interface.name}Service.wsdl" todir="${build.dir}/gar/schema/edu" />
1082
     <jar destfile="lib/${interface.name}.gar" basedir="${build.dir}/gar"/>
1083
  </target>
1084

    
1085
  <target name="compilewebclient" depends="prepare">
1086
     <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/application/*.java" classpathref="webservicepath" />
1087
  </target>
1088

    
1089
  <target name="runwebclient" depends="compilewebclient">
1090
     <java classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
1091
           dir="${build.dest}" fork="yes"
1092
           classpathref="webservicepath" classpath="./lib/utilities.jar" failonerror="true">
1093
         <arg value="${serviceUrl}"/>
1094
         <arg value="${docid}"/>
1095
     </java>
1096
  </target>
1097
</project>
(5-5/5)