Project

General

Profile

1 113 jones
<?xml version="1.0"?>
2 1311 berkley
<!--
3 670 jones
  *   '$RCSfile$'
4
  *     Authors: Matt Jones, Chad Berkley, Jivka Bojilova
5
  *   Copyright: 2000 Regents of the University of California and the
6
  *              National Center for Ecological Analysis and Synthesis
7
  * For Details: http://www.nceas.ucsb.edu/
8 113 jones
  *
9 670 jones
  *    '$Author$'
10 1292 tao
  *    '$Date$'
11
  *    '$Revision$'
12 666 jones
  *
13 670 jones
  * Build file for the Ant cross-platform build system for metacat
14
  * See http://jakarta.apache.org for details on Ant
15 113 jones
  *
16 303 jones
  * usage: ant [compile|jar|install|jdoc]
17 666 jones
  *
18
  * This program is free software; you can redistribute it and/or modify
19
  * it under the terms of the GNU General Public License as published by
20
  * the Free Software Foundation; either version 2 of the License, or
21
  * (at your option) any later version.
22
  *
23
  * This program is distributed in the hope that it will be useful,
24
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26
  * GNU General Public License for more details.
27
  *
28
  * You should have received a copy of the GNU General Public License
29
  * along with this program; if not, write to the Free Software
30
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
31 1311 berkley
-->
32 329 jones
<project name="metacat" default="jar" basedir=".">
33 2277 jones
  <property environment="env"/>
34 1929 brooke
  <property file="build.properties"/>  <!-- USER SPECIFIC PROPS -->
35
36 2599 jones
  <!-- Determine which tomcat we are using and tomcat-specific settings -->
37
  <condition property="jsdk" value="${tomcat}/common/lib/servlet.jar">
38
    <equals arg1="${tomcatversion}" arg2="tomcat4" />
39
  </condition>
40
  <condition property="jsdk" value="${tomcat}/common/lib/servlet-api.jar">
41
    <equals arg1="${tomcatversion}" arg2="tomcat5" />
42
  </condition>
43 2957 tao
44
  <!-- Determine if installed ecogrid -->
45
  <condition property="enable.ecogrid">
46
    <equals arg1="${install.ecogrid}" arg2="true" />
47
  </condition>
48 3034 perry
49 1929 brooke
  <target name="check-db">
50
    <condition property="use-oracle">
51
      <equals arg1="${database}" arg2="oracle" />
52
    </condition>
53
    <condition property="use-postgresql">
54
      <equals arg1="${database}" arg2="postgresql" />
55
    </condition>
56
    <condition property="use-sqlserver">
57
      <equals arg1="${database}" arg2="sqlserver" />
58
    </condition>
59
  </target>
60
61
  <target name="oracle" if="use-oracle">
62 931 jones
     <!-- Customize these properties if you are using oracle -->
63 1929 brooke
     <echo message="Using oracle..."/>
64 925 berkley
     <property name="dbDriver" value="oracle.jdbc.driver.OracleDriver"/>
65
     <property name="dbAdapter" value="edu.ucsb.nceas.dbadapter.OracleAdapter"/>
66 2617 tao
     <property name="jdbc-jar-name" value="classes111.zip" />
67
     <property name="jdbc" value="${jdbc_base}/${jdbc-jar-name}" />
68 1744 tao
     <!-- Property to indicate is not MSSQL installation-->
69
     <property name="other" value="yes"/>
70 2175 tao
     <property name="install-sql"
71 2103 jones
               value="xmltables.sql" />
72 2175 tao
     <property name="upgrade-1.2-sql"
73 2103 jones
               value="upgrade-db-to-1.2.sql" />
74 2175 tao
     <property name="upgrade-1.3-sql"
75 2103 jones
               value="upgrade-db-to-1.3.sql" />
76 2175 tao
     <property name="upgrade-1.4-sql"
77 2103 jones
               value="upgrade-db-to-1.4.sql" />
78 2518 sgarg
     <property name="upgrade-1.5-sql"
79 2431 sgarg
               value="upgrade-db-to-1.5.sql" />
80 2518 sgarg
     <property name="upgrade-1.6-sql"
81
               value="upgrade-db-to-1.6.sql" />
82 3128 perry
     <property name="upgrade-1.7-sql"
83
               value="upgrade-db-to-1.7.sql" />
84 3610 tao
  	<property name="upgrade-1.8-sql"
85
  	   	               value="upgrade-db-to-1.8.sql" />
86 925 berkley
   </target>
87 1311 berkley
88 1929 brooke
   <target name="postgresql" if="use-postgresql">
89 931 jones
     <!-- Customize these properties if you are using postgres -->
90 1929 brooke
     <echo message="Using PostgreSQL..."/>
91 925 berkley
     <property name="dbDriver" value="org.postgresql.Driver"/>
92 1311 berkley
     <property name="dbAdapter"
93 931 jones
               value="edu.ucsb.nceas.dbadapter.PostgresqlAdapter"/>
94 2610 tao
     <property name="jdbc-jar-name" value="postgresql-8.0-312.jdbc3.jar" />
95
     <property name="jdbc" value="lib/${jdbc-jar-name}" />
96 1744 tao
     <!-- Property to indicate is not MSSQL installation-->
97
     <property name="other" value="yes"/>
98 2175 tao
     <property name="install-sql"
99 2277 jones
               value="xmltables-postgres.sql" />
100 2175 tao
     <property name="upgrade-1.2-sql"
101 2277 jones
               value="upgrade-db-to-1.2-postgres.sql" />
102 2175 tao
     <property name="upgrade-1.3-sql"
103 2277 jones
               value="upgrade-db-to-1.3-postgres.sql" />
104 2175 tao
     <property name="upgrade-1.4-sql"
105 2277 jones
               value="upgrade-db-to-1.4-postgres.sql" />
106 2518 sgarg
     <property name="upgrade-1.5-sql"
107 2431 sgarg
               value="upgrade-db-to-1.5-postgres.sql" />
108 2518 sgarg
     <property name="upgrade-1.6-sql"
109
               value="upgrade-db-to-1.6-postgres.sql" />
110 3128 perry
     <property name="upgrade-1.7-sql"
111
               value="upgrade-db-to-1.7-postgres.sql" />
112 3610 tao
   	<property name="upgrade-1.8-sql"
113
   	               value="upgrade-db-to-1.8-postgres.sql" />
114 1744 tao
    </target>
115 2175 tao
116 1929 brooke
   <target name="sqlserver" if="use-sqlserver">
117 1739 tao
     <!-- Customize these properties if you are using SQL server -->
118 1929 brooke
     <echo message="Using SQL Server..."/>
119 1739 tao
     <property name="dbDriver" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
120
     <property name="dbAdapter"
121
               value="edu.ucsb.nceas.dbadapter.SqlserverAdapter"/>
122 2296 sgarg
     <property name="jdbc" value="${jdbc_base}/msbase.jar" />
123
     <property name="jdbc-add1" value="${jdbc_base}/msutil.jar" />
124
     <property name="jdbc-add2" value="${jdbc_base}/mssqlserver.jar" />
125 1744 tao
     <!-- Property to indicate is a MSSQL installation-->
126
     <property name="MSSQL" value="yes"/>
127 2175 tao
     <property name="install-sql"
128 2118 costa
               value="xmltables-sqlserver.sql" />
129 1739 tao
   </target>
130 1311 berkley
131 1929 brooke
   <target name="config" depends="check-db,oracle,postgresql,sqlserver">
132 1814 tao
      <!-- usr for client testing, generally you don't need change-->
133 2991 berkley
      <property name="mcuser" value="uid=kepler,o=unaffiliated,dc=ecoinformatics,dc=org"/>
134
      <property name="mcpassword" value="kepler"/>
135 3575 tao
      <property name="mcanotheruser" value="uid=tao,o=NCEAS,dc=ecoinformatics,dc=org"/>
136
      <property name="mcanotherpassword" value="yourpass"/>
137
   	   <property name="piscouser" value="uid=tao,o=PISCO,dc=ecoinformatics,dc=org"/>
138
   	   <property name="piscopassword" value="yourpass"/>
139
   	   <property name="lteruser" value="uid=jtao,o=LTER,dc=ecoinformatics,dc=org"/>
140
   	   <property name="lterpassword" value="yourpass"/>
141 1801 tao
142 1827 jones
      <property name="debug" value="on" />
143 2053 sgarg
      <property name="debuglevel" value="55" />
144 1716 berkley
145 1522 berkley
      <property name="morphosourcedir" value="../morpho" />
146 1570 tao
      <property name="defaultcontenttype" value="application/octet-stream" />
147 1780 jones
      <property name="utilitiesdir" value="../utilities" />
148 2175 tao
149 1941 brooke
      <echo>*********** tomcatversion = ${tomcatversion}</echo>
150
      <echo>*********** set jsdk to ${jsdk}</echo>
151 1103 tao
  </target>
152
153 931 jones
   <target name="init" depends="config">
154 2631 tao
      <path id="compile.classpath">
155
        <pathelement location="${jsdk}"/>
156
        <pathelement location="lib" />
157
        <fileset dir="lib">
158
          <include name="*.jar"/>
159
        </fileset>
160 3059 berkley
	<fileset dir="lib">
161
           <include name="xalan.jar"/>
162 3030 sgarg
         </fileset>
163 2631 tao
       <fileset dir="lib/lsid_lib">
164
         <include name="*.jar"/>
165
       </fileset>
166
       <fileset dir="${jdbc_base}">
167
         <include name="${jdbc-jar-name}"/>
168
          <include name="msbase.jar"/>
169
          <include name="msutil.jar"/>
170
          <include name="mssqlserver.jar"/>
171 3034 perry
       </fileset>
172
173
        <!-- Include geoserver, geotools, et. al. -->
174
        <fileset dir="lib/spatial/geoserver/WEB-INF/lib">
175
          <include name="*.jar"/>
176 2631 tao
        </fileset>
177 3034 perry
        <pathelement location="lib/spatial/geoserver/WEB-INF/classes"/>
178
179 2631 tao
       </path>
180
181 931 jones
      <!-- It is less likely you'll need to make any changes from here down,
182
           but customization is possible -->
183 2737 jones
      <property name="installdir"          value="${deploy.dir}/${metacat.context}" />
184
      <property name="temp-dir"            value="/tmp/${metacat.context}" />
185 1929 brooke
      <property name="name"                value="metacat"/>
186
      <property name="Name"                value="MetaCat"/>
187
      <property name="debugprefix"         value="${Name}:"/>
188 3909 tao
      <property name="release"             value="1.8.1"/>
