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 3443 jones
      <property name="eml2_0_1-tag"        value="RELEASE_EML_2_0_1_UPDATE_4" />
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 3467 tao
   	     <property name="hostname" value="localhost"/>
912 2977 tao
   	     <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 3524 tao
   	<copy todir="${build.tests}" file="lib/metacat.properties" filtering="yes">
1130
1131
   	 </copy>
1132 971 tao
      <!-- copy and compile the tests into a jar file -->
1133 1783 jones
      <javac srcdir="${build.tests}"
1134
             destdir="${build.tests}"
1135 1612 tao
             debug="on"
1136 2982 jones
             includes="**/*.java">
1137 2599 jones
        <classpath>
1138
          <path refid="compile.classpath"/>
1139
          <fileset dir="${build.dir}">
1140 2982 jones
            <include name="${name}.jar"/>
1141
            <include name="${name}-client.jar"/>
1142
            <include name="harvester.jar"/>
1143 2599 jones
          </fileset>
1144
        </classpath>
1145
      </javac>
1146 204 jones
1147 1311 berkley
      <jar jarfile="${build.dir}/${name}-junittests.jar"
1148 1783 jones
        basedir="${build.tests}"
1149 1311 berkley
                includes="**/*.class" />
1150 1822 jones
   </target>
1151 971 tao
1152 1939 brooke
   <target name="test" depends="testprep"
1153
            description="Uses the ant junit task to run all JUnit tests">
1154 1822 jones
1155 971 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
1156 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1157 971 tao
             haltonerror="no">
1158 1783 jones
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
1159 971 tao
        <classpath>
1160 2599 jones
          <path refid="compile.classpath"/>
1161
          <fileset dir="${build.dir}">
1162 2982 jones
            <include name="${name}.jar"/>
1163
            <include name="${name}-client.jar"/>
1164
            <include name="harvester.jar"/>
1165
            <include name="${name}-junittests.jar"/>
1166 2599 jones
          </fileset>
1167 971 tao
        </classpath>
1168
1169
        <formatter type="plain" />
1170
1171
        <batchtest fork="yes" todir="${build.dir}">
1172 1783 jones
          <fileset dir="${build.tests}">
1173 1116 tao
            <include name="**/*.class" />
1174 971 tao
          </fileset>
1175
        </batchtest>
1176
     </junit>
1177
   </target>
1178 1103 tao
1179 1939 brooke
    <target name="runonetest" depends="testprep"
1180
            description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
1181 1500 tao
1182 1939 brooke
              <echo>testtorun: ${testtorun}</echo>
1183
1184 1500 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
1185 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1186 1500 tao
             haltonerror="no">
1187 2044 tao
        <!--<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>-->
1188 1500 tao
        <classpath>
1189 2599 jones
          <path refid="compile.classpath"/>
1190
          <fileset dir="${build.dir}">
1191 2982 jones
            <include name="${name}.jar"/>
1192
            <include name="${name}-client.jar"/>
1193
            <include name="harvester.jar"/>
1194
            <include name="${name}-junittests.jar"/>
1195 2599 jones
          </fileset>
1196 1500 tao
        </classpath>
1197
1198
        <formatter type="plain" />
1199
1200
        <batchtest fork="yes" todir="${build.dir}">
1201 1783 jones
          <fileset dir="${build.tests}">
1202 1500 tao
            <include name="**/${testtorun}.class" />
1203
          </fileset>
1204
        </batchtest>
1205
     </junit>
1206
   </target>
1207
1208 2175 tao
   <target name="testharvester"
1209 2135 costa
           depends="testprep"
1210
           description="Uses the ant junit task to test only the Harvester code">
1211 2175 tao
     <junit printsummary="yes"
1212
            haltonfailure="off"
1213 2135 costa
            fork="yes"
1214
            haltonerror="off">
1215 2599 jones
        <classpath>
1216
          <path refid="compile.classpath"/>
1217
          <fileset dir="${build.dir}">
1218 2982 jones
            <include name="${name}.jar"/>
1219
            <include name="${name}-client.jar"/>
1220
            <include name="harvester.jar"/>
1221
            <include name="${name}-junittests.jar"/>
1222 2599 jones
          </fileset>
1223
        </classpath>
1224 2135 costa
       <formatter type="plain" />
1225
       <batchtest fork="yes" todir="${build.dir}">
