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
  <target name="check-db">
37
    <condition property="use-oracle">
38
      <equals arg1="${database}" arg2="oracle" />
39
    </condition>
40
    <condition property="use-postgresql">
41
      <equals arg1="${database}" arg2="postgresql" />
42
    </condition>
43
    <condition property="use-sqlserver">
44
      <equals arg1="${database}" arg2="sqlserver" />
45
    </condition>
46
  </target>
47
48
  <target name="oracle" if="use-oracle">
49 931 jones
     <!-- Customize these properties if you are using oracle -->
50 1929 brooke
     <echo message="Using oracle..."/>
51 925 berkley
     <property name="dbDriver" value="oracle.jdbc.driver.OracleDriver"/>
52
     <property name="dbAdapter" value="edu.ucsb.nceas.dbadapter.OracleAdapter"/>
53 1929 brooke
     <property name="jdbc" value="${jdbc_base}/classes111.zip" />
54 1744 tao
     <!-- Property to indicate is not MSSQL installation-->
55
     <property name="other" value="yes"/>
56 2175 tao
     <property name="install-sql"
57 2103 jones
               value="xmltables.sql" />
58 2175 tao
     <property name="upgrade-1.2-sql"
59 2103 jones
               value="upgrade-db-to-1.2.sql" />
60 2175 tao
     <property name="upgrade-1.3-sql"
61 2103 jones
               value="upgrade-db-to-1.3.sql" />
62 2175 tao
     <property name="upgrade-1.4-sql"
63 2103 jones
               value="upgrade-db-to-1.4.sql" />
64 925 berkley
   </target>
65 1311 berkley
66 1929 brooke
   <target name="postgresql" if="use-postgresql">
67 931 jones
     <!-- Customize these properties if you are using postgres -->
68 1929 brooke
     <echo message="Using PostgreSQL..."/>
69 925 berkley
     <property name="dbDriver" value="org.postgresql.Driver"/>
70 1311 berkley
     <property name="dbAdapter"
71 931 jones
               value="edu.ucsb.nceas.dbadapter.PostgresqlAdapter"/>
72 1716 berkley
     <property name="jdbc" value="lib/jdbc7.1-1.2.jar" />
73 1744 tao
     <!-- Property to indicate is not MSSQL installation-->
74
     <property name="other" value="yes"/>
75 2175 tao
     <property name="install-sql"
76 2277 jones
               value="xmltables-postgres.sql" />
77 2175 tao
     <property name="upgrade-1.2-sql"
78 2277 jones
               value="upgrade-db-to-1.2-postgres.sql" />
79 2175 tao
     <property name="upgrade-1.3-sql"
80 2277 jones
               value="upgrade-db-to-1.3-postgres.sql" />
81 2175 tao
     <property name="upgrade-1.4-sql"
82 2277 jones
               value="upgrade-db-to-1.4-postgres.sql" />
83 1744 tao
    </target>
84 2175 tao
85 1929 brooke
   <target name="sqlserver" if="use-sqlserver">
86 1739 tao
     <!-- Customize these properties if you are using SQL server -->
87 1929 brooke
     <echo message="Using SQL Server..."/>
88 1739 tao
     <property name="dbDriver" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
89
     <property name="dbAdapter"
90
               value="edu.ucsb.nceas.dbadapter.SqlserverAdapter"/>
91 2296 sgarg
     <property name="jdbc" value="${jdbc_base}/msbase.jar" />
92
     <property name="jdbc-add1" value="${jdbc_base}/msutil.jar" />
93
     <property name="jdbc-add2" value="${jdbc_base}/mssqlserver.jar" />
94 1744 tao
     <!-- Property to indicate is a MSSQL installation-->
95
     <property name="MSSQL" value="yes"/>
96 2175 tao
     <property name="install-sql"
97 2118 costa
               value="xmltables-sqlserver.sql" />
98 1739 tao
   </target>
99 1311 berkley
100 1929 brooke
   <target name="config" depends="check-db,oracle,postgresql,sqlserver">
101 1814 tao
      <!-- usr for client testing, generally you don't need change-->
102 2277 jones
      <property name="mcuser" value="uid=jones,o=NCEAS,dc=ecoinformatics,dc=org"/>
103 1783 jones
      <property name="mcpassword" value=""/>
104 1801 tao
      <property name="mcanotheruser" value="uid=jtao,o=LTER,dc=ecoinformatics,dc=org"/>
105
      <property name="mcanotherpassword" value=""/>
106
107 1827 jones
      <property name="debug" value="on" />
108 2053 sgarg
      <property name="debuglevel" value="55" />
109 1716 berkley
110 1522 berkley
      <property name="morphosourcedir" value="../morpho" />
111 1570 tao
      <property name="defaultcontenttype" value="application/octet-stream" />
112 1780 jones
      <property name="utilitiesdir" value="../utilities" />
113 2175 tao
114 931 jones
      <!-- Make sure these paths match the location of the jar files
115
           on your system, the defaults should usually work -->
116 1941 brooke
      <condition property="jsdk" value="${tomcat}/lib/common/servlet.jar">
117
        <equals arg1="${tomcatversion}" arg2="tomcat3" />
118
      </condition>
119
      <condition property="jsdk" value="${tomcat}/common/lib/servlet.jar">
120
        <equals arg1="${tomcatversion}" arg2="tomcat4" />
121
      </condition>
122 2011 cjones
      <condition property="jsdk" value="${tomcat}/common/lib/servlet-api.jar">
123
        <equals arg1="${tomcatversion}" arg2="tomcat5" />
124
      </condition>
125 1941 brooke
      <echo>*********** tomcatversion = ${tomcatversion}</echo>
126
      <echo>*********** set jsdk to ${jsdk}</echo>
127 1311 berkley
      <property name="xmlp"
128 1376 tao
                value="lib/xercesImpl.jar" />
129 1311 berkley
      <property name="cos"
130 931 jones
                value="lib/cos.jar" />
131 939 tao
      <property name="morpho"
132
                value="lib/morpho.jar" />
133 931 jones
      <property name="xalan"
134
                value="lib/xalan/xalan.jar" />
135
      <property name="apis"
136
                value="lib/xalan/xml-apis.jar" />
137 1103 tao
      <property name="httpclient"
138 1780 jones
                value="lib/httpclient.jar" />
139 1470 tao
      <property name="emlparser"
140
                value="lib/eml.jar" />
141
      <property name="configxml"
142
                value="lib/configxml.jar" />
143 1578 tao
      <property name="itislib"
144
                value="lib/itislib.jar" />
145 1487 tao
      <property name="emlparser"
146 2175 tao
147 1487 tao
                value="lib/eml.jar" />
148 1780 jones
      <property name="util"
149
                value="lib/utilities.jar" />
150 1103 tao
  </target>
151
152 931 jones
   <target name="init" depends="config">
153
      <!-- It is less likely you'll need to make any changes from here down,
154
           but customization is possible -->
155 1929 brooke
      <property name="installdir"          value="${webapps}/${context}" />
156
      <property name="temp-dir"            value="/tmp/${context}" />
157
      <property name="name"                value="metacat"/>
158
      <property name="Name"                value="MetaCat"/>
159
      <property name="debugprefix"         value="${Name}:"/>
