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