189 2737 jones
      <property name="replication-path"    value="/${metacat.context}/servlet/replication"/>
190
      <property name="harvester-registration-login-path" value="/${metacat.context}/harvesterRegistrationLogin"/>
191
      <property name="harvester-registration-path"       value="/${metacat.context}/harvesterRegistration"/>
192
      <property name="servlet-path"        value="/${metacat.context}/metacat"/>
193
      <property name="html-path"           value="/${metacat.context}"/>
194 2974 jones
      <property name="systemidserver"      value="${http.protocol}://${httpserver}"/>
195 3095 cjones
      <property name="style-common-relpath" value="/style/common"/>
196
      <property name="style-shared-relpath" value="/style/shared"/>
197
      <property name="style-common-cvsrelpath" value="lib${style-common-relpath}"/>
198
      <property name="style-common-fullpath" value="/${installdir}${style-common-relpath}"/>
199 2343 sgarg
      <property name="templates.dir"       value="${style-common-fullpath}/templates"/>
200 3095 cjones
      <property name="style-common-path"   value="/${metacat.context}${style-common-relpath}"/>
201
      <property name="style-shared-path"   value="/${metacat.context}${style-shared-relpath}"/>
202 1929 brooke
      <property name="style-skins-relpath" value="/style/skins"/>
203 2737 jones
      <property name="style-skins-path"    value="/${metacat.context}${style-skins-relpath}"/>
204 3232 tao
      <property name="replication-log"     value="${log.dir}/metacatreplication.log"/>
205
      <property name="replicationerrorlog" value="${log.dir}/metacatreplication.err"/>
206 3880 daigle
      <property name="config-dir"          value="${deploy.dir}${style-skins-path}" />
207 2461 sgarg
      <property name="util-module"         value="utilities" />
208 1929 brooke
      <property name="eml-module"          value="eml" />
209
      <property name="eml-version"         value="2.0.0beta6" />
210
      <property name="eml-tag"             value="EML_2_0_0_BETA_6_FOR_METACAT" />
211 2232 sgarg
      <property name="eml2_0_0-tag"        value="RELEASE_EML_2_0_0_UPDATE_1" />
212 3994 berkley
      <property name="eml2_0_1-schema-tag" value="RELEASE_EML_2_0_1" />
213 3807 tao
      <property name="eml2_0_1-style-tag"  value="RELEASE_EML_2_0_1_UPDATE_6" />
214 2228 sgarg
      <property name="eml2_0_0namespace"   value="eml://ecoinformatics.org/eml-2.0.0" />
215
      <property name="eml2_0_1namespace"   value="eml://ecoinformatics.org/eml-2.0.1" />
216
      <property name="eml2_1_0namespace"   value="eml://ecoinformatics.org/eml-2.1.0" />
217 1929 brooke
      <property name="stmmlnamespace"      value="http://www.xml-cml.org/schema/stmml" />
218 1933 brooke
      <property name="eml-css"             value="eml_xsl.css"/>
219
      <property name="eml-module.default.css"
220
                                           value="default.css"/>
221 2965 tao
222 1929 brooke
      <!-- Config for registry variables -->
223 1933 brooke
      <property name="scope"               value="obfs"/>
224
      <property name="responseForm"        value="genericResponse.tmpl"/>
225
      <property name="entryForm"           value="entryForm.tmpl"/>
226
      <property name="guide"               value="genericGuide.tmpl"/>
227 2781 sgarg
      <property name="loginForm"           value="loginForm.tmpl"/>
228 2343 sgarg
      <property name="confirmData"         value="confirmData.tmpl"/>
229
      <property name="deleteData"          value="deleteData.tmpl"/>
230
      <property name="genericHeader"       value="genericHeader.tmpl"/>
231
      <property name="genericFooter"       value="genericFooter.tmpl"/>
232
      <property name="adminname"           value="KNB Support"/>
233
      <property name="recipient"           value="knb-software\@nceas.ucsb.edu"/>
234 1929 brooke
235 2343 sgarg
      <property name="defaultStage"        value="initregister"/>
236
      <property name="defaultHeader"       value="genericHeader.tmpl"/>
237
      <property name="defaultFooter"       value="genericFooter.tmpl"/>
238
      <property name="defaultChangePass"   value="ldapChangePass.tmpl"/>
239
      <property name="defaultResetPass"    value="ldapResetPass.tmpl"/>
240
      <property name="changePassSuccess"   value="ldapChangePassSuccess.tmpl"/>
241
      <property name="resetPassSuccess"    value="ldapResetPassSuccess.tmpl"/>
242
      <property name="registerFailed"      value="ldapRegisterFailed.tmpl"/>
243
      <property name="registerLter"        value="ldapRegisterLter.tmpl"/>
244
      <property name="registerMatch"       value="ldapRegisterMatch.tmpl"/>
245
      <property name="registerSuccess"     value="ldapRegisterSuccess.tmpl"/>
246
      <property name="register"            value="ldapRegister.tmpl"/>
247
      <property name="searchResults"       value="searchResults.tmpl"/>
248 3174 tao
   	  <property name="ldapMainServerFailure" value="ldapMainServerFailure.tmpl"/>
249 2343 sgarg
250
      <filter token="scope"                value="${scope}"/>
251
      <filter token="responseForm"         value="${responseForm}"/>
252
      <filter token="entryForm"            value="${entryForm}"/>
253
      <filter token="guide"                value="${guide}"/>
254 2781 sgarg
      <filter token="loginForm"            value="${loginForm}"/>
255 2343 sgarg
      <filter token="confirmData"          value="${confirmData}"/>
256
      <filter token="deleteData"           value="${deleteData}"/>
257
      <filter token="genericHeader"        value="${genericHeader}"/>
258
      <filter token="genericFooter"        value="${genericFooter}"/>
259
      <filter token="adminname"            value="${adminname}"/>
260
      <filter token="recipient"            value="${recipient}"/>
261
262
      <filter token="ldapurl"              value="ldap.ecoinformatics.org"/>
263
      <filter token="ldapSearchBase"       value="dc=ecoinformatics,dc=org"/>
264
      <filter token="ldap_user"            value="cn=Manager,dc=ecoinformatics,dc=org"/>
265
      <filter token="ldap_password"        value="ldap_password"/>
266 2870 sgarg
      <filter token="mailhost"             value="localhost"/>
267 2343 sgarg
      <filter token="sender"               value="knb-software\@nceas.ucsb.edu"/>
268 2974 jones
      <filter token="cgiurl"               value="${cgi-prefix}/ldapweb.cgi"/>
269 2343 sgarg
270 882 jones
      <filter token="docrooturl" value="./" />
271 2356 sgarg
      <filter token="database" value="${database}" />
272 588 berkley
      <filter token="jdbc-connect" value="${jdbc-connect}"/>
273 882 jones
      <filter token="dbDriver" value="${dbDriver}"/>
274 915 berkley
      <filter token="dbAdapter" value="${dbAdapter}"/>
275 614 bojilova
      <filter token="install-dir" value="${installdir}"/>
276 1929 brooke
      <filter token="temp-dir" value="${temp-dir}"/>
277 586 berkley
      <filter token="server" value="${server}"/>
278 977 tao
      <filter token="systemidserver" value="${systemidserver}"/>
279 1929 brooke
      <filter token="cgi-prefix" value="${cgi-prefix}"/>
280
      <filter token="ldapUrl" value="${ldapUrl}"/>
281 586 berkley
      <filter token="replication-log" value="${replication-log}"/>
282 1579 tao
      <filter token="replicationerrorlog" value="${replicationerrorlog}"/>
283 348 jones
      <filter token="servlet-path" value="${servlet-path}"/>
284 359 bojilova
      <filter token="html-path" value="${html-path}"/>
285 362 jones
      <filter token="user" value="${user}"/>
286
      <filter token="password" value="${password}"/>
287 1783 jones
      <filter token="mcuser" value="${mcuser}"/>
288
      <filter token="mcpassword" value="${mcpassword}"/>
289 1801 tao
      <filter token="mcanotheruser" value="${mcanotheruser}"/>
290
      <filter token="mcanotherpassword" value="${mcanotherpassword}"/>
291 1929 brooke
      <filter token="knb-site-url" value="${knb-site-url}"/>
292 1933 brooke
      <filter token="eml-css" value="${eml-css}"/>
293 1929 brooke
      <filter token="style-skins-relpath" value="${style-skins-relpath}"/>
294
      <filter token="style-skins-path" value="${style-skins-path}"/>
295
      <filter token="style-common-relpath" value="${style-common-relpath}"/>
296
      <filter token="style-common-fullpath" value="${style-common-fullpath}"/>
297
      <filter token="style-common-path" value="${style-common-path}"/>
298 3095 cjones
      <filter token="style-shared-path" value="${style-shared-path}"/>
299 2343 sgarg
      <filter token="templates.dir" value="${templates.dir}"/>
300
301 1929 brooke
      <!-- The "style-path" filter is used by the eml xsl stylesheets!!  -->
302
      <filter token="style-path" value="${style-skins-path}"/>
303 525 berkley
      <filter token="replication-path" value="${replication-path}"/>
304 2299 costa
      <filter token="harvester-registration-login-path" value="${harvester-registration-login-path}"/>
305
      <filter token="harvester-registration-path" value="${harvester-registration-path}"/>
306 832 jones
      <filter token="config-dir" value="${config-dir}"/>
307
      <filter token="default-style" value="${default-style}"/>
308 877 jones
      <filter token="eml-version" value="${eml-version}"/>
309 2175 tao
      <filter token="eml2_0_0namespace" value="${eml2_0_0namespace}"/>
310 2228 sgarg
      <filter token="eml2_0_1namespace" value="${eml2_0_1namespace}"/>
311 2175 tao
      <filter token="eml2_1_0namespace" value="${eml2_1_0namespace}"/>
312 1718 tao
      <filter token="stmmlnamespace" value="${stmmlnamespace}"/>
313 2737 jones
      <filter token="context" value="${metacat.context}"/>
314 2961 tao
   	  <filter token="httpserver" value="${httpserver}"/>
315 1292 tao
      <filter token="forcereplicationwaitingtime" value="${forcereplicationwaitingtime}" />
316 1051 tao
      <filter token="debuglevel" value="${debuglevel}" />
317 1079 tao
      <filter token="datafilepath" value="${datafilepath}" />
318 1455 tao
      <filter token="inlinedatafilepath" value="${inlinedatafilepath}" />
319 1522 berkley
      <filter token="defaultcontenttype" value="${defaultcontenttype}" />
320 1538 berkley
      <filter token="debugprefix" value="${debugprefix}"/>
321 2308 jones
      <filter token="administrators" value="${administrators}"/>