160 1990 jones
      <property name="release"             value="1.4.0"/>
161 1929 brooke
      <property name="replication-path"    value="/${context}/servlet/replication"/>
162 2331 costa
      <property name="harvester-registration-login-path" value="/${context}/harvesterRegistrationLogin"/>
163
      <property name="harvester-registration-path"       value="/${context}/harvesterRegistration"/>
164 1952 jones
      <property name="servlet-path"        value="/${context}/metacat"/>
165 1929 brooke
      <property name="html-path"           value="/${context}"/>
166 2180 tao
      <property name="systemidserver"      value="http://${httpserver}"/>
167 2175 tao
      <property name="style-common-relpath"
168 1933 brooke
                                           value="/style/common"/>
169 2175 tao
      <property name="style-common-cvsrelpath"
170 1938 brooke
                                           value="lib${style-common-relpath}"/>
171 2175 tao
      <property name="style-common-fullpath"
172 1933 brooke
                                           value="/${installdir}${style-common-relpath}"/>
173 2343 sgarg
      <property name="templates.dir"       value="${style-common-fullpath}/templates"/>
174 2175 tao
      <property name="style-common-path"
175 1933 brooke
                                           value="/${context}${style-common-relpath}"/>
176 1929 brooke
      <property name="style-skins-relpath" value="/style/skins"/>
177
      <property name="style-skins-path"    value="/${context}${style-skins-relpath}"/>
178
      <property name="replication-log"     value="/tmp/metacatreplication.log"/>
179 1579 tao
      <property name="replicationerrorlog" value="/tmp/metacatreplication.err"/>
180 1929 brooke
      <property name="config-dir"          value="${webapps}/${style-skins-path}" />
181
      <property name="eml-module"          value="eml" />
182
      <property name="eml-version"         value="2.0.0beta6" />
183
      <property name="eml-tag"             value="EML_2_0_0_BETA_6_FOR_METACAT" />
184 2232 sgarg
      <property name="eml2_0_0-tag"        value="RELEASE_EML_2_0_0_UPDATE_1" />
185
      <property name="eml2_0_1-tag"        value="RELEASE_EML_2_0_1" />
186 2228 sgarg
      <property name="eml2_0_0namespace"   value="eml://ecoinformatics.org/eml-2.0.0" />
187
      <property name="eml2_0_1namespace"   value="eml://ecoinformatics.org/eml-2.0.1" />
188
      <property name="eml2_1_0namespace"   value="eml://ecoinformatics.org/eml-2.1.0" />
189 1929 brooke
      <property name="stmmlnamespace"      value="http://www.xml-cml.org/schema/stmml" />
190 1933 brooke
      <property name="eml-css"             value="eml_xsl.css"/>
191
      <property name="eml-module.default.css"
192
                                           value="default.css"/>
193 1929 brooke
      <property name="conversion-module"   value="webmdentry" />
194 348 jones
195 1929 brooke
      <!-- Config for registry variables -->
196 1933 brooke
      <property name="scope"               value="obfs"/>
197
      <property name="responseForm"        value="genericResponse.tmpl"/>
198
      <property name="entryForm"           value="entryForm.tmpl"/>
199
      <property name="guide"               value="genericGuide.tmpl"/>
200 2343 sgarg
      <property name="confirmData"         value="confirmData.tmpl"/>
201
      <property name="deleteData"          value="deleteData.tmpl"/>
202
      <property name="genericHeader"       value="genericHeader.tmpl"/>
203
      <property name="genericFooter"       value="genericFooter.tmpl"/>
204
      <property name="adminname"           value="KNB Support"/>
205
      <property name="recipient"           value="knb-software\@nceas.ucsb.edu"/>
206 1929 brooke
207 2343 sgarg
      <property name="defaultStage"        value="initregister"/>
208
      <property name="defaultHeader"       value="genericHeader.tmpl"/>
209
      <property name="defaultFooter"       value="genericFooter.tmpl"/>
210
      <property name="defaultChangePass"   value="ldapChangePass.tmpl"/>
211
      <property name="defaultResetPass"    value="ldapResetPass.tmpl"/>
212
      <property name="changePassSuccess"   value="ldapChangePassSuccess.tmpl"/>
213
      <property name="resetPassSuccess"    value="ldapResetPassSuccess.tmpl"/>
214
      <property name="registerFailed"      value="ldapRegisterFailed.tmpl"/>
215
      <property name="registerLter"        value="ldapRegisterLter.tmpl"/>
216
      <property name="registerMatch"       value="ldapRegisterMatch.tmpl"/>
217
      <property name="registerSuccess"     value="ldapRegisterSuccess.tmpl"/>
218
      <property name="register"            value="ldapRegister.tmpl"/>
219
      <property name="searchResults"       value="searchResults.tmpl"/>
220
221
      <filter token="scope"                value="${scope}"/>
222
      <filter token="responseForm"         value="${responseForm}"/>
223
      <filter token="entryForm"            value="${entryForm}"/>
224
      <filter token="guide"                value="${guide}"/>
225
      <filter token="confirmData"          value="${confirmData}"/>
226
      <filter token="deleteData"           value="${deleteData}"/>
227
      <filter token="genericHeader"        value="${genericHeader}"/>
228
      <filter token="genericFooter"        value="${genericFooter}"/>
229
      <filter token="adminname"            value="${adminname}"/>
230
      <filter token="recipient"            value="${recipient}"/>
231
232
      <filter token="ldapurl"              value="ldap.ecoinformatics.org"/>
233
      <filter token="ldapSearchBase"       value="dc=ecoinformatics,dc=org"/>
234
      <filter token="ldap_user"            value="cn=Manager,dc=ecoinformatics,dc=org"/>
235
      <filter token="ldap_password"        value="ldap_password"/>
236
      <filter token="mailhost"             value="smtp.ecoinformatics.org"/>
237
      <filter token="sender"               value="knb-software\@nceas.ucsb.edu"/>
238
      <filter token="cgiurl"               value="http://${server}/cgi-bin/ldapweb.cgi"/>
239
240 1311 berkley
      <property name="cpath"
241 1986 jones
                value="${xmlp}:${xalan}:${apis}:${jdbc}:${jsdk}:${cos}:${morpho}:${emlparser}:${jdbc-add1}:${jdbc-add2}:${util}:${httpclient}"/>
242 882 jones
243
      <filter token="docrooturl" value="./" />
244 2356 sgarg
      <filter token="database" value="${database}" />
245 588 berkley
      <filter token="jdbc-connect" value="${jdbc-connect}"/>
246 882 jones
      <filter token="dbDriver" value="${dbDriver}"/>
247 915 berkley
      <filter token="dbAdapter" value="${dbAdapter}"/>
248 614 bojilova
      <filter token="install-dir" value="${installdir}"/>
249 1929 brooke
      <filter token="temp-dir" value="${temp-dir}"/>
250 586 berkley
      <filter token="server" value="${server}"/>
251 977 tao
      <filter token="systemidserver" value="${systemidserver}"/>
252 1929 brooke
      <filter token="cgi-prefix" value="${cgi-prefix}"/>
253
      <filter token="ldapUrl" value="${ldapUrl}"/>
