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