322 2577 sgarg
      <filter token="moderators" value="${moderators}"/>
323
      <filter token="allowedSubmitters" value="${allowedSubmitters}"/>
324
      <filter token="deniedSubmitters" value="${deniedSubmitters}"/>
325 2872 sgarg
      <filter token="indexPaths" value="${indexPaths}"/>
326 1487 tao
327 2343 sgarg
      <filter token="defaultStage" value="${defaultStage}"/>
328
      <filter token="defaultHeader" value="${defaultHeader}"/>
329
      <filter token="defaultFooter" value="${defaultFooter}"/>
330
      <filter token="defaultChangePass" value="${defaultChangePass}"/>
331
      <filter token="defaultResetPass" value="${defaultResetPass}"/>
332
      <filter token="changePassSuccess" value="${changePassSuccess}"/>
333
      <filter token="resetPassSuccess" value="${resetPassSuccess}"/>
334
      <filter token="registerFailed" value="${registerFailed}"/>
335
      <filter token="registerLter" value="${registerLter}"/>
336
      <filter token="registerMatch" value="${registerMatch}"/>
337
      <filter token="registerSuccess" value="${registerSuccess}"/>
338
      <filter token="register" value="${register}"/>
339
      <filter token="searchResults" value="${searchResults}"/>
340 3174 tao
   	  <filter token="ldapMainServerFailure" value="${ldapMainServerFailure}"/>
341 3575 tao
   	  <filter token="lter-user" value="${lteruser}"/>
342
   	  <filter token="lter-pass" value="${lterpassword}"/>
343
      <filter token="pisco-user" value="${piscouser}"/>
344
      <filter token="pisco-pass" value="${piscopassword}"/>
345
346 2549 tao
347
   	  <filter token="timedreplication" value="${timedreplication}" />
348
   	  <filter token="firsttimedreplication" value="${firsttimedreplication}" />
349
   	  <filter token="timedreplicationinterval" value="${timedreplicationinterval}" />
350
351
   	  <property name="srcdir" value="./src" />
352 2599 jones
   	  <property name="lib.dir" value="./lib" />
353 1783 jones
      <property name="testdir" value="./test" />
354 2277 jones
      <property name="testtorun" value="BuildIndexTest" />
355 1116 tao
      <property name="junittestsdir" value="./test/edu/ucsb/nceas/metacattest" />
356
      <property name="junitnettestsdir" value="./test/edu/ucsb/nceas/metacatnettest" />
357 348 jones
      <property name="build.dir" value="./build"/>
358
      <property name="build.src" value="${build.dir}/src"/>
359
      <property name="build.dest" value="${build.dir}/classes"/>
360 516 jones
      <property name="build.docs" value="${build.dir}/docs"/>
361 348 jones
      <property name="build.samples" value="${build.dir}/samples"/>
362
      <property name="build.tests" value="${build.dir}/tests"/>
363 1778 tao
      <property name="build.tmp" value="${build.dir}/tmp"/>
364 1116 tao
      <property name="build.metacattest" value="${build.tests}/metacattest"/>
365
      <property name="build.metacatnettest" value="${build.tests}/metacatnettest"/>
366 348 jones
      <property name="build.data" value="${build.dir}/data"/>
367 806 jones
      <property name="build.javadocs" value="${build.dir}/docs/api"/>
368 1952 jones
      <property name="build.war" value="${build.dir}/war"/>
369 348 jones
370 882 jones
      <property name="dist.dir" value="dist"/>
371 806 jones
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
372
      <property name="ver.src" value="${ver.dir}/src"/>
373 2461 sgarg
      <property name="util.dir" value="${dist.dir}/${util-module}"/>
374 2401 costa
	  <!-- directories for creating a Harvest List Editor distribution -->
375
      <property name="dist.dir.hle" value="disthle"/>
376
      <property name="ver.dir.hle" value="${dist.dir.hle}/harvest-list-editor-${release}"/>
377 2965 tao
378
379
   	  <property name="ecogrid-target-name" value="metacatImpl"/>
380
   	  <property name="ecogrid-module-dest-dir" value =".."/>
381
   	  <property name="ecogrid-module" value="seek/projects/ecogrid"/>
382
   	  <property name="ecogrid-dist-dir" value="${dist.dir}/${ecogrid-module}"/>
383
   	  <property name="ecogrid-dir" value="${ecogrid-module-dest-dir}/${ecogrid-module}"/>
384 806 jones
385 254 jones
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
386 2317 jones
      <condition property="utilities.required">
387
        <or>
388
          <not><available file="lib/httpclient.jar"/></not>
389
          <not><available file="lib/utilities.jar"/></not>
390
        </or>
391
      </condition>
392 2318 jones
      <condition property="eml.required">
393
        <or>
394
          <not><available file="lib/schema/eml-2.0.1/eml.xsd"/></not>
395
          <not><available file="lib/schema/eml-2.0.0/eml.xsd"/></not>
396
          <not><available file="lib/dtd/eml-dataset-2.0.0beta6.dtd"/></not>
397
        </or>
398
      </condition>
399 2965 tao
400
      <condition property="ecogrid.required">
401
      	   <or>
402
             <not><available file="${ecogrid-dir}/build.properties"/></not>
403
             <not><available file="${ecogrid-dir}/buildfiles/metacatImpl.xml"/></not>
404
           </or>
405
      </condition>
406 2599 jones
407 113 jones
   </target>
408 1311 berkley
409 348 jones
   <target name="prepare" depends="init">
410
      <mkdir dir="${build.dir}"/>
411
      <mkdir dir="${build.src}"/>
412
      <mkdir dir="${build.dest}"/>
413 516 jones
      <mkdir dir="${build.javadocs}"/>
414 1778 tao
      <mkdir dir="${build.tmp}"/>
415 348 jones
416 822 jones
      <copy todir="${build.src}" filtering="yes">
417
        <fileset dir="${srcdir}">
418
          <include name="edu/**"/>
419
          <include name="com/**"/>
420 3194 berkley
          <include name="org/**"/>
421 877 jones
          <include name="**/*.sql"/>
422 822 jones
          <exclude name="**/CVS*"/>
423
          <exclude name="**/.#*"/>
424
        </fileset>
425
      </copy>
426 2344 sgarg
      <available file="lib/style/common/emlb6toeml2" type="dir"
427 1954 jones
                 property="styles.not.needed"/>
428 348 jones
   </target>
429
430 1939 brooke
   <target name="compile" depends="prepare,utilities"
431 1986 jones
    description="Compiles java code to build dir, and copies metacat props files there">
432 1939 brooke
433 1311 berkley
       <javac srcdir="${build.src}"
434
              destdir="${build.dest}"
435 1827 jones
              debug="${debug}"
436 3994 berkley
              excludes="**/*.sql **/stringclient/** **/client/*.java **/harvesterClient/*.java">
437 2599 jones
        <classpath>
438
          <path refid="compile.classpath"/>
439
        </classpath>
440
      </javac>
441 1311 berkley
   </target>
442 113 jones
443 2322 jones
   <target name="jar" depends="compile,geteml"
444 1939 brooke
    description="Compiles and jars metacat java code to metacat.jar in build dir">
445
446 353 jones
       <delete file="${build.dir}/${name}.jar" />
447 635 jones
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
448 2135 costa
            excludes="**/protocols/ **/harvesterClient/" />
449 1311 berkley
   </target>
450
451 1939 brooke
   <target name="protocol" depends="compile"
452
    description="Compiles and jars protocol java code to protocol.jar in build dir">
453 635 jones
       <delete file="${build.dir}/protocol.jar" />
454
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
455
            includes="**/protocols/" />
456 1311 berkley
   </target>
457 113 jones
458 2317 jones
   <target name="utilities" depends="config" if="utilities.required">
459 1796 jones
     <ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
460
     <ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
461 1780 jones
     <copy file="${utilitiesdir}/lib/httpclient.jar" todir="lib" />
462
     <copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
463
   </target>
464
465 2461 sgarg
   <target name="getutilities" depends="prepare"
466
   description="Checks utility out of cvs and copies it to your metacat cvs sandbox">
467
     <echo>Enter CVS password: </echo>
468
     <cvs cvsRoot="${cvsroot}"
469 2468 sgarg
          package="${util-module}"
470 2461 sgarg
          dest="${build.tmp}" />
471
   </target>
472
473 1939 brooke
   <target name="client" depends="utilities, prepare"
474
    description="Compiles metacat-client java code to build dir">
475 1780 jones
       <javac srcdir="${build.src}"
476
              destdir="${build.dest}"
477 2599 jones
              includes="edu/ucsb/nceas/metacat/client/*">
478
          <classpath>
479
            <path refid="compile.classpath"/>
480
          </classpath>
481
        </javac>
482 1780 jones
   </target>
483
484 1939 brooke
   <target name="clientjar" depends="client"
485
    description="Compiles and jars metacat-client java code to metacat-client.jar in build dir">
486 1780 jones
       <delete file="${build.dir}/${name}-client.jar" />
487
       <jar jarfile="${build.dir}/${name}-client.jar" basedir="${build.dest}"
488
            includes="**/metacat/client/" />
489
   </target>
490
491 2748 costa
    <target name="advancedsearchjar" depends="compile"
492
            description="Compiles and jars advanced search Java code to advancedsearch.jar in build dir">
493
        <delete file="${build.dir}/advancedsearch.jar" />
494
        <jar jarfile="${build.dir}/advancedsearch.jar" basedir="${build.dest}"
495
             includes="**/metacat/advancedsearch/" />
496
    </target>
497
498 2059 costa
   <target name="harvester" depends="client"
499 1950 costa
           description="Compiles harvester java code to build dir">
500
       <javac srcdir="${build.src}"
501
              destdir="${build.dest}"
502 2599 jones
              includes="edu/ucsb/nceas/metacat/harvesterClient/*">
503
          <classpath>
504
            <path refid="compile.classpath"/>
505
          </classpath>
506
        </javac>
507 1950 costa
   </target>
508
509
   <target name="harvesterjar" depends="harvester"
510 2059 costa
           description="Compiles and jars harvester java code to harvester.jar in build dir">
511
       <delete file="${build.dir}/harvester.jar" />
512
       <jar jarfile="${build.dir}/harvester.jar" basedir="${build.dest}"
513 1950 costa
            includes="**/metacat/harvesterClient/" />
514
   </target>
515
516 2369 costa
   <target name="harvestListEditorDist" depends="harvesterjar"
517
           description="Prepares a distribution of the Harvest List Editor tool">
518 2401 costa
       <mkdir dir="${dist.dir.hle}"/>
519
       <delete dir="${ver.dir.hle}" />