254 586 berkley
      <filter token="replication-log" value="${replication-log}"/>
255 1579 tao
      <filter token="replicationerrorlog" value="${replicationerrorlog}"/>
256 348 jones
      <filter token="release" value="${release}"/>
257
      <filter token="servlet-path" value="${servlet-path}"/>
258 359 bojilova
      <filter token="html-path" value="${html-path}"/>
259 362 jones
      <filter token="user" value="${user}"/>
260
      <filter token="password" value="${password}"/>
261 1783 jones
      <filter token="mcuser" value="${mcuser}"/>
262
      <filter token="mcpassword" value="${mcpassword}"/>
263 1801 tao
      <filter token="mcanotheruser" value="${mcanotheruser}"/>
264
      <filter token="mcanotherpassword" value="${mcanotherpassword}"/>
265 1929 brooke
      <filter token="knb-site-url" value="${knb-site-url}"/>
266 1933 brooke
      <filter token="eml-css" value="${eml-css}"/>
267 1929 brooke
      <filter token="style-skins-relpath" value="${style-skins-relpath}"/>
268
      <filter token="style-skins-path" value="${style-skins-path}"/>
269
      <filter token="style-common-relpath" value="${style-common-relpath}"/>
270
      <filter token="style-common-fullpath" value="${style-common-fullpath}"/>
271
      <filter token="style-common-path" value="${style-common-path}"/>
272 2343 sgarg
      <filter token="templates.dir" value="${templates.dir}"/>
273
274 1929 brooke
      <!-- The "style-path" filter is used by the eml xsl stylesheets!!  -->
275
      <filter token="style-path" value="${style-skins-path}"/>
276 525 berkley
      <filter token="replication-path" value="${replication-path}"/>
277 2299 costa
      <filter token="harvester-registration-login-path" value="${harvester-registration-login-path}"/>
278
      <filter token="harvester-registration-path" value="${harvester-registration-path}"/>
279 832 jones
      <filter token="config-dir" value="${config-dir}"/>
280
      <filter token="default-style" value="${default-style}"/>
281 877 jones
      <filter token="eml-version" value="${eml-version}"/>
282 2175 tao
      <filter token="eml2_0_0namespace" value="${eml2_0_0namespace}"/>
283 2228 sgarg
      <filter token="eml2_0_1namespace" value="${eml2_0_1namespace}"/>
284 2175 tao
      <filter token="eml2_1_0namespace" value="${eml2_1_0namespace}"/>
285 1718 tao
      <filter token="stmmlnamespace" value="${stmmlnamespace}"/>
286 1009 tao
      <filter token="context" value="${context}"/>
287 1292 tao
      <filter token="forcereplicationwaitingtime" value="${forcereplicationwaitingtime}" />
288 1051 tao
      <filter token="debuglevel" value="${debuglevel}" />
289 1079 tao
      <filter token="datafilepath" value="${datafilepath}" />
290 1455 tao
      <filter token="inlinedatafilepath" value="${inlinedatafilepath}" />
291 1522 berkley
      <filter token="defaultcontenttype" value="${defaultcontenttype}" />
292 1538 berkley
      <filter token="debugprefix" value="${debugprefix}"/>
293 2308 jones
      <filter token="administrators" value="${administrators}"/>
294 1487 tao
295 2343 sgarg
      <filter token="defaultStage" value="${defaultStage}"/>
296
      <filter token="defaultHeader" value="${defaultHeader}"/>
297
      <filter token="defaultFooter" value="${defaultFooter}"/>
298
      <filter token="defaultChangePass" value="${defaultChangePass}"/>
299
      <filter token="defaultResetPass" value="${defaultResetPass}"/>
300
      <filter token="changePassSuccess" value="${changePassSuccess}"/>
301
      <filter token="resetPassSuccess" value="${resetPassSuccess}"/>
302
      <filter token="registerFailed" value="${registerFailed}"/>
303
      <filter token="registerLter" value="${registerLter}"/>
304
      <filter token="registerMatch" value="${registerMatch}"/>
305
      <filter token="registerSuccess" value="${registerSuccess}"/>
306
      <filter token="register" value="${register}"/>
307
      <filter token="searchResults" value="${searchResults}"/>
308
309 254 jones
      <property name="srcdir" value="./src" />
310 1783 jones
      <property name="testdir" value="./test" />
311 2277 jones
      <property name="testtorun" value="BuildIndexTest" />
312 1116 tao
      <property name="junittestsdir" value="./test/edu/ucsb/nceas/metacattest" />
313
      <property name="junitnettestsdir" value="./test/edu/ucsb/nceas/metacatnettest" />
314 348 jones
      <property name="build.dir" value="./build"/>
315
      <property name="build.src" value="${build.dir}/src"/>
316
      <property name="build.dest" value="${build.dir}/classes"/>
317 516 jones
      <property name="build.docs" value="${build.dir}/docs"/>
318 348 jones
      <property name="build.samples" value="${build.dir}/samples"/>
319
      <property name="build.tests" value="${build.dir}/tests"/>
320 1778 tao
      <property name="build.tmp" value="${build.dir}/tmp"/>
321 1116 tao
      <property name="build.metacattest" value="${build.tests}/metacattest"/>
322
      <property name="build.metacatnettest" value="${build.tests}/metacatnettest"/>
323 348 jones
      <property name="build.data" value="${build.dir}/data"/>
324 806 jones
      <property name="build.javadocs" value="${build.dir}/docs/api"/>
325 1952 jones
      <property name="build.war" value="${build.dir}/war"/>
326 348 jones
327 882 jones
      <property name="dist.dir" value="dist"/>
328 806 jones
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
329
      <property name="ver.src" value="${ver.dir}/src"/>
330
331 254 jones
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
332 2317 jones
      <condition property="utilities.required">
333
        <or>
334
          <not><available file="lib/httpclient.jar"/></not>
335
          <not><available file="lib/utilities.jar"/></not>
336
        </or>
337
      </condition>
338 2318 jones
      <condition property="eml.required">
339
        <or>
340
          <not><available file="lib/schema/eml-2.0.1/eml.xsd"/></not>
341
          <not><available file="lib/schema/eml-2.0.0/eml.xsd"/></not>
342
          <not><available file="lib/dtd/eml-dataset-2.0.0beta6.dtd"/></not>
343
        </or>
344
      </condition>
345 113 jones
   </target>
346 1311 berkley
347 348 jones
   <target name="prepare" depends="init">
348
      <mkdir dir="${build.dir}"/>
349
      <mkdir dir="${build.src}"/>
350
      <mkdir dir="${build.dest}"/>
351 516 jones
      <mkdir dir="${build.javadocs}"/>
352 1778 tao
      <mkdir dir="${build.tmp}"/>
353 348 jones
354 822 jones
      <copy todir="${build.src}" filtering="yes">
355
        <fileset dir="${srcdir}">
356
          <include name="edu/**"/>
357
          <include name="com/**"/>
358 877 jones
          <include name="**/*.sql"/>
359 822 jones
          <exclude name="**/CVS*"/>
360
          <exclude name="**/.#*"/>
361
        </fileset>
362
      </copy>
363 2344 sgarg
      <available file="lib/style/common/emlb6toeml2" type="dir"
