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