520
       <mkdir dir="${ver.dir.hle}"/>
521
       <copy todir="${ver.dir.hle}" file="${build.dir}/harvester.jar"/>
522
       <copy todir="${ver.dir.hle}" file="lib/xercesImpl.jar"/>
523
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestList.xsd"/>
524
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestListEditor.bat"/>
525
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestListEditor.sh"/>
526
       <delete file="./harvest-list-editor-${release}.zip"/>
527
       <zip zipfile="./harvest-list-editor-${release}.zip" basedir="${ver.dir.hle}" />
528
       <delete file="./harvest-list-editor-${release}.tar.gz" />
529
       <tar tarfile="./harvest-list-editor-${release}.tar" basedir="${ver.dir.hle}" />
530
       <gzip zipfile="./harvest-list-editor-${release}.tar.gz"
531
             src="./harvest-list-editor-${release}.tar"/>
532
       <delete file="./harvest-list-editor-${release}.tar" />
533 2369 costa
   </target>
534
535 2318 jones
   <target  name="geteml" depends="getemlpre2,geteml2+" if="eml.required"
536 1939 brooke
            description="Calls getemlpre2 and geteml2+ targets" />
537
538 2318 jones
   <target name="getemlpre2" depends="prepare" if="eml.required"
539 1939 brooke
   description="Checks EML-beta6 out of cvs and copies dtds and xsl to your metacat cvs sandbox">
540 1612 tao
     <echo>Enter CVS password: </echo>
541
     <cvs cvsRoot="${cvsroot}"
542
          package="${eml-module}"
543
          tag="${eml-tag}"
544 1939 brooke
          dest="${build.tmp}/eml_${eml-tag}" />
545 1612 tao
     <mkdir dir="lib/dtd" />
546
     <copy todir="lib/dtd" filtering="yes">
547 1939 brooke
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}">
548 1612 tao
         <include name="*.dtd"/>
549
       </fileset>
550
       <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
551
     </copy>
552 2228 sgarg
553
     <copy todir="${style-common-cvsrelpath}" filtering="yes">
554
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}/style">
555
       <include name="**/*.xsl"/>
556
     </fileset>
557
     </copy>
558 1939 brooke
   </target>
559
560 2318 jones
   <target name="geteml2+" depends="prepare" if="eml.required"
561 1939 brooke
   description="Checks eml-2 out of cvs and copies schema and xsl to your metacat cvs sandbox">
562
     <echo>Enter CVS password: </echo>
563 1612 tao
     <cvs cvsRoot="${cvsroot}"
564
          package="${eml-module}"
565 2228 sgarg
          tag="${eml2_0_0-tag}"
566
          dest="${build.tmp}/eml_${eml2_0_0-tag}" />
567
     <mkdir dir="lib/schema/eml-2.0.0" />
568
     <copy todir="lib/schema/eml-2.0.0" filtering="yes">
569
       <fileset dir="${build.tmp}/eml_${eml2_0_0-tag}/${eml-module}">
570 1612 tao
         <include name="*.xsd"/>
571
       </fileset>
572 2175 tao
573 1939 brooke
       <!-- shouldn't we have a mapper here like this??
574
       <mapper type="glob" from="eml-*.xsd" to="eml-*-${eml-version}.xsd" />
575 2175 tao
576
       Jing's code didn't nave one - does it need to be added?
577 1939 brooke
       NOTE that eml-version is set to beta 6, so this would need changing -->
578 2175 tao
579 1612 tao
     </copy>
580 3018 sgarg
     <!-- <antcall target="copyxsl">
581 2228 sgarg
        <param name="cvs.tagname" value="${eml2_0_0-tag}" />
582
        <param name="dirname" value="eml-2.0.0" />
583 3018 sgarg
     </antcall> -->
584 3807 tao
585
   	<!-- Checkout eml201 for given schema tag-->
586 2228 sgarg
     <echo>Enter CVS password: </echo>
587
     <cvs cvsRoot="${cvsroot}"
588
          package="${eml-module}"
589 3807 tao
          tag="${eml2_0_1-schema-tag}"
590
          dest="${build.tmp}/eml_${eml2_0_1-schema-tag}" />
591 2228 sgarg
     <mkdir dir="lib/schema/eml-2.0.1" />
592
     <copy todir="lib/schema/eml-2.0.1" filtering="yes">
593 3807 tao
       <fileset dir="${build.tmp}/eml_${eml2_0_1-schema-tag}/${eml-module}">
594 2228 sgarg
         <include name="*.xsd"/>
595
       </fileset>
596
     </copy>
597 3807 tao
598
   	<!-- Checkout eml201 again for given style sheet tag-->
599
   	<echo>Enter CVS password: </echo>
600
   	     <cvs cvsRoot="${cvsroot}"
601
   	          package="${eml-module}"
602
   	          tag="${eml2_0_1-style-tag}"
603
   	          dest="${build.tmp}/eml_${eml2_0_1-style-tag}" />
604 2228 sgarg
     <antcall target="copyxsl">
605 3807 tao
        <param name="cvs.tagname" value="${eml2_0_1-style-tag}" />
606 2228 sgarg
        <param name="dirname" value="eml-2.0.1" />
607
     </antcall>
608 1939 brooke
   </target>
609
610 2175 tao
   <target  name="copyxsl"
611 1939 brooke
   description="Copies xsl stylesheets from checkout in build/tmp to your metacat cvs sandbox">
612
     <delete file="${style-common-cvsrelpath}/${eml-css}"/>
613 2175 tao
614 2228 sgarg
     <copy todir="${style-common-cvsrelpath}/${dirname}" filtering="yes">
615
       <fileset dir="${build.tmp}/eml_${cvs.tagname}/${eml-module}/style/eml">
616 1929 brooke
       <include name="**/*.xsl"/>
617 1612 tao
     </fileset>
618
     </copy>
619 1939 brooke
620 2175 tao
621
     <!-- now copy default css from eml module and put it in style-common-path
622 1933 brooke
          dir with a new name, so other skin-specific css can import it if reqd -->
623 1939 brooke
     <copy file="${build.tmp}/eml_${cvs.tagname}/${eml-module}/${eml-module.default.css}"
624 1938 brooke
           tofile="${style-common-cvsrelpath}/${eml-css}" />
625 1612 tao
626 1463 tao
   </target>
627 2175 tao
628
629
630 2322 jones
   <target name="register-schemas" depends="prepare"
631
   description="Registers the Schemas with a new Metacat instance">
632 877 jones
     <echo/>
633 2322 jones
     <echo>Registering the Schemas with the new Metacat instance...</echo>
634 877 jones
     <sql driver="${dbDriver}"
635
          url="${jdbc-connect}"
636
          userid="${user}"
637
          password="${password}"
638 2599 jones
          src="${build.src}/loaddtdschema.sql">
639
       <classpath>
640
         <path refid="compile.classpath"/>
641
       </classpath>
642
     </sql>
643 877 jones
   </target>
644 1716 berkley
645 1939 brooke
   <target name="installdb" depends="prepare"
646
            description="Installs the database tables">
647 1827 jones
     <echo/>
648
     <echo>Installing the database tables...</echo>
649 2445 sgarg
     <echo>In case of failure, run the sql script manually. Look at Metacat install instructions for more details</echo>
650 2599 jones
     <echo/>
651 1827 jones
     <sql driver="${dbDriver}"
652
          url="${jdbc-connect}"
653
          userid="${user}"
654
          password="${password}"
655 2599 jones
          src="${build.src}/${install-sql}">
656
       <classpath>
657
         <path refid="compile.classpath"/>
658
       </classpath>
659
     </sql>
660 1827 jones
   </target>
661
662 2599 jones
   <target name="dropdb" depends="prepare"
663
            description="WARNING: Drops the database tables">
664
     <echo/>
665
     <echo>Dropping the database tables...</echo>
666
     <echo>In case of failure, run the sql script manually. Look at Metacat install instructions for more details</echo>
667
     <echo/>
668
     <sql driver="${dbDriver}"
669
          url="${jdbc-connect}"
670
          userid="${user}"
671
          password="${password}"
672
          src="${build.src}/drop-postgres.sql">
673
       <classpath>
674
         <path refid="compile.classpath"/>
675
       </classpath>
676
     </sql>
677
   </target>
678
679 1939 brooke
   <target name="upgrade12" depends="prepare"
680
            description="Updates the database tables to upgrade to version 1.2">
681 1827 jones
     <echo/>
682
     <echo>Updating the database tables to upgrade to version 1.2...</echo>
683
     <sql driver="${dbDriver}"
684
          url="${jdbc-connect}"
685
          userid="${user}"
686
          password="${password}"
687 2599 jones
          src="${build.src}/${upgrade-1.2-sql}">
688
       <classpath>
689
         <path refid="compile.classpath"/>
690
       </classpath>
691
     </sql>
692 1827 jones
   </target>
693
694 1939 brooke
   <target name="upgrade13" depends="prepare"
695
            description="Updates the database tables to upgrade to version 1.3">
696 1827 jones
     <echo/>
697
     <echo>Updating the database tables to upgrade to version 1.3...</echo>
698
     <sql driver="${dbDriver}"
699
          url="${jdbc-connect}"
700
          userid="${user}"
701
          password="${password}"
702 2599 jones
          src="${build.src}/${upgrade-1.3-sql}">
703
       <classpath>
704
         <path refid="compile.classpath"/>
705
       </classpath>
706
     </sql>
707 1827 jones
   </target>
708
709 2103 jones
   <target name="upgrade14" depends="prepare"
710
            description="Updates the database tables to upgrade to version 1.4">
711
     <echo/>
712
     <echo>Updating the database tables to upgrade to version 1.4...</echo>
713
     <sql driver="${dbDriver}"
714
          url="${jdbc-connect}"
715
          userid="${user}"
716
          password="${password}"
717 2599 jones
          src="${build.src}/${upgrade-1.4-sql}">
718
       <classpath>
719
         <path refid="compile.classpath"/>
720
       </classpath>
721
     </sql>
722 2103 jones
   </target>
723
724 2395 tao
   <target name="upgrade15" depends="sqlupgrade15"
725 2391 tao
           description="Updates the database tables to upgrade to version 1.5">
726 2353 sgarg
     <echo/>
727 2461 sgarg
     <echo>Updating the database tables to upgrade to version 1.5...</echo>
728 2353 sgarg
     <copy file="${srcdir}/upgrade_db_to_1_5.java"
729 2391 tao
           todir="${build.tmp}" filtering="yes"/>
730 2461 sgarg
731 2353 sgarg
     <javac srcdir="${build.tmp}"
732
            destdir="${build.tmp}"