1226
         <fileset dir="${build.tests}">
1227
           <include name="**/harvesterClient/*.class" />
1228
         </fileset>
1229
       </batchtest>
1230
     </junit>
1231
   </target>
1232
1233 1939 brooke
  <target name="gethttpclient" depends="prepare"
1234
            description="checks out and compiles morpho httpclient code">
1235 1311 berkley
  <!--mkdir dir="${morphosourcedir}" -->
1236 1487 tao
        <cvs cvsRoot="${cvsroot}"
1237 1103 tao
             package="morpho"
1238
             dest="." />
1239 1107 tao
        <ant dir="${morphosourcedir}" inheritAll="false"  target="jar" />
1240 1103 tao
   </target>
1241
1242
   <!-- run this target, we need to check out a another morpho souce dir was checked out. -->
1243 1939 brooke
   <target name="nettest" depends="install"
1244
            description="compiles and runs the metacatnettest code">
1245 2175 tao
1246 1103 tao
      <echo>***********************************
1247 1311 berkley
      Please run ant gethttpclient first!
1248
      ***********************************
1249 1103 tao
      </echo>
1250
      <!-- copy and compile the tests into a jar file -->
1251 1116 tao
      <mkdir dir="${build.metacatnettest}"/>
1252 1103 tao
      <javac srcdir="${junitnettestsdir}"
1253 1116 tao
             destdir="${build.metacatnettest}"
1254 2599 jones
             includes="**/*.java">
1255
        <classpath>
1256
          <path refid="compile.classpath"/>
1257
          <fileset dir="${build.dir}">
1258 2982 jones
            <include name="${name}.jar"/>
1259 2599 jones
          </fileset>
1260
        </classpath>
1261
      </javac>
1262 1103 tao
1263
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
1264 1116 tao
                    basedir="${build.metacatnettest}"
1265 1103 tao
                    includes="**/*.class" />
1266
1267
      <!-- use the ant "junit" task to run JUnit tests. -->
1268 1107 tao
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1269 1103 tao
             haltonerror="no">
1270 1107 tao
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1271 1103 tao
        <classpath>
1272 2599 jones
          <path refid="compile.classpath"/>
1273
          <fileset dir="${build.dir}">
1274 2982 jones
            <include name="${name}.jar"/>
1275
            <include name="${name}-junitnettests.jar"/>
1276 2599 jones
          </fileset>
1277 1103 tao
        </classpath>
1278
1279
        <formatter type="plain" />
1280
1281
        <batchtest fork="yes" todir="${build.dir}">
1282 1116 tao
          <fileset dir="${build.metacatnettest}">
1283
            <include name="**/*.class" />
1284 1103 tao
          </fileset>
1285
        </batchtest>
1286
     </junit>
1287 1311 berkley
   </target>
1288 1103 tao
1289 1939 brooke
   <target name="cleanweb" depends="clean"
1290
            description="deletes tomcat web context dir and all its contents">
1291 1522 berkley
     <delete dir="${installdir}" />
1292
   </target>
1293
1294
1295 1939 brooke
   <target name="clean" depends="init"
1296 2320 jones
            description="deletes build dir and files that can be regenerated form the release">
1297 822 jones
       <delete dir="${build.dir}" />
1298 2737 jones
       <delete dir="${dist.dir}" />
1299 2320 jones
   </target>
1300
1301
   <target name="fullclean" depends="clean"
1302
            description="deletes even jars that depend on external sources such as stylesheets and jars">
1303
       <delete file="lib/httpclient.jar" />
1304
       <delete file="lib/utilities.jar" />
1305 1939 brooke
       <delete includeEmptyDirs="true" failonerror="false">
1306
         <fileset dir="${style-common-cvsrelpath}">
1307
           <include name="${eml-css}" />
1308
           <include name="eml-*/*.xsl" />
1309
           <include name="eml-*" />
1310
         </fileset>
1311 2320 jones
       </delete>
1312 113 jones
   </target>
1313
1314 1939 brooke
   <target name="jdoc" depends="prepare"
1315
            description="generates javadoc documentation">
1316 822 jones
       <javadoc packagenames="edu.ucsb.nceas.*"
1317 516 jones
           sourcepath="${build.src}"
1318
           destdir="${build.javadocs}"
1319 113 jones
           author="true"