364 1954 jones
                 property="styles.not.needed"/>
365 348 jones
   </target>
366
367 1939 brooke
   <target name="compile" depends="prepare,utilities"
368 1986 jones
    description="Compiles java code to build dir, and copies metacat props files there">
369 1939 brooke
370 1311 berkley
       <javac srcdir="${build.src}"
371
              destdir="${build.dest}"
372
              classpath="${cpath}"
373 1827 jones
              debug="${debug}"
374 2135 costa
              excludes="**/*.sql **/stringclient/** **/client/*.java **/harvesterClient/*.java"/>
375 1311 berkley
   </target>
376 113 jones
377 2322 jones
   <target name="jar" depends="compile,geteml"
378 1939 brooke
    description="Compiles and jars metacat java code to metacat.jar in build dir">
379
380 353 jones
       <delete file="${build.dir}/${name}.jar" />
381 635 jones
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
382 2135 costa
            excludes="**/protocols/ **/harvesterClient/" />
383 1311 berkley
   </target>
384
385 1939 brooke
   <target name="protocol" depends="compile"
386
    description="Compiles and jars protocol java code to protocol.jar in build dir">
387 635 jones
       <delete file="${build.dir}/protocol.jar" />
388
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
389
            includes="**/protocols/" />
390 1311 berkley
   </target>
391 113 jones
392 2317 jones
   <target name="utilities" depends="config" if="utilities.required">
393 1796 jones
     <ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
394
     <ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
395 1780 jones
     <copy file="${utilitiesdir}/lib/httpclient.jar" todir="lib" />
396
     <copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
397
   </target>
398
399 1939 brooke
   <target name="client" depends="utilities, prepare"
400
    description="Compiles metacat-client java code to build dir">
401 1780 jones
       <javac srcdir="${build.src}"
402
              destdir="${build.dest}"
403
              classpath="${cpath}"
404
              includes="edu/ucsb/nceas/metacat/client/*" />
405
   </target>
406
407 1939 brooke
   <target name="clientjar" depends="client"
408
    description="Compiles and jars metacat-client java code to metacat-client.jar in build dir">
409 1780 jones
       <delete file="${build.dir}/${name}-client.jar" />
410
       <jar jarfile="${build.dir}/${name}-client.jar" basedir="${build.dest}"
411
            includes="**/metacat/client/" />
412
   </target>
413
414 2059 costa
   <target name="harvester" depends="client"
415 1950 costa
           description="Compiles harvester java code to build dir">
416
       <echo message="classpath is:   ${cpath}"/>
417
       <javac srcdir="${build.src}"
418
              destdir="${build.dest}"
419
              classpath="${cpath}"
420
              includes="edu/ucsb/nceas/metacat/harvesterClient/*" />
421
   </target>
422
423
   <target name="harvesterjar" depends="harvester"
424 2059 costa
           description="Compiles and jars harvester java code to harvester.jar in build dir">
425
       <delete file="${build.dir}/harvester.jar" />
426
       <jar jarfile="${build.dir}/harvester.jar" basedir="${build.dest}"
427 1950 costa
            includes="**/metacat/harvesterClient/" />
428
   </target>
429
430 2318 jones
   <target  name="geteml" depends="getemlpre2,geteml2+" if="eml.required"
431 1939 brooke
            description="Calls getemlpre2 and geteml2+ targets" />
432
433 2318 jones
   <target name="getemlpre2" depends="prepare" if="eml.required"
434 1939 brooke
   description="Checks EML-beta6 out of cvs and copies dtds and xsl to your metacat cvs sandbox">
435 1612 tao
     <echo>Enter CVS password: </echo>
436
     <cvs cvsRoot="${cvsroot}"
437
          package="${eml-module}"
438
          tag="${eml-tag}"
439 1939 brooke
          dest="${build.tmp}/eml_${eml-tag}" />
440 1612 tao
     <mkdir dir="lib/dtd" />
441
     <copy todir="lib/dtd" filtering="yes">
442 1939 brooke
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}">
443 1612 tao
         <include name="*.dtd"/>
444
       </fileset>
445
       <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
446
     </copy>
447 2228 sgarg
448
     <copy todir="${style-common-cvsrelpath}" filtering="yes">
449
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}/style">
450
       <include name="**/*.xsl"/>
451
     </fileset>
452
     </copy>
453 1939 brooke
   </target>
454
455 2318 jones
   <target name="geteml2+" depends="prepare" if="eml.required"
456 1939 brooke
   description="Checks eml-2 out of cvs and copies schema and xsl to your metacat cvs sandbox">
457
     <echo>Enter CVS password: </echo>
458 1612 tao
     <cvs cvsRoot="${cvsroot}"
459
          package="${eml-module}"
460 2228 sgarg
          tag="${eml2_0_0-tag}"
461
          dest="${build.tmp}/eml_${eml2_0_0-tag}" />
462
     <mkdir dir="lib/schema/eml-2.0.0" />
463
     <copy todir="lib/schema/eml-2.0.0" filtering="yes">
464
       <fileset dir="${build.tmp}/eml_${eml2_0_0-tag}/${eml-module}">
465 1612 tao
         <include name="*.xsd"/>
466
       </fileset>
467 2175 tao
468 1939 brooke
       <!-- shouldn't we have a mapper here like this??
469
       <mapper type="glob" from="eml-*.xsd" to="eml-*-${eml-version}.xsd" />
470 2175 tao
471
       Jing's code didn't nave one - does it need to be added?
472 1939 brooke
       NOTE that eml-version is set to beta 6, so this would need changing -->
473 2175 tao
474 1612 tao
     </copy>
475 1939 brooke
     <antcall target="copyxsl">
476 2228 sgarg
        <param name="cvs.tagname" value="${eml2_0_0-tag}" />
477
        <param name="dirname" value="eml-2.0.0" />
478 1939 brooke
     </antcall>
479 2228 sgarg
480
     <echo>Enter CVS password: </echo>
481
     <cvs cvsRoot="${cvsroot}"
482
          package="${eml-module}"
483
          tag="${eml2_0_1-tag}"
484
          dest="${build.tmp}/eml_${eml2_0_1-tag}" />
485
     <mkdir dir="lib/schema/eml-2.0.1" />
486
     <copy todir="lib/schema/eml-2.0.1" filtering="yes">
487
       <fileset dir="${build.tmp}/eml_${eml2_0_1-tag}/${eml-module}">
488
         <include name="*.xsd"/>
489
       </fileset>
490
     </copy>
491
     <antcall target="copyxsl">
492
        <param name="cvs.tagname" value="${eml2_0_1-tag}" />
493
        <param name="dirname" value="eml-2.0.1" />
494
     </antcall>
495 1939 brooke
   </target>
496
497 2175 tao
498
499
   <target  name="copyxsl"
500 1939 brooke
   description="Copies xsl stylesheets from checkout in build/tmp to your metacat cvs sandbox">
501
502
     <delete file="${style-common-cvsrelpath}/${eml-css}"/>
503 2175 tao
504 2228 sgarg
     <copy todir="${style-common-cvsrelpath}/${dirname}" filtering="yes">
505
       <fileset dir="${build.tmp}/eml_${cvs.tagname}/${eml-module}/style/eml">