733
            debug="${debug}"
734 2599 jones
            includes="upgrade_db_to_1_5.java">
735
       <classpath>
736
         <path refid="compile.classpath"/>
737
       </classpath>
738
     </javac>
739 2461 sgarg
740 2599 jones
     <java classname="upgrade_db_to_1_5">
741
       <classpath>
742
         <path refid="compile.classpath"/>
743
         <fileset dir="${build.tmp}"/>
744
       </classpath>
745
     </java>
746 2353 sgarg
747 2393 tao
   </target>
748 2461 sgarg
749 2518 sgarg
   <target name="upgrade16" depends="prepare"
750
            description="Updates the database tables from version 1.5 to version 1.6">
751
     <echo/>
752
     <echo>Updating the database tables to upgrade to version 1.6...</echo>
753
     <sql driver="${dbDriver}"
754
          url="${jdbc-connect}"
755
          userid="${user}"
756
          password="${password}"
757 2599 jones
          src="${build.src}/${upgrade-1.6-sql}">
758
       <classpath>
759
         <path refid="compile.classpath"/>
760
       </classpath>
761
     </sql>
762 2518 sgarg
   </target>
763
764 3128 perry
   <target name="upgrade17" depends="prepare"
765
            description="Updates the database tables from version 1.6 to version 1.7">
766
     <echo/>
767
     <echo>Updating the database tables to upgrade to version 1.7...</echo>
768
     <sql driver="${dbDriver}"
769
          url="${jdbc-connect}"
770
          userid="${user}"
771
          password="${password}"
772
          src="${build.src}/${upgrade-1.7-sql}">
773
       <classpath>
774
         <path refid="compile.classpath"/>
775
       </classpath>
776
     </sql>
777
   </target>
778 3335 tao
779 3610 tao
   <target name="upgrade18" depends="prepare"
780
	            description="Updates the database tables from version 1.7 to version 1.8">
781 3335 tao
	     <echo/>
782 3610 tao
	     <echo>Updating the database tables to upgrade to version 1.8...</echo>
783 3335 tao
	     <sql driver="${dbDriver}"
784
	          url="${jdbc-connect}"
785
	          userid="${user}"
786
	          password="${password}"
787 3610 tao
	          src="${build.src}/${upgrade-1.8-sql}">
788 3335 tao
	       <classpath>
789
	         <path refid="compile.classpath"/>
790
	       </classpath>
791
	     </sql>
792
   </target>
793 2518 sgarg
794 2395 tao
   <target name="sqlupgrade15" depends="prepare">
795
      <echo>Updating the database tables to upgrade to version 1.5 by sql command</echo>
796 2393 tao
      <sql driver="${dbDriver}"
797
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
798
          url="${jdbc-connect}"
799
          userid="${user}"
800
          password="${password}"
801
          src="${build.src}/${upgrade-1.5-sql}" />
802 2444 sgarg
      <sql driver="${dbDriver}"
803
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
804
          url="${jdbc-connect}"
805
          userid="${user}"
806
          password="${password}"
807
          rdbms="oracle"
808
          delimiter="/">
809
        <transaction>
810
           CREATE TRIGGER xml_returnfield_before_insert
811
           BEFORE INSERT ON xml_returnfield FOR EACH ROW
812
           BEGIN
813
              SELECT xml_returnfield_id_seq.nextval
814
                 INTO :new.returnfield_id
815
                 FROM dual;
816
           END;
817
           /
818
        </transaction>
819
        <transaction>
820
           CREATE TRIGGER xml_queryresult_before_insert
821
           BEFORE INSERT ON xml_queryresult FOR EACH ROW
822
           BEGIN
823
              SELECT xml_queryresult_id_seq.nextval
824
              INTO :new.queryresult_id
825
              FROM dual;
826
           END;
827
           /
828
        </transaction>
829
      </sql>
830 2393 tao
   </target>
831 3817 tao
832
   <target name="correctEML201Docs" depends="jar"
833
		            description="Uses the ant  task to run a JAVA patch class to correct invalide eml201 documents which were generated by wrong schema">
834
	   	<copy todir="${build.dir}" file="lib/metacat.properties" filtering="yes"/>
835
	   	 <java classname="edu.ucsb.nceas.metacat.EML201DocumentCorrector" >
836
		         <classpath>
837
		          <path refid="compile.classpath"/>
838
		          <fileset dir="${build.dir}">
839
		            <include name="${name}.jar"/>
840
		          </fileset>
841
		        </classpath>
842
		      </java>
843
   </target>
844 2353 sgarg
845 3072 perry
   <target name="install-spatial" depends="jar,clientjar,harvesterjar"
846 3034 perry
           description="Installs spatial option for metacat">
847
848
      <property name="spatial.dir" value="./lib/spatial"/>
849
      <property name="spatial.geoserver.dir" value="${spatial.dir}/geoserver"/>
850
      <property name="spatial.webinf-mods" value="${spatial.dir}/WEB-INF"/>
851
852
      <!-- Copy geoserver libs into ${war.lib} -->
853
      <copy todir="${war.lib}" filtering="no">
854
        <fileset dir="${spatial.geoserver.dir}/WEB-INF/lib">
855
          <include name="**"/>
856
        </fileset>
857
      </copy>
858
859
      <!-- Copy everything in geoservers WEB-INF (except the libs) into ${war.webinf} -->
860
      <copy todir="${war.webinf}" filtering="no">
861
        <fileset dir="${spatial.geoserver.dir}/WEB-INF">
862
          <exclude name="lib/**"/>
863
          <exclude name="web.xml"/>
864
        </fileset>
865
      </copy>
866
867
      <!-- Copy the rest of the geoserver codebase into ${war.context} -->
868
      <copy todir="${war.context}" filtering="no">
869
        <fileset dir="${spatial.geoserver.dir}">
870
          <exclude name="WEB-INF/**"/>
871
          <exclude name="index.jsp"/>
872
        </fileset>
873
      </copy>
874
875
      <!-- Copy the geoserver index.jsp but rename it to avoid conflicting w/metcat   -->
876
     <copy file="${spatial.geoserver.dir}/WEB-INF/pages/index.jsp"
877
          tofile="${war.context}/geoserver.jsp"
878
          overwrite="true"
879
          filtering="no"/>
880
881
      <!-- Copy the rest of the modified geoserver web-inf files
882
      <copy todir="${war.webinf}" filtering="no">
883
        <fileset dir="${spatial.webinf-mods}">
884
          <exclude name="web.xml.combined"/>
885
        </fileset>
886
      </copy> -->
887
888
    </target>
889
890
891 2957 tao
   <target name="install" depends="install-ecogrid" description="* Full Install *">
892 1079 tao
       <mkdir dir="${datafilepath}" />
893 1455 tao
       <mkdir dir="${inlinedatafilepath}" />
894 1079 tao
       <chmod dir="${datafilepath}" perm="ug+w" />
895 1929 brooke
       <mkdir dir="${temp-dir}"/>
896
       <chmod dir="${temp-dir}" perm="ug+w" />
897 2737 jones
       <copy file="${dist.dir}/${metacat.context}.war" todir="${deploy.dir}"/>
898 2993 tao
   	   <echo>If you enable ecogrid installation, please run "ant deploy-ecogrid" when installation or upgrade is done</echo>
899 1952 jones
   </target>
900 2957 tao
901 2965 tao
   <target name="install-ecogrid" depends="war, get-ecogrid" if="enable.ecogrid"
902 2957 tao
			    description="Install Ecogrid Compentent">
903 2965 tao
   	  <copyfile src="lib/metacat.url" dest="${ecogrid-dir}/conf/MetacatImpl/classes/metacat.properties" forceoverwrite="true" filtering="yes"/>
904 2991 berkley
   	  <ant antfile="build.xml" dir="${ecogrid-dir}" target ="clean" inheritall="false">
905 2977 tao
   	         <property name="context" value="${metacat.context}"/>
906
   	   	     <property name="target" value="${ecogrid-target-name}"/>
907
   	   	     <property name="metacat.dir" value="${metacat.dir}"/>
908
   	  </ant>
909 2991 berkley
   	  <ant antfile="build.xml" dir="${ecogrid-dir}" target ="war" inheritall="false">
910 2957 tao
   	     <property name="context" value="${metacat.context}"/>
911
   	     <property name="target" value="${ecogrid-target-name}"/>
912 2965 tao
   	     <property name="metacat.dir" value="${metacat.dir}"/>
913 2957 tao
   	  </ant>
914 2978 tao
   	  <war destfile="${ecogrid-dir}/build/${metacat.context}.war" update="true">
915
  	      <webinf dir="${ecogrid-dir}/lib">
916
   	        <include name="server-config.wsdd"/>
917
   	      </webinf>
918
   	  </war>
919 2965 tao
   	  <copy file="${ecogrid-dir}/build/${metacat.context}.war" todir="${dist.dir}" overwrite="true"/>
920 2978 tao
921
922 2957 tao
   </target>
923 2965 tao
924
   <target name="get-ecogrid" depends="init" if="ecogrid.required" description="Check out ecogrid module">
925
	<echo>Enter CVS password: </echo>
926
	     <cvs cvsRoot="${cvsroot}"
927
	          package="${ecogrid-module}" dest="${ecogrid-module-dest-dir}"/>
928
   </target>
929
930
931 2175 tao
   <target name="upgrade" depends="install"
932 1952 jones
          description="* Upgrade an existing metacat installation with a new version *">
933 2737 jones
       <unwar src="${deploy.dir}/${metacat.context}.war" dest="${deploy.dir}/${metacat.context}" />
934 1952 jones
   </target>
935 2957 tao
936 2978 tao
   <target name="deploy-ecogrid" depends="clean-ecogrid-server-config-wsdd" if="enable.ecogrid" description="Automately generate wsdd for ecogrid service">
937 2991 berkley
   	 <ant antfile="build.xml" dir="${ecogrid-dir}" target ="deploy" inheritall="false">
938 2957 tao
   	   	 <property name="context" value="${metacat.context}"/>
939
   	   	 <property name="target" value="${ecogrid-target-name}"/>
940 2965 tao
   	     <property name="metacat.dir" value="${metacat.dir}"/>
941 3467 tao
   	     <property name="hostname" value="localhost"/>
942 2977 tao
   	     <property name="port" value="${config.port}"/>
943 2957 tao
   	 </ant>
944
   </target>
945 2978 tao
946
   <target name="clean-ecogrid-server-config-wsdd" depends="init" description="Automately generate wsdd for ecogrid service">
947
      <delete file="${deploy.dir}/${metacat.context}/WEB-INF/server-config.wsdd"/>
948
   </target>