1320
           version="true"
1321
           use="true"
1322 348 jones
           windowtitle="${Name} API"
1323
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
1324 2599 jones
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;">
1325
         <classpath>
1326
           <path refid="compile.classpath"/>
1327
         </classpath>
1328
       </javadoc>
1329 113 jones
   </target>
1330
1331 2461 sgarg
   <target name="dist"
1332 2965 tao
       depends="geteml,get-ecogrid,jar,protocol,jdoc,getConversionXSL,getutilities"
1333 1939 brooke
            description="prepares a full release distribution">
1334 806 jones
      <mkdir dir="${dist.dir}"/>
1335
      <delete dir="${ver.dir}" />
1336
      <mkdir dir="${ver.dir}"/>
1337
      <copy todir="${ver.dir}">
1338 1311 berkley
        <fileset dir="."
1339 2401 costa
            excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/**"/>
1340 806 jones
      </copy>
1341
      <copy todir="${ver.dir}" file="build.xml"/>
1342 2317 jones
      <copy todir="${ver.dir}" file="build.properties"/>
1343 882 jones
1344
      <copy todir="${ver.dir}/docs" filtering="yes">
1345
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1346
      </copy>
1347
      <copy todir="${ver.dir}/docs" filtering="no">
1348
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1349
      </copy>
1350 806 jones
      <copy todir="${ver.dir}/docs/dev">
1351
        <fileset dir="${build.dir}/docs"/>
1352
      </copy>
1353 917 berkley
      <copy todir="${ver.dir}/src">
1354
        <fileset dir="${build.dir}/src"/>
1355
      </copy>
1356 2391 tao
      <!-- copy loaddtdschemal.sql form src dir(which has the server token to ver.dir/src-->
1357
      <copy todir="${ver.dir}/src" file="${srcdir}/loaddtdschema.sql" overwrite="yes" filtering="no"/>
1358 2395 tao
      <copy todir="${ver.dir}/src" file="${srcdir}/upgrade-db-to-1.5.sql" overwrite="yes" filtering="no"/>
1359 2323 jones
      <!--
1360 992 berkley
      <delete dir="./${ver.dir}/${build.dir}"/>
1361
      <delete dir="./${ver.dir}/dist"/>
1362 2323 jones
      -->
1363 882 jones
      <delete file="./${name}-${release}.zip"/>
1364 1312 tao
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1365 882 jones
      <delete file="./${name}-${release}.tar.gz" />
1366 1312 tao
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1367 1311 berkley
      <gzip zipfile="./${name}-${release}.tar.gz"
1368 882 jones
                src="./${name}-${release}.tar"/>
1369
      <delete file="./${name}-${release}.tar" />
1370 1311 berkley
  </target>
1371 806 jones
1372 1939 brooke
  <target name="distsrc" depends="dist"
1373
            description="prepares a source distribution">
1374 806 jones
      <mkdir dir="${ver.src}"/>
1375
      <copy todir="${ver.src}">
1376
        <fileset dir="./src"/>
1377
      </copy>
1378 2461 sgarg
      <mkdir dir="${util.dir}"/>
1379
      <copy todir="${util.dir}">
1380
        <fileset dir="${build.tmp}/utilities" excludes="**/CVS*" />
1381
      </copy>
1382 2965 tao
1383
  	  <mkdir dir="${ecogrid-dist-dir}"/>
1384
  	  <copy todir="${ecogrid-dist-dir}">
1385
  	        <fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1386
  	  </copy>
1387 806 jones
1388 3131 perry
      <delete file="${ver.dir}/lib/utilities.jar"/>
1389
1390 882 jones
      <delete file="./${name}-src-${release}.zip"/>
1391
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
1392
      <delete file="./${name}-src-${release}.tar.gz" />
1393
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
1394 1311 berkley
      <gzip zipfile="./${name}-src-${release}.tar.gz"
1395 882 jones
                src="./${name}-src-${release}.tar"/>
1396
      <delete file="./${name}-src-${release}.tar" />
1397 3131 perry
      <delete dir="${dist.dir}"/>
1398 1311 berkley
  </target>
1399 806 jones
1400 1702 tao
   <target name="stylesheettest">
1401 1939 brooke
     <xslt in="${input}" out="eml.html" style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1402 1702 tao
      <param name="displaymodule" expression="${displaymodule}"/>