506 1929 brooke
       <include name="**/*.xsl"/>
507 1612 tao
     </fileset>
508
     </copy>
509 1939 brooke
510 2175 tao
511
     <!-- now copy default css from eml module and put it in style-common-path
512 1933 brooke
          dir with a new name, so other skin-specific css can import it if reqd -->
513 1939 brooke
     <copy file="${build.tmp}/eml_${cvs.tagname}/${eml-module}/${eml-module.default.css}"
514 1938 brooke
           tofile="${style-common-cvsrelpath}/${eml-css}" />
515 1612 tao
516 1463 tao
   </target>
517 2175 tao
518
519
520 2322 jones
   <target name="register-schemas" depends="prepare"
521
   description="Registers the Schemas with a new Metacat instance">
522 877 jones
     <echo/>
523 2322 jones
     <echo>Registering the Schemas with the new Metacat instance...</echo>
524 877 jones
     <sql driver="${dbDriver}"
525 1744 tao
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
526 877 jones
          url="${jdbc-connect}"
527
          userid="${user}"
528
          password="${password}"
529 1593 tao
          src="${build.src}/loaddtdschema.sql" />
530 877 jones
   </target>
531 1716 berkley
532 1939 brooke
   <target name="installdb" depends="prepare"
533
            description="Installs the database tables">
534 1827 jones
     <echo/>
535
     <echo>Installing the database tables...</echo>
536
     <sql driver="${dbDriver}"
537
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
538
          url="${jdbc-connect}"
539
          userid="${user}"
540
          password="${password}"
541 2103 jones
          src="${build.src}/${install-sql}" />
542 1827 jones
   </target>
543
544 1939 brooke
   <target name="upgrade12" depends="prepare"
545
            description="Updates the database tables to upgrade to version 1.2">
546 1827 jones
     <echo/>
547
     <echo>Updating the database tables to upgrade to version 1.2...</echo>
548
     <sql driver="${dbDriver}"
549
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
550
          url="${jdbc-connect}"
551
          userid="${user}"
552
          password="${password}"
553 2103 jones
          src="${build.src}/${upgrade-1.2-sql}" />
554 1827 jones
   </target>
555
556 1939 brooke
   <target name="upgrade13" depends="prepare"
557
            description="Updates the database tables to upgrade to version 1.3">
558 1827 jones
     <echo/>
559
     <echo>Updating the database tables to upgrade to version 1.3...</echo>
560
     <sql driver="${dbDriver}"
561
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
562
          url="${jdbc-connect}"
563
          userid="${user}"
564
          password="${password}"
565 2103 jones
          src="${build.src}/${upgrade-1.3-sql}" />
566 1827 jones
   </target>
567
568 2103 jones
   <target name="upgrade14" depends="prepare"
569
            description="Updates the database tables to upgrade to version 1.4">
570
     <echo/>
571
     <echo>Updating the database tables to upgrade to version 1.4...</echo>
572
     <sql driver="${dbDriver}"
573
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
574
          url="${jdbc-connect}"
575
          userid="${user}"
576
          password="${password}"
577
          src="${build.src}/${upgrade-1.4-sql}" />
578
   </target>
579
580 2353 sgarg
   <target name="upgrade15" depends="prepare"
581
	   description="Updates the database tables to upgrade to version 1.5">
582
     <echo/>
583
     <echo>Updating the database tables to upgrade to version 1.4...</echo>
584
     <copy file="${srcdir}/upgrade_db_to_1_5.java"
585
	   todir="${build.tmp}" filtering="yes"/>
586
587
     <javac srcdir="${build.tmp}"
588
            destdir="${build.tmp}"
589
            classpath="${cpath}"
590
            debug="${debug}"
591
            includes="upgrade_db_to_1_5.java"/>
592
593
     <java classname="upgrade_db_to_1_5"
594
           classpath="${cpath}:${build.tmp}"/>
595
596
   </target>
597
598 1952 jones
   <target name="install" depends="war" description="* Full Install *">
599 1079 tao
       <mkdir dir="${datafilepath}" />
600 1455 tao
       <mkdir dir="${inlinedatafilepath}" />
601 1079 tao
       <chmod dir="${datafilepath}" perm="ug+w" />
602 1929 brooke
       <mkdir dir="${temp-dir}"/>
603
       <chmod dir="${temp-dir}" perm="ug+w" />
604 1952 jones
       <copy file="${build.dir}/${context}.war" todir="${webapps}"/>
605
   </target>
606 2175 tao
607
   <target name="upgrade" depends="install"
608 1952 jones
          description="* Upgrade an existing metacat installation with a new version *">
609
       <unwar src="${webapps}/${context}.war" dest="${webapps}/${context}" />
610
   </target>
611
612 2175 tao
   <target name="install-registry" depends="init,getConversionXSL"
613 1952 jones
            description="Install Registry">
614 2175 tao
615 1952 jones
      <copy file="${srcdir}/perl/register-dataset.cgi"
616
            todir="${inst.cgi.dir}" filtering="yes"/>
617
      <chmod file="${inst.cgi.dir}/register-dataset.cgi" perm="ugo+x" />
618 2175 tao
619 1952 jones
      <mkdir dir="${temp-dir}" />
620 2343 sgarg
      <copy todir="${temp-dir}" filtering="yes">
621
       <fileset dir="lib/style/common/emlb6toeml2">
622 1952 jones
         <include name="*.xsl"/>
623
         <include name="*.xml"/>
624
       </fileset>
625 2343 sgarg
      </copy>
626 1952 jones
627
      <echo message="Install Registry completed." />
628
   </target>
629
630 2343 sgarg
   <target name="install-ldap" depends="init">
631
      <copy file="${srcdir}/perl/ldapweb.cgi"
632
            todir="${inst.cgi.dir}" filtering="yes"/>
633
      <chmod file="${inst.cgi.dir}/ldapweb.cgi" perm="ugo+x" />
634
      <copy file="lib/ldapweb.cfg"
635
            todir="${inst.cgi.dir}" filtering="yes"/>
636
      <chmod file="${inst.cgi.dir}/ldapweb.cfg" perm="ugo+x" />
637
      <mkdir dir="${templates.dir}" />
638
      <copy todir="${templates.dir}" filtering="yes">
639
        <fileset dir="lib/style/common/templates">
640
            <include name="${defaultChangePass}"/>
641
            <include name="${defaultResetPass}"/>
642
            <include name="${changePassSuccess}"/>
643
            <include name="${resetPassSuccess}"/>
644
            <include name="${registerFailed}"/>
645
            <include name="${registerLter}"/>
646
            <include name="${registerMatch}"/>
647
            <include name="${registerSuccess}"/>
648
            <include name="${register}"/>
649
            <include name="${searchResults}"/>
650
        </fileset>
651
      </copy>
652
      <echo message="ldapweb install complete." />
653
   </target>
654
655
656 2175 tao
   <target name="install-skin" depends="init"
657 2052 sgarg
            description="Install a Skin">
658
659 2175 tao
      <input message="Please enter name of the skin"
660 2052 sgarg
             addproperty="skin-name"/>
661
662
      <mkdir dir="${installdir}/style/skins/${skin-name}" />
663
      <copy todir="${installdir}/style/skins/${skin-name}" filtering="yes">