949 1952 jones
950 2175 tao
   <target name="install-registry" depends="init,getConversionXSL"
951 1952 jones
            description="Install Registry">
952 2175 tao
953 1952 jones
      <copy file="${srcdir}/perl/register-dataset.cgi"
954
            todir="${inst.cgi.dir}" filtering="yes"/>
955
      <chmod file="${inst.cgi.dir}/register-dataset.cgi" perm="ugo+x" />
956 2175 tao
957 1952 jones
      <mkdir dir="${temp-dir}" />
958 2343 sgarg
      <copy todir="${temp-dir}" filtering="yes">
959
       <fileset dir="lib/style/common/emlb6toeml2">
960 1952 jones
         <include name="*.xsl"/>
961
         <include name="*.xml"/>
962
       </fileset>
963 2343 sgarg
      </copy>
964 1952 jones
965
      <echo message="Install Registry completed." />
966
   </target>
967
968 2343 sgarg
   <target name="install-ldap" depends="init">
969
      <copy file="${srcdir}/perl/ldapweb.cgi"
970
            todir="${inst.cgi.dir}" filtering="yes"/>
971
      <chmod file="${inst.cgi.dir}/ldapweb.cgi" perm="ugo+x" />
972
      <copy file="lib/ldapweb.cfg"
973
            todir="${inst.cgi.dir}" filtering="yes"/>
974
      <chmod file="${inst.cgi.dir}/ldapweb.cfg" perm="ugo+x" />
975
      <mkdir dir="${templates.dir}" />
976
      <copy todir="${templates.dir}" filtering="yes">
977
        <fileset dir="lib/style/common/templates">
978
            <include name="${defaultChangePass}"/>
979
            <include name="${defaultResetPass}"/>
980
            <include name="${changePassSuccess}"/>
981
            <include name="${resetPassSuccess}"/>
982
            <include name="${registerFailed}"/>
983
            <include name="${registerLter}"/>
984
            <include name="${registerMatch}"/>
985
            <include name="${registerSuccess}"/>
986
            <include name="${register}"/>
987
            <include name="${searchResults}"/>
988 2974 jones
            <include name="${defaultHeader}"/>
989
            <include name="${defaultFooter}"/>
990
            <include name="${responseForm}"/>
991 3174 tao
        	<include name="${ldapMainServerFailure}"/>
992 2343 sgarg
        </fileset>
993
      </copy>
994
      <echo message="ldapweb install complete." />
995
   </target>
996
997
998 2175 tao
   <target name="install-skin" depends="init"
999 2052 sgarg
            description="Install a Skin">
1000
1001 3994 berkley
      <input message="Please enter name of the skin"
1002
             addproperty="skin-name"/>
1003 2052 sgarg
1004
      <mkdir dir="${installdir}/style/skins/${skin-name}" />
1005
      <copy todir="${installdir}/style/skins/${skin-name}" filtering="yes">
1006
       <fileset dir="lib/style/skins/${skin-name}">
1007 3014 costa
           <exclude name="**/*.png"/>
1008
           <exclude name="**/*.gif"/>
1009
           <exclude name="**/*.jpg"/>
1010 2277 jones
           <exclude name="**/CVS*"/>
1011
           <exclude name="**/.#*"/>
1012 2052 sgarg
       </fileset>
1013
      </copy>
1014 2054 sgarg
     <copy todir="${installdir}/style/skins/${skin-name}" filtering="no">
1015
       <fileset dir="lib/style/skins/${skin-name}">
1016 3014 costa
           <include name="**/*.png"/>
1017 3994 berkley
           <include name="**/*.gif"/>
1018 3014 costa
           <include name="**/*.jpg"/>
1019 2277 jones
           <exclude name="**/CVS*"/>
1020
           <exclude name="**/.#*"/>
1021 2054 sgarg
       </fileset>
1022
      </copy>
1023 2974 jones
      <copy todir="${installdir}/style/common" filtering="yes">
1024
       <fileset dir="lib/style/common">
1025
           <include name="*.js"/>
1026
           <include name="*.jsp"/>
1027
           <include name="*.css"/>
1028
           <exclude name="*.png"/>
1029
           <exclude name="*.gif"/>
1030
           <exclude name="*.jpg"/>
1031
           <exclude name="**/CVS*"/>
1032
           <exclude name="**/.#*"/>
1033
       </fileset>
1034
      </copy>
1035 2277 jones
      <!--
1036 2210 jones
      <mkdir dir="${installdir}/style/skins/${skin-name}/images" />
1037
     <copy todir="${installdir}/style/skins/${skin-name}/images" filtering="no">
1038
       <fileset dir="lib/style/skins/${skin-name}/images">
1039
           <include name="*.png"/>
1040
           <include name="*.gif"/>
1041
           <include name="*.jpg"/>
1042
       </fileset>
1043
      </copy>
1044 2277 jones
      -->
1045 2052 sgarg
1046
      <echo message="Install Skin completed." />
1047
   </target>
1048
1049 3034 perry
   <target name="war" depends="warPrepare,warMSSQL,install-spatial"
1050 1952 jones
            description="Create a web archive (WAR) for servlet deployment">
1051 2737 jones
       <mkdir dir="${dist.dir}" />
1052
       <war destfile="${dist.dir}/${metacat.context}.war"
1053 1952 jones
            webxml="${build.war}/web.xml">
1054
         <fileset dir="${war.context}"/>
1055
         <lib dir="${war.lib}"/>
1056
         <webinf dir="${war.webinf}"/>
1057
       </war>
1058
   </target>
1059 2957 tao
1060
1061 1952 jones
1062 2059 costa
   <target name="warPrepare" depends="jar,clientjar,harvesterjar"
1063 1952 jones
            description="Prepare files for creating a web archive (WAR)">
1064
1065
       <property name="war.lib" value="${build.war}/lib" />
1066
       <property name="war.webinf" value="${build.war}/WEB-INF" />
1067 2737 jones
       <property name="war.context" value="${build.war}/${metacat.context}" />
1068 1952 jones
       <mkdir dir="${war.lib}" />
1069
       <mkdir dir="${war.webinf}" />
1070
       <mkdir dir="${war.context}" />
1071 2610 tao
1072
       <copy file="${jdbc}" tofile="${war.lib}/jdbc.jar" />
1073 1952 jones
       <copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
1074
       <copy file="${build.dir}/${name}-client.jar" todir="${war.lib}" />
1075 2059 costa
       <copy file="${build.dir}/harvester.jar" todir="${war.lib}" />
1076 1952 jones
       <copy todir="${war.lib}" filtering="no">
1077 1823 jones
         <fileset dir="lib">
1078 2610 tao
            <not>
1079
               <filename name="${jdbc-jar-name}"/>
1080
            </not>
1081
            <include name="*.jar"/>
1082 1823 jones
         </fileset>
1083 3059 berkley
         <fileset dir="lib">
1084
           <include name="xalan.jar"/>
1085 3194 berkley
           <include name="gwt*.jar"/>
1086 1823 jones
         </fileset>
1087
       </copy>
1088 1729 tao
       <copy file="lib/web.xml.${tomcatversion}"
1089 1952 jones
             tofile="${build.war}/web.xml" />
1090
       <copy file="lib/metacat.properties" todir="${war.webinf}"
1091 1951 jones
             filtering="yes" />
1092 3099 jones
   	   <copy file="lib/metacat.properties.metadata" todir="${war.webinf}"
1093
   	             filtering="no" />
1094 2900 sgarg
       <copy todir="${war.webinf}" filtering="yes">
1095
	   	  <fileset dir="lib">
1096
           <include name="skin.configs/**"/>
1097
		  </fileset>
1098
	   </copy>
1099 2583 sgarg
       <copy file="lib/log4j.properties" todir="${war.webinf}"
1100
             filtering="yes" />
1101 1952 jones
       <copy todir="${war.context}" filtering="no">
1102 822 jones
         <fileset dir="lib">
1103
           <include name="**/*.jpg"/>
1104
           <include name="**/*.png"/>
1105
           <include name="**/*.gif"/>
1106 2844 costa
           <include name="LiveMap_30/**"/>
1107 822 jones
         </fileset>
1108
       </copy>
1109 1952 jones
       <copy todir="${war.context}" filtering="yes">
1110 822 jones
         <fileset dir="lib">
1111
           <exclude name="*.jar"/>
1112
           <exclude name="*.properties"/>
1113 3099 jones
         	<exclude name="*.metadata"/>
1114 822 jones
           <exclude name="web.xml"/>
1115 1437 berkley
           <exclude name="**/*.jpg"/>
1116
           <exclude name="**/*.png"/>
1117
           <exclude name="**/*.gif"/>
1118 2778 jones
           <exclude name="lsid_lib/**"/>
1119
           <exclude name="lsid_conf/**"/>
1120 2844 costa
           <exclude name="LiveMap_30/**"/>
1121 2900 sgarg
           <exclude name="skin.configs/**"/>
1122 3034 perry
           <exclude name="spatial/geoserver/**"/>
1123
           <exclude name="spatial/WEB-INF/**"/>
1124 822 jones
         </fileset>
1125
       </copy>
1126 1311 berkley
   </target>
1127 1929 brooke
1128 1952 jones
   <target name="warMSSQL" if="MSSQL" depends="warPrepare">
1129
      <copy file="${jdbc-add1}" tofile="${war.lib}/msutil.jar" />
1130
       <copy file="${jdbc-add2}" tofile="${war.lib}/mssqlserver.jar" />
1131 1929 brooke
   </target>
1132
1133 2175 tao
   <target name="getConversionXSL" depends="prepare"
1134 1954 jones
            unless="styles.not.needed"
1135 1939 brooke
            description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
1136 2497 sgarg
1137 1929 brooke
     <echo>Enter CVS password: </echo>
1138 2497 sgarg
     <cvs cvsRoot="${cvsroot}"
1139
          package="${eml-module}"
1140 3909 tao
          tag="${eml2_0_1-style-tag}"
1141
          dest="${build.tmp}/eml_${eml2_0_1-style-tag}" />
1142 2343 sgarg
1143
     <mkdir dir="lib/style/common/emlb6toeml2" />
1144
      <copy todir="lib/style/common/emlb6toeml2" filtering="yes">
1145 3909 tao
       <fileset dir="${build.tmp}/eml_${eml2_0_1-style-tag}/${eml-module}/lib/beta6toeml2/xsl">
1146 2343 sgarg
         <include name="*.xsl"/>
1147
         <include name="*.xml"/>
1148
       </fileset>
1149
      </copy>
1150 1929 brooke
   </target>
1151
1152 2135 costa
   <target name="testprep" depends="jar,clientjar,harvesterjar">