1403
      <param name="docid" expression="${input}"/>
1404
      <param name="entitytype" expression="${entitytype}"/>
1405
      <param name="entityindex" expression="${entityindex}"/>
1406
      <outputproperty name="method" value="html"/>
1407
      <outputproperty name="standalone" value="yes"/>
1408
      <outputproperty name="encoding" value="iso8859_1"/>
1409
      <outputproperty name="indent" value="yes"/>
1410
    </xslt>
1411
  </target>
1412 2175 tao
1413 3210 tao
1414 1814 tao
  <target name="compilewebclient" depends="prepare">
1415
     <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/application/*.java" classpathref="webservicepath" />
1416
  </target>
1417 2175 tao
1418 1814 tao
  <target name="runwebclient" depends="compilewebclient">
1419 2175 tao
     <java classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
1420 1814 tao
           dir="${build.dest}" fork="yes"
1421
           classpathref="webservicepath" classpath="./lib/utilities.jar" failonerror="true">
1422
         <arg value="${serviceUrl}"/>
1423
         <arg value="${docid}"/>
1424
     </java>
1425
  </target>
1426 2598 harris
1427 2639 harris
  <target name="spatial_option" depends="prepare" description=" -- compiles code for the spatial option">
1428 2598 harris
1429
    <echo message="Compiling the metatcat shapefile creator"/>
1430
    <echo message="using the shapelib at: ${shapelib.dir}"/>
1431
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1432
     <arg line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1433
    </exec>
1434
1435
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1436 2639 harris
     <arg line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1437 2598 harris
    </exec>
1438
  </target>
1439
1440 2737 jones
    <!-- LSID Authority support -->
1441
    <patternset id="lsid.jars">
1442
        <include name="axis.jar" />
1443 2772 jones
        <include name="commons-discovery-0.2.jar" />
1444 2737 jones
        <include name="jaxrpc.jar" />
1445
        <include name="lsid-client-1.1.1.jar" />
1446
        <include name="lsid-server-1.1.1.jar" />
1447
        <include name="saaj.jar" />
1448 2772 jones
        <include name="wsdl4j-1.5.1.jar" />
1449 2737 jones
        <include name="activation.jar" />
1450
        <include name="castor-0.9.5.jar" />
1451
        <include name="dnsjava-1.3.2.jar" />
1452
        <include name="mail.jar" />
1453 2778 jones
        <include name="commons-logging-1.0.4.jar" />
1454
        <!-- These jars may be needed but seem to not actually be,
1455
             so leaving them out for now
1456
        <include name="axis-ant.jar" />
1457 2737 jones
        -->
1458
        <!--<include name="GenCastor.class" />-->
1459
    </patternset>
1460
    <patternset id="lib.jars">
1461
        <include name="httpclient.jar" />
1462
        <include name="log4j-1.2.12.jar" />
1463
        <include name="utilities.jar" />
1464
        <include name="xercesImpl.jar" />
1465
        <include name="xalan.jar" />
1466
        <include name="xml-apis.jar" />
1467
    </patternset>
1468
1469
    <path id="lsid.classpath">
1470
        <fileset dir="${lsid.lib.dir}">
1471
            <patternset refid="lsid.jars"/>
1472
        </fileset>
1473
        <fileset dir="${lib.dir}">
1474
            <patternset refid="lsid.jars"/>
1475
        </fileset>
1476 3059 berkley
        <fileset dir="${lib.dir}">
1477 2737 jones
            <include name="xalan.jar" />
1478
            <include name="xml-apis.jar" />
1479
        </fileset>
1480
        <fileset dir="${build.dir}">
1481
            <include name="metacat-client.jar" />
1482
        </fileset>
1483
    </path>
1484
1485
    <filterset id="configFilters">
1486
        <filter token="LSID_AUTHORITY_HOSTNAME"
1487
                value="${config.hostname}" />
1488
        <filter token="LSID_AUTHORITY_PORT"
1489
                value="${config.port}" />
1490
        <filter token="METADATA_LABELS"
1491
                value="${config.metadataLabelLsid}" />
1492
        <filter token="METACAT_SERVER"
1493
                value="${config.metacatserver}" />
1494
        <filter token="LSID_AUTHORITY_STRING"
1495
                value="${config.lsidauthority}" />
1496
    </filterset>
1497
1498
    <target name="prepare-lsid"
1499
            depends="prepare,utilities,clientjar"
1500
            description="Configure files prior to compilation">
1501
        <mkdir dir="${lsid.build.dir}" />
1502
        <!-- Copy the properties file into the build -->
1503
        <copy file="${conf.dir}/metacat-lsid.properties"
1504
              tofile="${lsid.build.dir}/WEB-INF/classes/metacat-lsid.properties"
1505
              overwrite="true">
1506
            <filterset refid="configFilters" />
1507
        </copy>
1508 2817 jones
        <copy file="${conf.dir}/log4j.properties"
1509
              tofile="${lsid.build.dir}/WEB-INF/classes/log4j.properties"
1510
              overwrite="true">
1511
            <filterset refid="configFilters" />
1512
        </copy>
1513 2737 jones
        <!-- Copy config files into the build -->
1514
        <copy todir="${lsid.build.dir}/WEB-INF">
1515
            <fileset dir="${webinf.dir}"
1516
                     includes="**/*.wsdd" />