664
       <fileset dir="lib/style/skins/${skin-name}">
665 2054 sgarg
           <exclude name="*.png"/>
666
           <exclude name="*.gif"/>
667 2210 jones
           <exclude name="*.jpg"/>
668 2277 jones
           <exclude name="**/CVS*"/>
669
           <exclude name="**/.#*"/>
670 2052 sgarg
       </fileset>
671
      </copy>
672 2054 sgarg
     <copy todir="${installdir}/style/skins/${skin-name}" filtering="no">
673
       <fileset dir="lib/style/skins/${skin-name}">
674
           <include name="*.png"/>
675
           <include name="*.gif"/>
676 2210 jones
           <include name="*.jpg"/>
677 2277 jones
           <exclude name="**/CVS*"/>
678
           <exclude name="**/.#*"/>
679 2054 sgarg
       </fileset>
680
      </copy>
681 2277 jones
      <!--
682 2210 jones
      <mkdir dir="${installdir}/style/skins/${skin-name}/images" />
683
     <copy todir="${installdir}/style/skins/${skin-name}/images" filtering="no">
684
       <fileset dir="lib/style/skins/${skin-name}/images">
685
           <include name="*.png"/>
686
           <include name="*.gif"/>
687
           <include name="*.jpg"/>
688
       </fileset>
689
      </copy>
690 2277 jones
      -->
691 2052 sgarg
692
      <echo message="Install Skin completed." />
693
   </target>
694
695 1952 jones
   <target name="war" depends="warPrepare,warMSSQL"
696
            description="Create a web archive (WAR) for servlet deployment">
697 2175 tao
       <war destfile="${build.dir}/${context}.war"
698 1952 jones
            webxml="${build.war}/web.xml">
699
         <fileset dir="${war.context}"/>
700
         <lib dir="${war.lib}"/>
701
         <webinf dir="${war.webinf}"/>
702
       </war>
703
   </target>
704
705 2059 costa
   <target name="warPrepare" depends="jar,clientjar,harvesterjar"
706 1952 jones
            description="Prepare files for creating a web archive (WAR)">
707
708
       <property name="war.lib" value="${build.war}/lib" />
709
       <property name="war.webinf" value="${build.war}/WEB-INF" />
710
       <property name="war.context" value="${build.war}/${context}" />
711
       <mkdir dir="${war.lib}" />
712
       <mkdir dir="${war.webinf}" />
713
       <mkdir dir="${war.context}" />
714
715
       <copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
716
       <copy file="${build.dir}/${name}-client.jar" todir="${war.lib}" />
717 2059 costa
       <copy file="${build.dir}/harvester.jar" todir="${war.lib}" />
718 1952 jones
       <copy todir="${war.lib}" filtering="no">
719 1823 jones
         <fileset dir="lib">
720
           <include name="*.jar"/>
721
         </fileset>
722
         <fileset dir="lib/xalan">
723
           <include name="*.jar"/>
724
         </fileset>
725
       </copy>
726 1952 jones
       <copy file="${jdbc}" tofile="${war.lib}/jdbc.jar" />
727 1729 tao
       <copy file="lib/web.xml.${tomcatversion}"
728 1952 jones
             tofile="${build.war}/web.xml" />
729
       <copy file="lib/metacat.properties" todir="${war.webinf}"
730 1951 jones
             filtering="yes" />
731 1952 jones
       <copy todir="${war.context}" filtering="no">
732 822 jones
         <fileset dir="lib">
733
           <include name="**/*.jpg"/>
734
           <include name="**/*.png"/>
735
           <include name="**/*.gif"/>
736
         </fileset>
737
       </copy>
738 1952 jones
       <copy todir="${war.context}" filtering="yes">
739 822 jones
         <fileset dir="lib">
740
           <exclude name="*.jar"/>
741
           <exclude name="*.properties"/>
742
           <exclude name="web.xml"/>
743 1437 berkley
           <exclude name="**/*.jpg"/>
744
           <exclude name="**/*.png"/>
745
           <exclude name="**/*.gif"/>
746 822 jones
         </fileset>
747
       </copy>
748 1952 jones
       <copy todir="${war.context}" filtering="no">
749 1929 brooke
         <fileset dir="lib">
750
           <include name="**/*.jpg"/>
751
           <include name="**/*.png"/>
752
           <include name="**/*.gif"/>
753
         </fileset>
754
       </copy>
755 1311 berkley
   </target>
756 1929 brooke
757 1952 jones
   <target name="warMSSQL" if="MSSQL" depends="warPrepare">
758
      <copy file="${jdbc-add1}" tofile="${war.lib}/msutil.jar" />
759
       <copy file="${jdbc-add2}" tofile="${war.lib}/mssqlserver.jar" />
760 1929 brooke
   </target>
761
762 2175 tao
   <target name="getConversionXSL" depends="prepare"
763 1954 jones
            unless="styles.not.needed"
764 1939 brooke
            description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
765 1929 brooke
     <echo>Enter CVS password: </echo>
766
     <cvs cvsRoot="${cvsroot-alternate}"
767
          package="${conversion-module}"
768
          dest="${build.tmp}" />
769 2343 sgarg
770
     <mkdir dir="lib/style/common/emlb6toeml2" />
771
      <copy todir="lib/style/common/emlb6toeml2" filtering="yes">
772
       <fileset dir="${build.tmp}/${conversion-module}/lib/style">
773
         <include name="*.xsl"/>
774
         <include name="*.xml"/>
775
       </fileset>
776
      </copy>
777 1929 brooke
   </target>
778
779 2135 costa
   <target name="testprep" depends="jar,clientjar,harvesterjar">
780 1783 jones
      <mkdir dir="${build.tests}"/>
781
      <copy todir="${build.tests}" filtering="yes">
782
        <fileset dir="${testdir}">
783
          <include name="edu/**"/>
784
        </fileset>
785
      </copy>
786 971 tao
      <!-- copy and compile the tests into a jar file -->
787 1783 jones
      <javac srcdir="${build.tests}"
788
             destdir="${build.tests}"
789 2135 costa
             classpath="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/harvester.jar"
790 1612 tao
             debug="on"
791 1311 berkley
       includes="**/*.java" />
792 204 jones
793 1311 berkley
      <jar jarfile="${build.dir}/${name}-junittests.jar"
794 1783 jones
        basedir="${build.tests}"
795 1311 berkley
                includes="**/*.class" />
796 1822 jones
   </target>
797 971 tao
798 1939 brooke
   <target name="test" depends="testprep"
799
            description="Uses the ant junit task to run all JUnit tests">
800 1822 jones
801 971 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
802 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
803 971 tao
             haltonerror="no">
804 1783 jones
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
805 971 tao
        <classpath>
806 1783 jones
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/${name}-junittests.jar" />
807 971 tao
        </classpath>
808
809
        <formatter type="plain" />
810
811
        <batchtest fork="yes" todir="${build.dir}">
812 1783 jones
          <fileset dir="${build.tests}">
813 1116 tao
            <include name="**/*.class" />
814 971 tao
          </fileset>
815
        </batchtest>
816
     </junit>
817
   </target>
818 1103 tao
819 1939 brooke
    <target name="runonetest" depends="testprep"