1153 1783 jones
      <mkdir dir="${build.tests}"/>
1154
      <copy todir="${build.tests}" filtering="yes">
1155
        <fileset dir="${testdir}">
1156
          <include name="edu/**"/>
1157
        </fileset>
1158
      </copy>
1159 3524 tao
   	<copy todir="${build.tests}" file="lib/metacat.properties" filtering="yes">
1160
1161
   	 </copy>
1162 971 tao
      <!-- copy and compile the tests into a jar file -->
1163 1783 jones
      <javac srcdir="${build.tests}"
1164
             destdir="${build.tests}"
1165 1612 tao
             debug="on"
1166 2982 jones
             includes="**/*.java">
1167 2599 jones
        <classpath>
1168
          <path refid="compile.classpath"/>
1169
          <fileset dir="${build.dir}">
1170 2982 jones
            <include name="${name}.jar"/>
1171
            <include name="${name}-client.jar"/>
1172
            <include name="harvester.jar"/>
1173 2599 jones
          </fileset>
1174
        </classpath>
1175
      </javac>
1176 204 jones
1177 1311 berkley
      <jar jarfile="${build.dir}/${name}-junittests.jar"
1178 1783 jones
        basedir="${build.tests}"
1179 1311 berkley
                includes="**/*.class" />
1180 1822 jones
   </target>
1181 971 tao
1182 1939 brooke
   <target name="test" depends="testprep"
1183
            description="Uses the ant junit task to run all JUnit tests">
1184 1822 jones
1185 971 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
1186 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1187 971 tao
             haltonerror="no">
1188 1783 jones
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
1189 971 tao
        <classpath>
1190 2599 jones
          <path refid="compile.classpath"/>
1191
          <fileset dir="${build.dir}">
1192 2982 jones
            <include name="${name}.jar"/>
1193
            <include name="${name}-client.jar"/>
1194
            <include name="harvester.jar"/>
1195
            <include name="${name}-junittests.jar"/>
1196 2599 jones
          </fileset>
1197 971 tao
        </classpath>
1198
1199
        <formatter type="plain" />
1200
1201
        <batchtest fork="yes" todir="${build.dir}">
1202 1783 jones
          <fileset dir="${build.tests}">
1203 1116 tao
            <include name="**/*.class" />
1204 971 tao
          </fileset>
1205
        </batchtest>
1206
     </junit>
1207
   </target>
1208 1103 tao
1209 1939 brooke
    <target name="runonetest" depends="testprep"
1210
            description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
1211 1500 tao
1212 1939 brooke
              <echo>testtorun: ${testtorun}</echo>
1213
1214 1500 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
1215 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1216 3747 tao
             haltonerror="no" showoutput="yes">
1217 2044 tao
        <!--<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>-->
1218 1500 tao
        <classpath>
1219 2599 jones
          <path refid="compile.classpath"/>
1220
          <fileset dir="${build.dir}">
1221 2982 jones
            <include name="${name}.jar"/>
1222
            <include name="${name}-client.jar"/>
1223
            <include name="harvester.jar"/>
1224
            <include name="${name}-junittests.jar"/>
1225 2599 jones
          </fileset>
1226 1500 tao
        </classpath>
1227
1228
        <formatter type="plain" />
1229
1230
        <batchtest fork="yes" todir="${build.dir}">
1231 1783 jones
          <fileset dir="${build.tests}">
1232 1500 tao
            <include name="**/${testtorun}.class" />
1233
          </fileset>
1234
        </batchtest>
1235
     </junit>
1236
   </target>
1237
1238 2175 tao
   <target name="testharvester"
1239 2135 costa
           depends="testprep"
1240
           description="Uses the ant junit task to test only the Harvester code">
1241 2175 tao
     <junit printsummary="yes"
1242
            haltonfailure="off"
1243 2135 costa
            fork="yes"
1244
            haltonerror="off">
1245 2599 jones
        <classpath>
1246
          <path refid="compile.classpath"/>
1247
          <fileset dir="${build.dir}">
1248 2982 jones
            <include name="${name}.jar"/>
1249
            <include name="${name}-client.jar"/>
1250
            <include name="harvester.jar"/>
1251
            <include name="${name}-junittests.jar"/>
1252 2599 jones
          </fileset>
1253
        </classpath>
1254 2135 costa
       <formatter type="plain" />
1255
       <batchtest fork="yes" todir="${build.dir}">
1256
         <fileset dir="${build.tests}">
1257
           <include name="**/harvesterClient/*.class" />
1258
         </fileset>
1259
       </batchtest>
1260
     </junit>
1261
   </target>
1262
1263 1939 brooke
  <target name="gethttpclient" depends="prepare"
1264
            description="checks out and compiles morpho httpclient code">
1265 1311 berkley
  <!--mkdir dir="${morphosourcedir}" -->
1266 1487 tao
        <cvs cvsRoot="${cvsroot}"
1267 1103 tao
             package="morpho"
1268
             dest="." />
1269 1107 tao
        <ant dir="${morphosourcedir}" inheritAll="false"  target="jar" />
1270 1103 tao
   </target>
1271
1272
   <!-- run this target, we need to check out a another morpho souce dir was checked out. -->
1273 1939 brooke
   <target name="nettest" depends="install"
1274
            description="compiles and runs the metacatnettest code">
1275 2175 tao
1276 1103 tao
      <echo>***********************************
1277 1311 berkley
      Please run ant gethttpclient first!
1278
      ***********************************
1279 1103 tao
      </echo>
1280
      <!-- copy and compile the tests into a jar file -->
1281 1116 tao
      <mkdir dir="${build.metacatnettest}"/>
1282 1103 tao
      <javac srcdir="${junitnettestsdir}"
1283 1116 tao
             destdir="${build.metacatnettest}"
1284 2599 jones
             includes="**/*.java">
1285
        <classpath>
1286
          <path refid="compile.classpath"/>
1287
          <fileset dir="${build.dir}">
1288 2982 jones
            <include name="${name}.jar"/>
1289 2599 jones
          </fileset>
1290
        </classpath>
1291
      </javac>
1292 1103 tao
1293
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
1294 1116 tao
                    basedir="${build.metacatnettest}"
1295 1103 tao
                    includes="**/*.class" />
1296
1297
      <!-- use the ant "junit" task to run JUnit tests. -->
1298 1107 tao
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1299 1103 tao
             haltonerror="no">
1300 1107 tao
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1301 1103 tao
        <classpath>
1302 2599 jones
          <path refid="compile.classpath"/>
1303
          <fileset dir="${build.dir}">
1304 2982 jones
            <include name="${name}.jar"/>
1305
            <include name="${name}-junitnettests.jar"/>
1306 2599 jones
          </fileset>
1307 1103 tao
        </classpath>
1308
1309
        <formatter type="plain" />
1310
1311
        <batchtest fork="yes" todir="${build.dir}">
1312 1116 tao
          <fileset dir="${build.metacatnettest}">
1313
            <include name="**/*.class" />
1314 1103 tao
          </fileset>
1315
        </batchtest>
1316
     </junit>
1317 1311 berkley
   </target>
1318 1103 tao
1319 1939 brooke
   <target name="cleanweb" depends="clean"
1320
            description="deletes tomcat web context dir and all its contents">
1321 1522 berkley
     <delete dir="${installdir}" />
1322
   </target>
1323
1324
1325 1939 brooke
   <target name="clean" depends="init"
1326 2320 jones
            description="deletes build dir and files that can be regenerated form the release">
1327 822 jones
       <delete dir="${build.dir}" />
1328 2737 jones
       <delete dir="${dist.dir}" />
1329 2320 jones
   </target>
1330
1331
   <target name="fullclean" depends="clean"
1332
            description="deletes even jars that depend on external sources such as stylesheets and jars">
1333
       <delete file="lib/httpclient.jar" />
1334
       <delete file="lib/utilities.jar" />
1335 1939 brooke
       <delete includeEmptyDirs="true" failonerror="false">
1336
         <fileset dir="${style-common-cvsrelpath}">
1337
           <include name="${eml-css}" />
1338
           <include name="eml-*/*.xsl" />
1339
           <include name="eml-*" />
1340
         </fileset>
1341 2320 jones
       </delete>
1342 113 jones
   </target>
1343
1344 1939 brooke
   <target name="jdoc" depends="prepare"
1345
            description="generates javadoc documentation">
1346 822 jones
       <javadoc packagenames="edu.ucsb.nceas.*"
1347 516 jones
           sourcepath="${build.src}"
1348
           destdir="${build.javadocs}"
1349 113 jones
           author="true"
1350
           version="true"
1351
           use="true"
1352 348 jones
           windowtitle="${Name} API"
1353
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
1354 2599 jones
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;">
1355
         <classpath>
1356
           <path refid="compile.classpath"/>
1357
         </classpath>
1358
       </javadoc>
1359 113 jones
   </target>
1360
1361 2461 sgarg
   <target name="dist"
1362 2965 tao
       depends="geteml,get-ecogrid,jar,protocol,jdoc,getConversionXSL,getutilities"
1363 1939 brooke
            description="prepares a full release distribution">
1364 806 jones
      <mkdir dir="${dist.dir}"/>
1365
      <delete dir="${ver.dir}" />
1366
      <mkdir dir="${ver.dir}"/>
1367
      <copy todir="${ver.dir}">
1368 1311 berkley
        <fileset dir="."
1369 2401 costa
            excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/**"/>
1370 806 jones
      </copy>
1371
      <copy todir="${ver.dir}" file="build.xml"/>
1372 2317 jones
      <copy todir="${ver.dir}" file="build.properties"/>
1373 882 jones
1374
      <copy todir="${ver.dir}/docs" filtering="yes">
1375
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1376
      </copy>
1377
      <copy todir="${ver.dir}/docs" filtering="no">
1378
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1379
      </copy>
1380 806 jones
      <copy todir="${ver.dir}/docs/dev">
1381
        <fileset dir="${build.dir}/docs"/>
1382
      </copy>
1383 917 berkley
      <copy todir="${ver.dir}/src">
1384
        <fileset dir="${build.dir}/src"/>
1385
      </copy>
1386 2391 tao
      <!-- copy loaddtdschemal.sql form src dir(which has the server token to ver.dir/src-->
1387
      <copy todir="${ver.dir}/src" file="${srcdir}/loaddtdschema.sql" overwrite="yes" filtering="no"/>
1388 2395 tao
      <copy todir="${ver.dir}/src" file="${srcdir}/upgrade-db-to-1.5.sql" overwrite="yes" filtering="no"/>
1389 2323 jones
      <!--
1390 992 berkley
      <delete dir="./${ver.dir}/${build.dir}"/>
1391
      <delete dir="./${ver.dir}/dist"/>
1392 2323 jones
      -->
1393 882 jones
      <delete file="./${name}-${release}.zip"/>
1394 1312 tao
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1395 882 jones
      <delete file="./${name}-${release}.tar.gz" />
1396 1312 tao
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1397 1311 berkley
      <gzip zipfile="./${name}-${release}.tar.gz"
1398 882 jones
                src="./${name}-${release}.tar"/>
1399
      <delete file="./${name}-${release}.tar" />
1400 1311 berkley
  </target>
1401 806 jones
1402 1939 brooke
  <target name="distsrc" depends="dist"
1403
            description="prepares a source distribution">
1404 806 jones
      <mkdir dir="${ver.src}"/>
1405
      <copy todir="${ver.src}">
1406
        <fileset dir="./src"/>
1407
      </copy>
1408 2461 sgarg
      <mkdir dir="${util.dir}"/>
1409
      <copy todir="${util.dir}">
1410
        <fileset dir="${build.tmp}/utilities" excludes="**/CVS*" />
