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: brooke $'
|
10
|
* '$Date: 2003-11-21 15:45:47 -0800 (Fri, 21 Nov 2003) $'
|
11
|
* '$Revision: 1930 $'
|
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
|
|
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
|
</target>
|
57
|
|
58
|
<target name="postgresql" if="use-postgresql">
|
59
|
<!-- Customize these properties if you are using postgres -->
|
60
|
<echo message="Using PostgreSQL..."/>
|
61
|
<property name="dbDriver" value="org.postgresql.Driver"/>
|
62
|
<property name="dbAdapter"
|
63
|
value="edu.ucsb.nceas.dbadapter.PostgresqlAdapter"/>
|
64
|
<property name="jdbc" value="lib/jdbc7.1-1.2.jar" />
|
65
|
<!-- Property to indicate is not MSSQL installation-->
|
66
|
<property name="other" value="yes"/>
|
67
|
</target>
|
68
|
|
69
|
<target name="sqlserver" if="use-sqlserver">
|
70
|
<!-- Customize these properties if you are using SQL server -->
|
71
|
<echo message="Using SQL Server..."/>
|
72
|
<property name="dbDriver" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
|
73
|
<property name="dbAdapter"
|
74
|
value="edu.ucsb.nceas.dbadapter.SqlserverAdapter"/>
|
75
|
<property name="jdbc" value="${jdbc-base}/msbase.jar" />
|
76
|
<property name="jdbc-add1" value="${jdbc-base}/msutil.jar" />
|
77
|
<property name="jdbc-add2" value="${jdbc-base}/mssqlserver.jar" />
|
78
|
<!-- Property to indicate is a MSSQL installation-->
|
79
|
<property name="MSSQL" value="yes"/>
|
80
|
</target>
|
81
|
|
82
|
<target name="config" depends="check-db,oracle,postgresql,sqlserver">
|
83
|
<!-- usr for client testing, generally you don't need change-->
|
84
|
<property name="mcuser" value="uid=tao,o=NCEAS,dc=ecoinformatics,dc=org"/>
|
85
|
<property name="mcpassword" value=""/>
|
86
|
<property name="mcanotheruser" value="uid=jtao,o=LTER,dc=ecoinformatics,dc=org"/>
|
87
|
<property name="mcanotherpassword" value=""/>
|
88
|
|
89
|
<property name="debug" value="on" />
|
90
|
<property name="debuglevel" value="55" />
|
91
|
|
92
|
<property name="morphosourcedir" value="../morpho" />
|
93
|
<property name="defaultcontenttype" value="application/octet-stream" />
|
94
|
<property name="utilitiesdir" value="../utilities" />
|
95
|
|
96
|
<!-- Make sure these paths match the location of the jar files
|
97
|
on your system, the defaults should usually work -->
|
98
|
<property name="jsdk"
|
99
|
value="${tomcat}/common/lib/servlet.jar" />
|
100
|
<property name="xmlp"
|
101
|
value="lib/xercesImpl.jar" />
|
102
|
<property name="cos"
|
103
|
value="lib/cos.jar" />
|
104
|
<property name="morpho"
|
105
|
value="lib/morpho.jar" />
|
106
|
<property name="xalan"
|
107
|
value="lib/xalan/xalan.jar" />
|
108
|
<property name="apis"
|
109
|
value="lib/xalan/xml-apis.jar" />
|
110
|
<property name="httpclient"
|
111
|
value="lib/httpclient.jar" />
|
112
|
<property name="emlparser"
|
113
|
value="lib/eml.jar" />
|
114
|
<property name="configxml"
|
115
|
value="lib/configxml.jar" />
|
116
|
<property name="itislib"
|
117
|
value="lib/itislib.jar" />
|
118
|
<property name="emlparser"
|
119
|
value="lib/eml.jar" />
|
120
|
<property name="util"
|
121
|
value="lib/utilities.jar" />
|
122
|
<property name="srb"
|
123
|
value="lib/srbrmi" />
|
124
|
</target>
|
125
|
|
126
|
<target name="init" depends="config">
|
127
|
<!-- It is less likely you'll need to make any changes from here down,
|
128
|
but customization is possible -->
|
129
|
<property name="installdir" value="${webapps}/${context}" />
|
130
|
<property name="temp-dir" value="/tmp/${context}" />
|
131
|
<property name="name" value="metacat"/>
|
132
|
<property name="Name" value="MetaCat"/>
|
133
|
<property name="debugprefix" value="${Name}:"/>
|
134
|
<property name="release" value="1.2.1"/>
|
135
|
<property name="replication-path" value="/${context}/servlet/replication"/>
|
136
|
<property name="servlet-path" value="/${context}/servlet/metacat"/>
|
137
|
<property name="html-path" value="/${context}"/>
|
138
|
<property name="systemidserver" value="http://${server}"/>
|
139
|
|
140
|
<property name="style-common-relpath" value="/style/common"/>
|
141
|
<property name="style-common-fullpath"
|
142
|
value="/${installdir}${style-common-relpath}"/>
|
143
|
<property name="style-common-path"
|
144
|
value="/${context}${style-common-relpath}"/>
|
145
|
<property name="style-skins-relpath" value="/style/skins"/>
|
146
|
<property name="style-skins-path" value="/${context}${style-skins-relpath}"/>
|
147
|
<property name="replication-log" value="/tmp/metacatreplication.log"/>
|
148
|
<property name="replicationerrorlog" value="/tmp/metacatreplication.err"/>
|
149
|
<property name="config-dir" value="${webapps}/${style-skins-path}" />
|
150
|
<property name="eml-module" value="eml" />
|
151
|
<property name="eml-version" value="2.0.0beta6" />
|
152
|
<property name="eml-tag" value="EML_2_0_0_BETA_6_FOR_METACAT" />
|
153
|
<property name="eml2-tag" value="EML_2_0_0_FOR_METACAT" />
|
154
|
<property name="eml2namespace" value="eml://ecoinformatics.org/eml-2.0.0" />
|
155
|
<property name="stmmlnamespace" value="http://www.xml-cml.org/schema/stmml" />
|
156
|
<property name="conversion-module" value="webmdentry" />
|
157
|
|
158
|
<!-- Config for registry variables -->
|
159
|
<property name="scope" value="obfs"/>
|
160
|
<property name="responseForm" value="genericResponse.tmpl"/>
|
161
|
<property name="entryForm" value="entryForm.tmpl"/>
|
162
|
<property name="guide" value="genericGuide.tmpl"/>
|
163
|
<property name="confirmData" value="confirmData.tmpl"/>
|
164
|
<property name="deleteData" value="deleteData.tmpl"/>
|
165
|
<property name="genericHeader" value="genericHeader.tmpl"/>
|
166
|
<property name="genericFooter" value="genericFooter.tmpl"/>
|
167
|
<property name="adminname" value="KNB Support"/>
|
168
|
<property name="recipient" value="knb-software\@nceas.ucsb.edu"/>
|
169
|
<filter token="scope" value="${scope}"/>
|
170
|
<filter token="responseForm" value="${responseForm}"/>
|
171
|
<filter token="entryForm" value="${entryForm}"/>
|
172
|
<filter token="guide" value="${guide}"/>
|
173
|
<filter token="confirmData" value="${confirmData}"/>
|
174
|
<filter token="deleteData" value="${deleteData}"/>
|
175
|
<filter token="genericHeader" value="${genericHeader}"/>
|
176
|
<filter token="genericFooter" value="${genericFooter}"/>
|
177
|
<filter token="adminname" value="${adminname}"/>
|
178
|
<filter token="recipient" value="${recipient}"/>
|
179
|
|
180
|
<property name="cpath"
|
181
|
value="${xmlp}:${xalan}:${apis}:${jdbc}:${jsdk}:${srb}:${cos}:${morpho}:${emlparser}:${jdbc-add1}:${jdbc-add2}:${util}:${httpclient}"/>
|
182
|
|
183
|
<filter token="docrooturl" value="./" />
|
184
|
<filter token="jdbc-connect" value="${jdbc-connect}"/>
|
185
|
<filter token="dbDriver" value="${dbDriver}"/>
|
186
|
<filter token="dbAdapter" value="${dbAdapter}"/>
|
187
|
<filter token="install-dir" value="${installdir}"/>
|
188
|
<filter token="temp-dir" value="${temp-dir}"/>
|
189
|
<filter token="server" value="${server}"/>
|
190
|
<filter token="systemidserver" value="${systemidserver}"/>
|
191
|
<filter token="cgi-prefix" value="${cgi-prefix}"/>
|
192
|
<filter token="ldapUrl" value="${ldapUrl}"/>
|
193
|
<filter token="replication-log" value="${replication-log}"/>
|
194
|
<filter token="replicationerrorlog" value="${replicationerrorlog}"/>
|
195
|
<filter token="release" value="${release}"/>
|
196
|
<filter token="servlet-path" value="${servlet-path}"/>
|
197
|
<filter token="html-path" value="${html-path}"/>
|
198
|
<filter token="user" value="${user}"/>
|
199
|
<filter token="password" value="${password}"/>
|
200
|
<filter token="mcuser" value="${mcuser}"/>
|
201
|
<filter token="mcpassword" value="${mcpassword}"/>
|
202
|
<filter token="mcanotheruser" value="${mcanotheruser}"/>
|
203
|
<filter token="mcanotherpassword" value="${mcanotherpassword}"/>
|
204
|
<filter token="knb-site-url" value="${knb-site-url}"/>
|
205
|
<filter token="style-skins-relpath" value="${style-skins-relpath}"/>
|
206
|
<filter token="style-skins-path" value="${style-skins-path}"/>
|
207
|
<filter token="style-common-relpath" value="${style-common-relpath}"/>
|
208
|
<filter token="style-common-fullpath" value="${style-common-fullpath}"/>
|
209
|
<filter token="style-common-path" value="${style-common-path}"/>
|
210
|
<!-- The "style-path" filter is used by the eml xsl stylesheets!! -->
|
211
|
<filter token="style-path" value="${style-skins-path}"/>
|
212
|
<filter token="replication-path" value="${replication-path}"/>
|
213
|
<filter token="config-dir" value="${config-dir}"/>
|
214
|
<filter token="default-style" value="${default-style}"/>
|
215
|
<filter token="eml-version" value="${eml-version}"/>
|
216
|
<filter token="eml2namespace" value="${eml2namespace}"/>
|
217
|
<filter token="stmmlnamespace" value="${stmmlnamespace}"/>
|
218
|
<filter token="context" value="${context}"/>
|
219
|
<filter token="forcereplicationwaitingtime" value="${forcereplicationwaitingtime}" />
|
220
|
<filter token="debuglevel" value="${debuglevel}" />
|
221
|
<filter token="datafilepath" value="${datafilepath}" />
|
222
|
<filter token="inlinedatafilepath" value="${inlinedatafilepath}" />
|
223
|
<filter token="defaultcontenttype" value="${defaultcontenttype}" />
|
224
|
<filter token="debugprefix" value="${debugprefix}"/>
|
225
|
|
226
|
<property name="srcdir" value="./src" />
|
227
|
<property name="testdir" value="./test" />
|
228
|
<property name="testtorun" value="MetacatClientTest" />
|
229
|
<property name="junittestsdir" value="./test/edu/ucsb/nceas/metacattest" />
|
230
|
<property name="junitnettestsdir" value="./test/edu/ucsb/nceas/metacatnettest" />
|
231
|
<property name="build.dir" value="./build"/>
|
232
|
<property name="build.src" value="${build.dir}/src"/>
|
233
|
<property name="build.dest" value="${build.dir}/classes"/>
|
234
|
<property name="build.docs" value="${build.dir}/docs"/>
|
235
|
<property name="build.samples" value="${build.dir}/samples"/>
|
236
|
<property name="build.tests" value="${build.dir}/tests"/>
|
237
|
<property name="build.tmp" value="${build.dir}/tmp"/>
|
238
|
<property name="build.metacattest" value="${build.tests}/metacattest"/>
|
239
|
<property name="build.metacatnettest" value="${build.tests}/metacatnettest"/>
|
240
|
<property name="build.data" value="${build.dir}/data"/>
|
241
|
<property name="build.javadocs" value="${build.dir}/docs/api"/>
|
242
|
|
243
|
<property name="dist.dir" value="dist"/>
|
244
|
<property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
|
245
|
<property name="ver.src" value="${ver.dir}/src"/>
|
246
|
|
247
|
<property name="package.home" value="edu/ucsb/nceas/metacat" />
|
248
|
</target>
|
249
|
|
250
|
<target name="prepare" depends="init">
|
251
|
<mkdir dir="${build.dir}"/>
|
252
|
<mkdir dir="${build.src}"/>
|
253
|
<mkdir dir="${build.dest}"/>
|
254
|
<mkdir dir="${build.javadocs}"/>
|
255
|
<mkdir dir="${build.tmp}"/>
|
256
|
|
257
|
<copy todir="${build.src}" filtering="yes">
|
258
|
<fileset dir="${srcdir}">
|
259
|
<include name="edu/**"/>
|
260
|
<include name="com/**"/>
|
261
|
<include name="**/*.sql"/>
|
262
|
<exclude name="**/CVS*"/>
|
263
|
<exclude name="**/.#*"/>
|
264
|
<exclude name="edu/ucsb/nceas/metacat/harvesterClient/*.*"/>
|
265
|
</fileset>
|
266
|
</copy>
|
267
|
</target>
|
268
|
|
269
|
<target name="compile" depends="prepare,utilities">
|
270
|
<javac srcdir="${build.src}"
|
271
|
destdir="${build.dest}"
|
272
|
classpath="${cpath}"
|
273
|
debug="${debug}"
|
274
|
excludes="**/*.sql **/stringclient/** **/client/*.java"/>
|
275
|
<copy file="lib/metacat.properties"
|
276
|
tofile="${build.dest}/${package.home}/metacat.properties"
|
277
|
filtering="yes" />
|
278
|
<copy file="lib/srbProps.properties"
|
279
|
tofile="${build.dest}/${package.home}/srbProps.properties"/>
|
280
|
</target>
|
281
|
|
282
|
<target name="jar" depends="compile">
|
283
|
<delete file="${build.dir}/${name}.jar" />
|
284
|
<copy todir="${build.dest}">
|
285
|
<fileset dir="lib/srbrmi"/>
|
286
|
</copy>
|
287
|
<jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
|
288
|
excludes="**/protocols/" />
|
289
|
</target>
|
290
|
|
291
|
<target name="protocol" depends="compile">
|
292
|
<delete file="${build.dir}/protocol.jar" />
|
293
|
<jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
|
294
|
includes="**/protocols/" />
|
295
|
</target>
|
296
|
|
297
|
<target name="utilities" depends="config">
|
298
|
<ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
|
299
|
<ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
|
300
|
<copy file="${utilitiesdir}/lib/httpclient.jar" todir="lib" />
|
301
|
<copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
|
302
|
</target>
|
303
|
|
304
|
<target name="client" depends="utilities, prepare">
|
305
|
<javac srcdir="${build.src}"
|
306
|
destdir="${build.dest}"
|
307
|
classpath="${cpath}"
|
308
|
includes="edu/ucsb/nceas/metacat/client/*" />
|
309
|
</target>
|
310
|
|
311
|
<target name="clientjar" depends="client">
|
312
|
<delete file="${build.dir}/${name}-client.jar" />
|
313
|
<jar jarfile="${build.dir}/${name}-client.jar" basedir="${build.dest}"
|
314
|
includes="**/metacat/client/" />
|
315
|
</target>
|
316
|
|
317
|
<target name="getdtdschema" depends="prepare">
|
318
|
<echo>Enter CVS password: </echo>
|
319
|
<cvs cvsRoot="${cvsroot}"
|
320
|
package="${eml-module}"
|
321
|
tag="${eml-tag}"
|
322
|
dest="${build.tmp}" />
|
323
|
<mkdir dir="lib/dtd" />
|
324
|
<copy todir="lib/dtd" filtering="yes">
|
325
|
<fileset dir="${build.tmp}/${eml-module}">
|
326
|
<include name="*.dtd"/>
|
327
|
</fileset>
|
328
|
<mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
|
329
|
</copy>
|
330
|
<copy todir="lib/style/common" filtering="yes">
|
331
|
<fileset dir="${build.tmp}/${eml-module}/style">
|
332
|
<include name="**/*.xsl"/>
|
333
|
</fileset>
|
334
|
</copy> <echo>Enter CVS password: </echo>
|
335
|
<cvs cvsRoot="${cvsroot}"
|
336
|
package="${eml-module}"
|
337
|
tag="${eml2-tag}"
|
338
|
dest="${build.tmp}" />
|
339
|
<mkdir dir="lib/schema" />
|
340
|
<copy todir="lib/schema" filtering="yes">
|
341
|
<fileset dir="${build.tmp}/${eml-module}">
|
342
|
<include name="*.xsd"/>
|
343
|
</fileset>
|
344
|
</copy>
|
345
|
<copy todir="lib/style/common" filtering="yes">
|
346
|
<fileset dir="${build.tmp}/${eml-module}/style">
|
347
|
<include name="**/*.xsl"/>
|
348
|
</fileset>
|
349
|
</copy>
|
350
|
</target>
|
351
|
|
352
|
<target name="getdtd" depends="prepare">
|
353
|
<echo>Enter CVS password: </echo>
|
354
|
<cvs cvsRoot="${cvsroot}"
|
355
|
package="${eml-module}"
|
356
|
tag="${eml-tag}"
|
357
|
dest="${build.tmp}" />
|
358
|
<mkdir dir="lib/dtd" />
|
359
|
<copy todir="lib/dtd" filtering="yes">
|
360
|
<fileset dir="${build.tmp}/${eml-module}">
|
361
|
<include name="*.dtd"/>
|
362
|
</fileset>
|
363
|
<mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
|
364
|
</copy>
|
365
|
</target>
|
366
|
|
367
|
<target name="getschema" depends="prepare">
|
368
|
<echo>Enter CVS password: </echo>
|
369
|
<cvs cvsRoot="${cvsroot}"
|
370
|
package="${eml-module}"
|
371
|
tag="${eml2-tag}"
|
372
|
dest="${build.tmp}" />
|
373
|
<mkdir dir="lib/schema" />
|
374
|
<copy todir="lib/schema" filtering="yes">
|
375
|
<fileset dir="${build.tmp}/${eml-module}">
|
376
|
<include name="*.xsd"/>
|
377
|
</fileset>
|
378
|
</copy>
|
379
|
<copy todir="lib/style/common">
|
380
|
<fileset dir="${build.tmp}/${eml-module}/style">
|
381
|
<include name="**/*.xsl"/>
|
382
|
</fileset>
|
383
|
</copy>
|
384
|
</target>
|
385
|
|
386
|
<target name="dtdschemasql" depends="prepare">
|
387
|
<echo/>
|
388
|
<echo>Registering the DTDs with the new Metacat instance...</echo>
|
389
|
<sql driver="${dbDriver}"
|
390
|
classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
|
391
|
url="${jdbc-connect}"
|
392
|
userid="${user}"
|
393
|
password="${password}"
|
394
|
src="${build.src}/loaddtdschema.sql" />
|
395
|
</target>
|
396
|
|
397
|
<target name="schemasql" depends="prepare">
|
398
|
<echo/>
|
399
|
<echo>Registering the DTDs with the new Metacat instance...</echo>
|
400
|
<sql driver="${dbDriver}"
|
401
|
classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
|
402
|
url="${jdbc-connect}"
|
403
|
userid="${user}"
|
404
|
password="${password}"
|
405
|
src="${build.src}/loadschema.sql" />
|
406
|
</target>
|
407
|
|
408
|
<target name="installdb" depends="prepare">
|
409
|
<echo/>
|
410
|
<echo>Installing the database tables...</echo>
|
411
|
<sql driver="${dbDriver}"
|
412
|
classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
|
413
|
url="${jdbc-connect}"
|
414
|
userid="${user}"
|
415
|
password="${password}"
|
416
|
src="${build.src}/xmltables.sql" />
|
417
|
</target>
|
418
|
|
419
|
<target name="upgrade12" depends="prepare">
|
420
|
<echo/>
|
421
|
<echo>Updating the database tables to upgrade to version 1.2...</echo>
|
422
|
<sql driver="${dbDriver}"
|
423
|
classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
|
424
|
url="${jdbc-connect}"
|
425
|
userid="${user}"
|
426
|
password="${password}"
|
427
|
src="${build.src}/upgrade-db-to-1.2.sql" />
|
428
|
</target>
|
429
|
|
430
|
<target name="upgrade13" depends="prepare">
|
431
|
<echo/>
|
432
|
<echo>Updating the database tables to upgrade to version 1.3...</echo>
|
433
|
<sql driver="${dbDriver}"
|
434
|
classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
|
435
|
url="${jdbc-connect}"
|
436
|
userid="${user}"
|
437
|
password="${password}"
|
438
|
src="${build.src}/upgrade-db-to-1.3.sql" />
|
439
|
</target>
|
440
|
|
441
|
<target name="installCommon" depends="jar,clientjar">
|
442
|
<mkdir dir="${datafilepath}" />
|
443
|
<mkdir dir="${inlinedatafilepath}" />
|
444
|
<chmod dir="${datafilepath}" perm="ug+w" />
|
445
|
<mkdir dir="${temp-dir}"/>
|
446
|
<chmod dir="${temp-dir}" perm="ug+w" />
|
447
|
<mkdir dir="${installdir}/WEB-INF/lib" />
|
448
|
<copy file="${build.dir}/${name}.jar"
|
449
|
tofile="${installdir}/WEB-INF/lib/${name}.jar" />
|
450
|
<copy file="${build.dir}/${name}-client.jar"
|
451
|
tofile="${installdir}/WEB-INF/lib/${name}-client.jar" />
|
452
|
<copy todir="${installdir}/WEB-INF/lib" filtering="no">
|
453
|
<fileset dir="lib">
|
454
|
<include name="*.jar"/>
|
455
|
</fileset>
|
456
|
<fileset dir="lib/xalan">
|
457
|
<include name="*.jar"/>
|
458
|
</fileset>
|
459
|
</copy>
|
460
|
<copy file="${jdbc}" tofile="${installdir}/WEB-INF/lib/jdbc.jar" />
|
461
|
<copy file="lib/web.xml.${tomcatversion}"
|
462
|
tofile="${installdir}/WEB-INF/web.xml" />
|
463
|
<copy todir="${installdir}" filtering="no">
|
464
|
<fileset dir="lib">
|
465
|
<include name="**/*.jpg"/>
|
466
|
<include name="**/*.png"/>
|
467
|
<include name="**/*.gif"/>
|
468
|
</fileset>
|
469
|
</copy>
|
470
|
<copy todir="${installdir}" filtering="yes">
|
471
|
<fileset dir="lib">
|
472
|
<exclude name="*.jar"/>
|
473
|
<exclude name="*.properties"/>
|
474
|
<exclude name="web.xml"/>
|
475
|
<exclude name="**/srbrmi*"/>
|
476
|
<exclude name="**/*.jpg"/>
|
477
|
<exclude name="**/*.png"/>
|
478
|
<exclude name="**/*.gif"/>
|
479
|
</fileset>
|
480
|
</copy>
|
481
|
<copy todir="${installdir}" filtering="no">
|
482
|
<fileset dir="lib">
|
483
|
<include name="**/*.jpg"/>
|
484
|
<include name="**/*.png"/>
|
485
|
<include name="**/*.gif"/>
|
486
|
</fileset>
|
487
|
</copy>
|
488
|
<echo>
|
489
|
***********************************************************
|
490
|
Remember to register the default DTDs by running the
|
491
|
"${build.src}/loaddtd.sql script". This is most easily
|
492
|
done by using the "ant dtdsql" which will run it for you.
|
493
|
***********************************************************
|
494
|
</echo>
|
495
|
</target>
|
496
|
|
497
|
<target name="installMSSQL" if="MSSQL" depends="installCommon">
|
498
|
<echo> Install MSSQL</echo>
|
499
|
<copy file="${jdbc-add1}"
|
500
|
tofile="${installdir}/WEB-INF/lib/msutil.jar" />
|
501
|
<copy file="${jdbc-add2}"
|
502
|
tofile="${installdir}/WEB-INF/lib/mssqlserver.jar" />
|
503
|
</target>
|
504
|
|
505
|
<target name="installother" if="other" depends="installCommon">
|
506
|
<echo> Install Other Database</echo>
|
507
|
</target>
|
508
|
|
509
|
<target name="install" depends="installMSSQL, installother">
|
510
|
|
511
|
</target>
|
512
|
|
513
|
<target name="install-registry" depends="init">
|
514
|
<copy file="${srcdir}/perl/register-dataset.cgi"
|
515
|
todir="${inst.cgi.dir}" filtering="yes"/>
|
516
|
<chmod file="${inst.cgi.dir}/register-dataset.cgi" perm="ugo+x" />
|
517
|
|
518
|
<mkdir dir="${temp-dir}" />
|
519
|
<copy todir="${temp-dir}" filtering="yes">
|
520
|
<fileset dir="${build.tmp}/${conversion-module}/lib/style">
|
521
|
<include name="*.xsl"/>
|
522
|
<include name="*.xml"/>
|
523
|
</fileset>
|
524
|
</copy>
|
525
|
|
526
|
<echo message="Install Registry completed." />
|
527
|
</target>
|
528
|
|
529
|
<target name="getBeta6ConversionStyles" depends="prepare">
|
530
|
<echo>Enter CVS password: </echo>
|
531
|
<cvs cvsRoot="${cvsroot-alternate}"
|
532
|
package="${conversion-module}"
|
533
|
dest="${build.tmp}" />
|
534
|
</target>
|
535
|
|
536
|
<target name="testprep" depends="jar,clientjar">
|
537
|
<mkdir dir="${build.tests}"/>
|
538
|
<copy todir="${build.tests}" filtering="yes">
|
539
|
<fileset dir="${testdir}">
|
540
|
<include name="edu/**"/>
|
541
|
</fileset>
|
542
|
</copy>
|
543
|
<!-- copy and compile the tests into a jar file -->
|
544
|
<javac srcdir="${build.tests}"
|
545
|
destdir="${build.tests}"
|
546
|
classpath="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar"
|
547
|
debug="on"
|
548
|
includes="**/*.java" />
|
549
|
|
550
|
<jar jarfile="${build.dir}/${name}-junittests.jar"
|
551
|
basedir="${build.tests}"
|
552
|
includes="**/*.class" />
|
553
|
</target>
|
554
|
|
555
|
<target name="test" depends="testprep">
|
556
|
|
557
|
<!-- use the ant "junit" task to run JUnit tests. -->
|
558
|
<junit printsummary="yes" haltonfailure="no" fork="yes"
|
559
|
haltonerror="no">
|
560
|
<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
|
561
|
<classpath>
|
562
|
<pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/${name}-junittests.jar" />
|
563
|
</classpath>
|
564
|
|
565
|
<formatter type="plain" />
|
566
|
|
567
|
<batchtest fork="yes" todir="${build.dir}">
|
568
|
<fileset dir="${build.tests}">
|
569
|
<include name="**/*.class" />
|
570
|
</fileset>
|
571
|
</batchtest>
|
572
|
</junit>
|
573
|
</target>
|
574
|
|
575
|
<target name="runonetest" depends="testprep">
|
576
|
<echo>testtorun: ${testtorun}</echo>
|
577
|
|
578
|
<!-- use the ant "junit" task to run JUnit tests. -->
|
579
|
<junit printsummary="yes" haltonfailure="no" fork="yes"
|
580
|
haltonerror="no">
|
581
|
<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
|
582
|
<classpath>
|
583
|
<pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/${name}-junittests.jar" />
|
584
|
</classpath>
|
585
|
|
586
|
<formatter type="plain" />
|
587
|
|
588
|
<batchtest fork="yes" todir="${build.dir}">
|
589
|
<fileset dir="${build.tests}">
|
590
|
<include name="**/${testtorun}.class" />
|
591
|
</fileset>
|
592
|
</batchtest>
|
593
|
</junit>
|
594
|
</target>
|
595
|
|
596
|
<target name="gethttpclient" depends="prepare">
|
597
|
<!--mkdir dir="${morphosourcedir}" -->
|
598
|
<cvs cvsRoot="${cvsroot}"
|
599
|
package="morpho"
|
600
|
dest="." />
|
601
|
<ant dir="${morphosourcedir}" inheritAll="false" target="jar" />
|
602
|
</target>
|
603
|
|
604
|
<!-- run this target, we need to check out a another morpho souce dir was checked out. -->
|
605
|
<target name="nettest" depends="install">
|
606
|
<echo>***********************************
|
607
|
Please run ant gethttpclient first!
|
608
|
***********************************
|
609
|
</echo>
|
610
|
<!-- copy and compile the tests into a jar file -->
|
611
|
<mkdir dir="${build.metacatnettest}"/>
|
612
|
<javac srcdir="${junitnettestsdir}"
|
613
|
destdir="${build.metacatnettest}"
|
614
|
classpath="${cpath}:${build.dir}/${name}.jar:${httpclient}"
|
615
|
includes="**/*.java" />
|
616
|
|
617
|
<jar jarfile="${build.dir}/${name}-junitnettests.jar"
|
618
|
basedir="${build.metacatnettest}"
|
619
|
includes="**/*.class" />
|
620
|
|
621
|
<!-- use the ant "junit" task to run JUnit tests. -->
|
622
|
<junit printsummary="yes" haltonfailure="no" fork="yes"
|
623
|
haltonerror="no">
|
624
|
<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
|
625
|
<classpath>
|
626
|
<pathelement path="${cpath}:${build.dir}/${name}.jar:${httpclient}:${build.dir}/${name}-junitnettests.jar:${itislib}" />
|
627
|
</classpath>
|
628
|
|
629
|
<formatter type="plain" />
|
630
|
|
631
|
<batchtest fork="yes" todir="${build.dir}">
|
632
|
<fileset dir="${build.metacatnettest}">
|
633
|
<include name="**/*.class" />
|
634
|
</fileset>
|
635
|
</batchtest>
|
636
|
</junit>
|
637
|
</target>
|
638
|
|
639
|
<target name="servletclean" depends="clean">
|
640
|
<delete dir="${installdir}" />
|
641
|
</target>
|
642
|
|
643
|
|
644
|
<target name="clean" depends="init">
|
645
|
<delete dir="${build.dir}" />
|
646
|
<delete file="lib/httpclient.jar" />
|
647
|
<delete file="lib/utilities.jar" />
|
648
|
</target>
|
649
|
|
650
|
<target name="jdoc" depends="prepare">
|
651
|
<javadoc packagenames="edu.ucsb.nceas.*"
|
652
|
sourcepath="${build.src}"
|
653
|
destdir="${build.javadocs}"
|
654
|
author="true"
|
655
|
version="true"
|
656
|
use="true"
|
657
|
windowtitle="${Name} API"
|
658
|
doctitle="<h1>${Name}</h1>"
|
659
|
bottom="<i>Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.</i>"
|
660
|
/>
|
661
|
</target>
|
662
|
|
663
|
<target name="dist" depends="jar,protocol,jdoc,getdtd,getschema">
|
664
|
<mkdir dir="${dist.dir}"/>
|
665
|
<delete dir="${ver.dir}" />
|
666
|
<mkdir dir="${ver.dir}"/>
|
667
|
<copy todir="${ver.dir}">
|
668
|
<fileset dir="."
|
669
|
excludes="**/CVS* **/.#* **/src* **/test* **/build* **/docs* ${dist.dir}"/>
|
670
|
</copy>
|
671
|
<copy todir="${ver.dir}" file="build.xml"/>
|
672
|
<copy todir="${ver.dir}/lib" file="${build.dir}/metacat.jar"/>
|
673
|
<copy todir="${ver.dir}/lib" file="${build.dir}/protocol.jar"/>
|
674
|
|
675
|
<copy todir="${ver.dir}/docs" filtering="yes">
|
676
|
<fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
|
677
|
</copy>
|
678
|
<copy todir="${ver.dir}/docs" filtering="no">
|
679
|
<fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
|
680
|
</copy>
|
681
|
<copy todir="${ver.dir}/docs/dev">
|
682
|
<fileset dir="${build.dir}/docs"/>
|
683
|
</copy>
|
684
|
<copy todir="${ver.dir}/src">
|
685
|
<fileset dir="${build.dir}/src"/>
|
686
|
</copy>
|
687
|
|
688
|
<delete dir="./${ver.dir}/${build.dir}"/>
|
689
|
<delete dir="./${ver.dir}/dist"/>
|
690
|
<delete file="./${name}-${release}.zip"/>
|
691
|
<zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
|
692
|
<delete file="./${name}-${release}.tar.gz" />
|
693
|
<tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
|
694
|
<gzip zipfile="./${name}-${release}.tar.gz"
|
695
|
src="./${name}-${release}.tar"/>
|
696
|
<delete file="./${name}-${release}.tar" />
|
697
|
</target>
|
698
|
|
699
|
<target name="distsrc" depends="dist">
|
700
|
<mkdir dir="${ver.src}"/>
|
701
|
<copy todir="${ver.src}">
|
702
|
<fileset dir="./src"/>
|
703
|
</copy>
|
704
|
|
705
|
<delete file="./${name}-src-${release}.zip"/>
|
706
|
<zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
|
707
|
<delete file="./${name}-src-${release}.tar.gz" />
|
708
|
<tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
|
709
|
<gzip zipfile="./${name}-src-${release}.tar.gz"
|
710
|
src="./${name}-src-${release}.tar"/>
|
711
|
<delete file="./${name}-src-${release}.tar" />
|
712
|
<delete dir="${dist.dir}"/>
|
713
|
</target>
|
714
|
|
715
|
<target name="stylesheettest">
|
716
|
<xslt in="${input}" out="eml.html" style="lib/style/common/eml-2.0.0/eml-2.0.0.xsl">
|
717
|
<param name="displaymodule" expression="${displaymodule}"/>
|
718
|
<param name="docid" expression="${input}"/>
|
719
|
<param name="entitytype" expression="${entitytype}"/>
|
720
|
<param name="entityindex" expression="${entityindex}"/>
|
721
|
<outputproperty name="method" value="html"/>
|
722
|
<outputproperty name="standalone" value="yes"/>
|
723
|
<outputproperty name="encoding" value="iso8859_1"/>
|
724
|
<outputproperty name="indent" value="yes"/>
|
725
|
</xslt>
|
726
|
</target>
|
727
|
|
728
|
<target name="gridinit" depends="init">
|
729
|
<property name="java2wsdl.tool" value="org.apache.axis.wsdl.Java2WSDL" />
|
730
|
<property name="wsdldecorator.tool" value="org.globus.ogsa.tools.wsdl.DecorateWSDL" />
|
731
|
<property name="wsdl.tool" value="org.globus.ogsa.tools.wsdl.GSDL2Java"/>
|
732
|
<property environment="env"/>
|
733
|
<property name="binding.file" value="${env.GLOBUS_LOCATION}/schema/ogsi/ogsi_bindings.wsdl"/>
|
734
|
<path id="webservicepath">
|
735
|
<pathelement location="."/>
|
736
|
<pathelement location="${env.JAVA_HOME}/../lib/tools.jar"/>
|
737
|
<pathelement location="${build.dest}"/>
|
738
|
<fileset dir="${env.GLOBUS_LOCATION}/lib">
|
739
|
<include name="*.jar"/>
|
740
|
</fileset>
|
741
|
</path>
|
742
|
</target>
|
743
|
|
744
|
<target name="gridprepare" depends="gridinit, prepare">
|
745
|
</target>
|
746
|
|
747
|
<target name="compileinterface" depends="clean, gridprepare">
|
748
|
<javac srcdir="${build.src}" destdir="${build.dest}" includes="**/${interface.name}.java" />
|
749
|
</target>
|
750
|
|
751
|
<target name="generateWSDL" depends="compileinterface">
|
752
|
<echo message="Generating wsdl from ${interface.name} interface"/>
|
753
|
<java classname="${java2wsdl.tool}"
|
754
|
dir="${build.src}" fork="yes"
|
755
|
classpathref="webservicepath" failonerror="true" >
|
756
|
<arg value="-P"/>
|
757
|
<arg value="${interface.name}PortType"/>
|
758
|
<arg value="-S"/>
|
759
|
<arg value="${interface.name}Service"/>
|
760
|
<arg value="-y"/>
|
761
|
<arg value="WRAPPED"/>
|
762
|
<arg value="-u"/>
|
763
|
<arg value="LITERAL"/>
|
764
|
<arg value="-l"/>
|
765
|
<arg value="http://localhost/ogsa/services/${interface.name}Service"/>
|
766
|
<arg value="-n"/>
|
767
|
<arg value="http://${services.namespace}/${interface.name}"/>
|
768
|
<arg value="${interface.package}.${interface.name}"/>
|
769
|
</java>
|
770
|
</target>
|
771
|
|
772
|
<target name="decorateWSDL" depends="generateWSDL">
|
773
|
<property name="wsdl.file" value="${interface.name}Service.wsdl"/>
|
774
|
<java classname="${wsdldecorator.tool}" dir="${build.src}"
|
775
|
fork="yes"
|
776
|
classpathref="webservicepath" failonerror="true" >
|
777
|
<arg value="${binding.file}"/>
|
778
|
<arg value="${wsdl.file}"/>
|
779
|
</java>
|
780
|
</target>
|
781
|
|
782
|
<target name="generatestubs" depends="decorateWSDL">
|
783
|
<echo message=" Generating stubs " />
|
784
|
<echo message="wsdl file is ${wsdl.file}"/>
|
785
|
<echo message="build.src is ${build.src}"/>
|
786
|
<java classname="${wsdl.tool}" dir="${build.src}" fork="yes"
|
787
|
classpathref="webservicepath" failonerror="true" >
|
788
|
<arg value="${wsdl.file}"/>
|
789
|
</java>
|
790
|
</target>
|
791
|
|
792
|
<target name="compileStubsAndImpl" depends="generatestubs, utilities">
|
793
|
<echo message=" Compiling stubs " />
|
794
|
<javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" includes="**/${interface.name}/*.java" />
|
795
|
<echo message=" Compiling impl " />
|
796
|
<javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" classpath="./lib/utilities.jar" includes="**/impl/*.java" />
|
797
|
</target>
|
798
|
|
799
|
<target name="jarStubsAndImpl" depends="compileStubsAndImpl">
|
800
|
<echo message=" jar stubs classes " />
|
801
|
<jar destfile="${build.dir}/${interface.name}-stubs.jar" basedir="${build.dest}" includes="**/${interface.name}/*.class" />
|
802
|
<echo message=" jar impl classes " />
|
803
|
<jar destfile="${build.dir}/${interface.name}.jar" basedir="${build.dest}" includes="**/impl/*.class" />
|
804
|
</target>
|
805
|
|
806
|
<target name="gar" depends="jarStubsAndImpl">
|
807
|
<echo message=" jar the gar file"/>
|
808
|
<mkdir dir="${build.dir}/gar"/>
|
809
|
<mkdir dir="${build.dir}/gar/schema/edu"/>
|
810
|
<copy file="${build.dir}/${interface.name}.jar" todir="${build.dir}/gar" />
|
811
|
<copy file="${build.dir}/${interface.name}-stubs.jar" todir="${build.dir}/gar" />
|
812
|
<copy file="lib/utilities.jar" todir="${build.dir}/gar" />
|
813
|
<copy file="lib/server-deploy.wsdd" todir="${build.dir}/gar" />
|
814
|
<copy file="${build.src}/${interface.name}Service.wsdl" todir="${build.dir}/gar/schema/edu" />
|
815
|
<jar destfile="lib/${interface.name}.gar" basedir="${build.dir}/gar"/>
|
816
|
</target>
|
817
|
|
818
|
<target name="compilewebclient" depends="prepare">
|
819
|
<javac srcdir="${build.src}" destdir="${build.dest}" includes="**/application/*.java" classpathref="webservicepath" />
|
820
|
</target>
|
821
|
|
822
|
<target name="runwebclient" depends="compilewebclient">
|
823
|
<java classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
|
824
|
dir="${build.dest}" fork="yes"
|
825
|
classpathref="webservicepath" classpath="./lib/utilities.jar" failonerror="true">
|
826
|
<arg value="${serviceUrl}"/>
|
827
|
<arg value="${docid}"/>
|
828
|
</java>
|
829
|
</target>
|
830
|
</project>
|