820
            description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
821 1500 tao
822 1939 brooke
              <echo>testtorun: ${testtorun}</echo>
823
824 1500 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
825 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
826 1500 tao
             haltonerror="no">
827 2044 tao
        <!--<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>-->
828 1500 tao
        <classpath>
829 1783 jones
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/${name}-junittests.jar" />
830 1500 tao
        </classpath>
831
832
        <formatter type="plain" />
833
834
        <batchtest fork="yes" todir="${build.dir}">
835 1783 jones
          <fileset dir="${build.tests}">
836 1500 tao
            <include name="**/${testtorun}.class" />
837
          </fileset>
838
        </batchtest>
839
     </junit>
840
   </target>
841
842 2175 tao
   <target name="testharvester"
843 2135 costa
           depends="testprep"
844
           description="Uses the ant junit task to test only the Harvester code">
845 2175 tao
     <junit printsummary="yes"
846
            haltonfailure="off"
847 2135 costa
            fork="yes"
848
            haltonerror="off">
849
       <classpath>
850
         <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/harvester.jar:${build.dir}/${name}-junittests.jar" />
851
       </classpath>
852
       <formatter type="plain" />
853
       <batchtest fork="yes" todir="${build.dir}">
854
         <fileset dir="${build.tests}">
855
           <include name="**/harvesterClient/*.class" />
856
         </fileset>
857
       </batchtest>
858
     </junit>
859
   </target>
860
861 1939 brooke
  <target name="gethttpclient" depends="prepare"
862
            description="checks out and compiles morpho httpclient code">
863 1311 berkley
  <!--mkdir dir="${morphosourcedir}" -->
864 1487 tao
        <cvs cvsRoot="${cvsroot}"
865 1103 tao
             package="morpho"
866
             dest="." />
867 1107 tao
        <ant dir="${morphosourcedir}" inheritAll="false"  target="jar" />
868 1103 tao
   </target>
869
870
   <!-- run this target, we need to check out a another morpho souce dir was checked out. -->
871 1939 brooke
   <target name="nettest" depends="install"
872
            description="compiles and runs the metacatnettest code">
873 2175 tao
874 1103 tao
      <echo>***********************************
875 1311 berkley
      Please run ant gethttpclient first!
876
      ***********************************
877 1103 tao
      </echo>
878
      <!-- copy and compile the tests into a jar file -->
879 1116 tao
      <mkdir dir="${build.metacatnettest}"/>
880 1103 tao
      <javac srcdir="${junitnettestsdir}"
881 1116 tao
             destdir="${build.metacatnettest}"
882 1103 tao
             classpath="${cpath}:${build.dir}/${name}.jar:${httpclient}"
883
             includes="**/*.java" />
884
885
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
886 1116 tao
                    basedir="${build.metacatnettest}"
887 1103 tao
                    includes="**/*.class" />
888
889
      <!-- use the ant "junit" task to run JUnit tests. -->
890 1107 tao
      <junit printsummary="yes" haltonfailure="no" fork="yes"
891 1103 tao
             haltonerror="no">
892 1107 tao
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
893 1103 tao
        <classpath>
894 1807 tao
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${httpclient}:${build.dir}/${name}-junitnettests.jar:${itislib}" />
895 1103 tao
        </classpath>
896
897
        <formatter type="plain" />
898
899
        <batchtest fork="yes" todir="${build.dir}">
900 1116 tao
          <fileset dir="${build.metacatnettest}">
901
            <include name="**/*.class" />
902 1103 tao
          </fileset>
903
        </batchtest>
904
     </junit>
905 1311 berkley
   </target>
906 1103 tao
907 1939 brooke
   <target name="cleanweb" depends="clean"
908
            description="deletes tomcat web context dir and all its contents">
909 1522 berkley
     <delete dir="${installdir}" />
910
   </target>
911
912
913 1939 brooke
   <target name="clean" depends="init"
914 2320 jones
            description="deletes build dir and files that can be regenerated form the release">
915 822 jones
       <delete dir="${build.dir}" />
916 2320 jones
   </target>
917
918
   <target name="fullclean" depends="clean"
919
            description="deletes even jars that depend on external sources such as stylesheets and jars">
920
       <delete file="lib/httpclient.jar" />
921
       <delete file="lib/utilities.jar" />
922 1939 brooke
       <delete includeEmptyDirs="true" failonerror="false">
923
         <fileset dir="${style-common-cvsrelpath}">
924
           <include name="${eml-css}" />
925
           <include name="eml-*/*.xsl" />
926
           <include name="eml-*" />
927
         </fileset>
928 2320 jones
       </delete>
929 113 jones
   </target>
930
931 1939 brooke
   <target name="jdoc" depends="prepare"
932
            description="generates javadoc documentation">
933 822 jones
       <javadoc packagenames="edu.ucsb.nceas.*"
934 516 jones
           sourcepath="${build.src}"
935
           destdir="${build.javadocs}"
936 2319 jones
           classpath="${cpath}"
937 113 jones
           author="true"
938
           version="true"
939
           use="true"
940 348 jones
           windowtitle="${Name} API"
941
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
942 113 jones
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;"
943
       />
944
   </target>
945
946 2317 jones
   <target name="dist" depends="geteml,jar,protocol,jdoc"
947 1939 brooke
            description="prepares a full release distribution">
948 806 jones
      <mkdir dir="${dist.dir}"/>
949
      <delete dir="${ver.dir}" />
950
      <mkdir dir="${ver.dir}"/>
951
      <copy todir="${ver.dir}">
952 1311 berkley
        <fileset dir="."