1411
      </copy>
1412 2965 tao
1413
  	  <mkdir dir="${ecogrid-dist-dir}"/>
1414
  	  <copy todir="${ecogrid-dist-dir}">
1415
  	        <fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1416
  	  </copy>
1417 806 jones
1418 3131 perry
      <delete file="${ver.dir}/lib/utilities.jar"/>
1419
1420 882 jones
      <delete file="./${name}-src-${release}.zip"/>
1421
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
1422
      <delete file="./${name}-src-${release}.tar.gz" />
1423
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
1424 1311 berkley
      <gzip zipfile="./${name}-src-${release}.tar.gz"
1425 882 jones
                src="./${name}-src-${release}.tar"/>
1426
      <delete file="./${name}-src-${release}.tar" />
1427 3131 perry
      <delete dir="${dist.dir}"/>
1428 1311 berkley
  </target>
1429 806 jones
1430 1702 tao
   <target name="stylesheettest">
1431 1939 brooke
     <xslt in="${input}" out="eml.html" style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1432 1702 tao
      <param name="displaymodule" expression="${displaymodule}"/>
1433
      <param name="docid" expression="${input}"/>
1434
      <param name="entitytype" expression="${entitytype}"/>
1435
      <param name="entityindex" expression="${entityindex}"/>
1436
      <outputproperty name="method" value="html"/>
1437
      <outputproperty name="standalone" value="yes"/>
1438
      <outputproperty name="encoding" value="iso8859_1"/>
1439
      <outputproperty name="indent" value="yes"/>
1440
    </xslt>
1441
  </target>
1442 2175 tao
1443 3210 tao
1444 1814 tao
  <target name="compilewebclient" depends="prepare">
1445
     <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/application/*.java" classpathref="webservicepath" />
1446
  </target>
1447 2175 tao
1448 1814 tao
  <target name="runwebclient" depends="compilewebclient">
1449 2175 tao
     <java classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
1450 1814 tao
           dir="${build.dest}" fork="yes"
1451
           classpathref="webservicepath" classpath="./lib/utilities.jar" failonerror="true">
1452
         <arg value="${serviceUrl}"/>
1453
         <arg value="${docid}"/>
1454
     </java>
1455
  </target>
1456 2598 harris
1457 2639 harris
  <target name="spatial_option" depends="prepare" description=" -- compiles code for the spatial option">
1458 2598 harris
1459
    <echo message="Compiling the metatcat shapefile creator"/>
1460
    <echo message="using the shapelib at: ${shapelib.dir}"/>
1461
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1462
     <arg line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1463
    </exec>
1464
1465
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1466 2639 harris
     <arg line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1467 2598 harris
    </exec>
1468
  </target>
1469
1470 2737 jones
    <!-- LSID Authority support -->
1471
    <patternset id="lsid.jars">
1472
        <include name="axis.jar" />
1473 2772 jones
        <include name="commons-discovery-0.2.jar" />
1474 2737 jones
        <include name="jaxrpc.jar" />
1475
        <include name="lsid-client-1.1.1.jar" />
1476
        <include name="lsid-server-1.1.1.jar" />
1477
        <include name="saaj.jar" />
1478 2772 jones
        <include name="wsdl4j-1.5.1.jar" />
1479 2737 jones
        <include name="activation.jar" />
1480
        <include name="castor-0.9.5.jar" />
1481
        <include name="dnsjava-1.3.2.jar" />
1482
        <include name="mail.jar" />
1483 2778 jones
        <include name="commons-logging-1.0.4.jar" />
1484
        <!-- These jars may be needed but seem to not actually be,
1485
             so leaving them out for now
1486
        <include name="axis-ant.jar" />
1487 2737 jones
        -->
1488
        <!--<include name="GenCastor.class" />-->
1489
    </patternset>
1490
    <patternset id="lib.jars">
1491
        <include name="httpclient.jar" />
1492
        <include name="log4j-1.2.12.jar" />
1493
        <include name="utilities.jar" />
1494
        <include name="xercesImpl.jar" />
1495
        <include name="xalan.jar" />
1496
        <include name="xml-apis.jar" />
1497
    </patternset>
1498
1499
    <path id="lsid.classpath">
1500
        <fileset dir="${lsid.lib.dir}">
1501
            <patternset refid="lsid.jars"/>
1502
        </fileset>
1503
        <fileset dir="${lib.dir}">
1504
            <patternset refid="lsid.jars"/>
1505
        </fileset>
1506 3059 berkley
        <fileset dir="${lib.dir}">
1507 2737 jones
            <include name="xalan.jar" />
1508
            <include name="xml-apis.jar" />
1509
        </fileset>
1510
        <fileset dir="${build.dir}">
1511
            <include name="metacat-client.jar" />
1512
        </fileset>
1513
    </path>
1514
1515
    <filterset id="configFilters">
1516
        <filter token="LSID_AUTHORITY_HOSTNAME"
1517
                value="${config.hostname}" />
1518
        <filter token="LSID_AUTHORITY_PORT"
1519
                value="${config.port}" />
1520
        <filter token="METADATA_LABELS"
1521
                value="${config.metadataLabelLsid}" />
1522
        <filter token="METACAT_SERVER"
1523
                value="${config.metacatserver}" />
1524
        <filter token="LSID_AUTHORITY_STRING"
1525
                value="${config.lsidauthority}" />
1526
    </filterset>
1527
1528
    <target name="prepare-lsid"
1529
            depends="prepare,utilities,clientjar"
1530
            description="Configure files prior to compilation">
1531
        <mkdir dir="${lsid.build.dir}" />
1532
        <!-- Copy the properties file into the build -->
1533
        <copy file="${conf.dir}/metacat-lsid.properties"
1534
              tofile="${lsid.build.dir}/WEB-INF/classes/metacat-lsid.properties"
1535
              overwrite="true">
1536
            <filterset refid="configFilters" />
1537
        </copy>
1538 2817 jones
        <copy file="${conf.dir}/log4j.properties"
1539
              tofile="${lsid.build.dir}/WEB-INF/classes/log4j.properties"
1540
              overwrite="true">
1541
            <filterset refid="configFilters" />
1542
        </copy>
1543 2737 jones
        <!-- Copy config files into the build -->
1544
        <copy todir="${lsid.build.dir}/WEB-INF">
1545
            <fileset dir="${webinf.dir}"
1546
                     includes="**/*.wsdd" />
1547
        </copy>
1548
        <!-- Copy the metadata configuration files into the build -->
1549
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}" />
1550
        <copy todir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}">
1551
            <fileset dir="${conf.dir}"
1552
                     includes="**/*.xml" />
1553
            <fileset dir="${conf.dir}"
1554
                     includes="**/*.xslt" />
1555
            <filterset refid="configFilters" />
1556
        </copy>
1557
        <!-- Copy services files into the build -->
1558
        <mkdir dir="${lsid.build.dir}/services" />
1559
        <copy todir="${lsid.build.dir}/services">
1560
            <fileset dir="${services.dir}" />
1561
            <filterset refid="configFilters" />
1562
        </copy>
1563 2778 jones
        <!-- Copy axis files into the build -->
1564
        <mkdir dir="${lsid.build.dir}" />
1565
        <copy todir="${lsid.build.dir}">
1566
            <fileset dir="${conf.dir}/axis"
1567
                     excludes="*.properties"/>
1568
        </copy>
1569
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1570
        <copy todir="${lsid.build.dir}/WEB-INF/classes">
1571
            <fileset dir="${conf.dir}/axis"
1572
                     includes="*.properties"/>
1573
        </copy>
1574 2737 jones
    </target>
1575
1576
    <target name="compile-lsid"
1577
            depends="prepare-lsid"
1578
            description="Compile Java sources">
1579
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1580
        <javac srcdir="src/edu/ucsb/nceas/metacat/lsid"
1581
               destdir="${lsid.build.dir}/WEB-INF/classes"
1582
               debug="${compile.debug}"
1583
               deprecation="${compile.deprecation}"
1584
               optimize="${compile.optimize}">
1585
            <classpath refid="lsid.classpath" />
1586
        </javac>
1587
    </target>
1588
1589
    <target name="war-lsid"
1590
            depends="compile-lsid"
1591
            description="Create a war file for the application">
1592
        <mkdir dir="${dist.dir}" />
1593
        <war destfile="${dist.dir}/${authority.context}.war"
1594
             webxml="${webinf.dir}/web.xml">
1595
            <fileset dir="${lsid.build.dir}" />
1596
            <lib dir="${lsid.lib.dir}">
1597
                <patternset refid="lsid.jars"/>
1598
            </lib>
1599
            <lib dir="${lib.dir}">
1600
                <patternset refid="lib.jars"/>
1601
            </lib>
1602 3059 berkley
            <lib dir="${lib.dir}">
1603 2737 jones
                <include name="xalan.jar" />
1604
                <include name="xml-apis.jar" />
1605
            </lib>
1606
            <lib dir="${build.dir}">
1607
                <include name="metacat-client.jar" />
1608
            </lib>
1609
        </war>
1610
    </target>
1611
1612
    <target name="deploy-lsid"
1613
            depends="war-lsid"
1614
            description="Deploy LSID war to servlet container">
1615
        <delete dir="${deploy.dir}/${authority.context}" />
1616
        <delete file="${deploy.dir}/${authority.context}.war" />
1617
        <mkdir dir="${deploy.dir}" />
1618
        <copy todir="${deploy.dir}">
1619
            <fileset dir="${dist.dir}" />
1620
        </copy>
1621
    </target>
1622 113 jones
</project>