1517
        </copy>
1518
        <!-- Copy the metadata configuration files into the build -->
1519
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}" />
1520
        <copy todir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}">
1521
            <fileset dir="${conf.dir}"
1522
                     includes="**/*.xml" />
1523
            <fileset dir="${conf.dir}"
1524
                     includes="**/*.xslt" />
1525
            <filterset refid="configFilters" />
1526
        </copy>
1527
        <!-- Copy services files into the build -->
1528
        <mkdir dir="${lsid.build.dir}/services" />
1529
        <copy todir="${lsid.build.dir}/services">
1530
            <fileset dir="${services.dir}" />
1531
            <filterset refid="configFilters" />
1532
        </copy>
1533 2778 jones
        <!-- Copy axis files into the build -->
1534
        <mkdir dir="${lsid.build.dir}" />
1535
        <copy todir="${lsid.build.dir}">
1536
            <fileset dir="${conf.dir}/axis"
1537
                     excludes="*.properties"/>
1538
        </copy>
1539
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1540
        <copy todir="${lsid.build.dir}/WEB-INF/classes">
1541
            <fileset dir="${conf.dir}/axis"
1542
                     includes="*.properties"/>
1543
        </copy>
1544 2737 jones
    </target>
1545
1546
    <target name="compile-lsid"
1547
            depends="prepare-lsid"
1548
            description="Compile Java sources">
1549
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1550
        <javac srcdir="src/edu/ucsb/nceas/metacat/lsid"
1551
               destdir="${lsid.build.dir}/WEB-INF/classes"
1552
               debug="${compile.debug}"
1553
               deprecation="${compile.deprecation}"
1554
               optimize="${compile.optimize}">
1555
            <classpath refid="lsid.classpath" />
1556
        </javac>
1557
    </target>
1558
1559
    <target name="war-lsid"
1560
            depends="compile-lsid"
1561
            description="Create a war file for the application">
1562
        <mkdir dir="${dist.dir}" />
1563
        <war destfile="${dist.dir}/${authority.context}.war"
1564
             webxml="${webinf.dir}/web.xml">
1565
            <fileset dir="${lsid.build.dir}" />
1566
            <lib dir="${lsid.lib.dir}">
1567
                <patternset refid="lsid.jars"/>
1568
            </lib>
1569
            <lib dir="${lib.dir}">
1570
                <patternset refid="lib.jars"/>
1571
            </lib>
1572 3059 berkley
            <lib dir="${lib.dir}">
1573 2737 jones
                <include name="xalan.jar" />
1574
                <include name="xml-apis.jar" />
1575
            </lib>
1576
            <lib dir="${build.dir}">
1577
                <include name="metacat-client.jar" />
1578
            </lib>
1579
        </war>
1580
    </target>
1581
1582
    <target name="deploy-lsid"
1583
            depends="war-lsid"
1584
            description="Deploy LSID war to servlet container">
1585
        <delete dir="${deploy.dir}/${authority.context}" />
1586
        <delete file="${deploy.dir}/${authority.context}.war" />
1587
        <mkdir dir="${deploy.dir}" />
1588
        <copy todir="${deploy.dir}">
1589
            <fileset dir="${dist.dir}" />
1590
        </copy>
1591
    </target>
1592 113 jones
</project>