953 2323 jones
            excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/**"/>
954 806 jones
      </copy>
955
      <copy todir="${ver.dir}" file="build.xml"/>
956 2317 jones
      <copy todir="${ver.dir}" file="build.properties"/>
957 882 jones
958
      <copy todir="${ver.dir}/docs" filtering="yes">
959
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
960
      </copy>
961
      <copy todir="${ver.dir}/docs" filtering="no">
962
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
963
      </copy>
964 806 jones
      <copy todir="${ver.dir}/docs/dev">
965
        <fileset dir="${build.dir}/docs"/>
966
      </copy>
967 917 berkley
      <copy todir="${ver.dir}/src">
968
        <fileset dir="${build.dir}/src"/>
969
      </copy>
970
971 2323 jones
      <!--
972 992 berkley
      <delete dir="./${ver.dir}/${build.dir}"/>
973
      <delete dir="./${ver.dir}/dist"/>
974 2323 jones
      -->
975 882 jones
      <delete file="./${name}-${release}.zip"/>
976 1312 tao
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
977 882 jones
      <delete file="./${name}-${release}.tar.gz" />
978 1312 tao
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
979 1311 berkley
      <gzip zipfile="./${name}-${release}.tar.gz"
980 882 jones
                src="./${name}-${release}.tar"/>
981
      <delete file="./${name}-${release}.tar" />
982 1311 berkley
  </target>
983 806 jones
984 1939 brooke
  <target name="distsrc" depends="dist"
985
            description="prepares a source distribution">
986 806 jones
      <mkdir dir="${ver.src}"/>
987
      <copy todir="${ver.src}">
988
        <fileset dir="./src"/>
989
      </copy>
990
991 882 jones
      <delete file="./${name}-src-${release}.zip"/>
992
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
993
      <delete file="./${name}-src-${release}.tar.gz" />
994
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
995 1311 berkley
      <gzip zipfile="./${name}-src-${release}.tar.gz"
996 882 jones
                src="./${name}-src-${release}.tar"/>
997
      <delete file="./${name}-src-${release}.tar" />
998 807 jones
      <delete dir="${dist.dir}"/>
999 1311 berkley
  </target>
1000 806 jones
1001 1702 tao
   <target name="stylesheettest">
1002 1939 brooke
     <xslt in="${input}" out="eml.html" style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1003 1702 tao
      <param name="displaymodule" expression="${displaymodule}"/>
1004
      <param name="docid" expression="${input}"/>
1005
      <param name="entitytype" expression="${entitytype}"/>
1006
      <param name="entityindex" expression="${entityindex}"/>
1007
      <outputproperty name="method" value="html"/>
1008
      <outputproperty name="standalone" value="yes"/>
1009
      <outputproperty name="encoding" value="iso8859_1"/>
1010
      <outputproperty name="indent" value="yes"/>
1011
    </xslt>
1012
  </target>
1013 2175 tao
1014 1819 tao
 <target name="gridinit" depends="init">
1015
   <property name="java2wsdl.tool" value="org.apache.axis.wsdl.Java2WSDL" />
1016
   <property name="wsdldecorator.tool" value="org.globus.ogsa.tools.wsdl.DecorateWSDL" />
1017
   <property name="wsdl.tool" value="org.globus.ogsa.tools.wsdl.GSDL2Java"/>
1018
   <property environment="env"/>
1019
   <property name="binding.file" value="${env.GLOBUS_LOCATION}/schema/ogsi/ogsi_bindings.wsdl"/>
1020 1820 tao
    <path id="webservicepath">
1021
        <pathelement location="."/>
1022
        <pathelement location="${env.JAVA_HOME}/../lib/tools.jar"/>
1023
        <pathelement location="${build.dest}"/>
1024
        <fileset dir="${env.GLOBUS_LOCATION}/lib">
1025
           <include name="*.jar"/>
1026
        </fileset>
1027
      </path>
1028 1819 tao
</target>
1029
1030 1821 tao
 <target name="gridprepare" depends="gridinit, prepare">
1031 2175 tao
 </target>
1032
1033 1821 tao
  <target name="compileinterface" depends="clean, gridprepare">
1034 1817 tao
    <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/${interface.name}.java" />
1035 1811 tao
  </target>
1036 2175 tao
1037 1811 tao
  <target name="generateWSDL" depends="compileinterface">
1038
    <echo message="Generating wsdl from ${interface.name} interface"/>
1039
    <java classname="${java2wsdl.tool}"
1040 1814 tao
          dir="${build.src}" fork="yes"
1041 1811 tao
          classpathref="webservicepath"  failonerror="true" >
1042
      <arg value="-P"/>
1043
      <arg value="${interface.name}PortType"/>
1044
      <arg value="-S"/>
1045
      <arg value="${interface.name}Service"/>
1046
      <arg value="-y"/>
1047
      <arg value="WRAPPED"/>
1048
      <arg value="-u"/>
1049
      <arg value="LITERAL"/>
1050
      <arg value="-l"/>
1051
      <arg value="http://localhost/ogsa/services/${interface.name}Service"/>
1052
      <arg value="-n"/>
1053
      <arg value="http://${services.namespace}/${interface.name}"/>
1054
      <arg value="${interface.package}.${interface.name}"/>
1055
    </java>
1056
  </target>
1057 2175 tao
1058 1811 tao
   <target name="decorateWSDL" depends="generateWSDL">
1059
      <property name="wsdl.file" value="${interface.name}Service.wsdl"/>
1060 1814 tao
      <java classname="${wsdldecorator.tool}" dir="${build.src}"
1061 1811 tao
            fork="yes"
1062
            classpathref="webservicepath" failonerror="true" >
1063
        <arg value="${binding.file}"/>
1064
        <arg value="${wsdl.file}"/>
1065
      </java>
1066
   </target>
1067 2175 tao
1068 1811 tao
   <target name="generatestubs" depends="decorateWSDL">
1069
      <echo message=" Generating stubs " />
1070 1814 tao
      <echo message="wsdl file is ${wsdl.file}"/>
1071
      <echo message="build.src is ${build.src}"/>
1072 1811 tao
      <java classname="${wsdl.tool}" dir="${build.src}" fork="yes"
1073
            classpathref="webservicepath" failonerror="true" >
1074 1814 tao
         <arg value="${wsdl.file}"/>
1075 1811 tao
    </java>
1076
  </target>
1077 2175 tao
1078 1811 tao
  <target name="compileStubsAndImpl" depends="generatestubs, utilities">
1079
     <echo message=" Compiling stubs " />
1080
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" includes="**/${interface.name}/*.java" />
1081
     <echo message=" Compiling impl " />
1082
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" classpath="./lib/utilities.jar" includes="**/impl/*.java" />
1083
  </target>
1084 2175 tao
1085 1811 tao
  <target name="jarStubsAndImpl" depends="compileStubsAndImpl">
1086
     <echo message=" jar stubs classes " />
1087
     <jar destfile="${build.dir}/${interface.name}-stubs.jar" basedir="${build.dest}" includes="**/${interface.name}/*.class" />
1088
     <echo message=" jar impl classes " />
1089
     <jar destfile="${build.dir}/${interface.name}.jar" basedir="${build.dest}" includes="**/impl/*.class" />
1090
  </target>
1091 2175 tao
1092 1811 tao
  <target name="gar" depends="jarStubsAndImpl">
1093
     <echo message=" jar the gar file"/>
1094
     <mkdir dir="${build.dir}/gar"/>
1095
     <mkdir dir="${build.dir}/gar/schema/edu"/>
1096
     <copy file="${build.dir}/${interface.name}.jar" todir="${build.dir}/gar" />
1097
     <copy file="${build.dir}/${interface.name}-stubs.jar" todir="${build.dir}/gar" />
1098 1814 tao
     <copy file="lib/utilities.jar" todir="${build.dir}/gar" />
1099
     <copy file="lib/server-deploy.wsdd" todir="${build.dir}/gar" />
1100
     <copy file="${build.src}/${interface.name}Service.wsdl" todir="${build.dir}/gar/schema/edu" />
1101
     <jar destfile="lib/${interface.name}.gar" basedir="${build.dir}/gar"/>
1102 1811 tao
  </target>
1103 2175 tao
1104 1814 tao
  <target name="compilewebclient" depends="prepare">
1105
     <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/application/*.java" classpathref="webservicepath" />
1106
  </target>
1107 2175 tao
1108 1814 tao
  <target name="runwebclient" depends="compilewebclient">
1109 2175 tao
     <java classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
1110 1814 tao
           dir="${build.dest}" fork="yes"
1111
           classpathref="webservicepath" classpath="./lib/utilities.jar" failonerror="true">
1112
         <arg value="${serviceUrl}"/>
1113
         <arg value="${docid}"/>
1114
     </java>
1115
  </target>
1116 113 jones
</project>