Project

General

Profile

1 113 jones
<?xml version="1.0"?>
2
<!--
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
  *      '$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 113 jones
-->
32 329 jones
<project name="metacat" default="jar" basedir=".">
33 113 jones
   <target name="init">
34 685 jones
      <property name="jdbc-connect"
35 906 berkley
                value="jdbc:postgresql://localhost/berkley"/>
36
      <property name="installdir" value="/home/berkley/tomcat/webapps/metacat" />
37
      <property name="dbDriver" value="org.postgresql.Driver"/>
38 348 jones
      <property name="name" value="metacat"/>
39
      <property name="Name" value="MetaCat"/>
40 895 berkley
      <property name="release" value="1.0.3"/>
41 685 jones
      <property name="web-base-url"
42 906 berkley
                value="http://alpha.nceas.ucsb.edu:8080/"/>
43 887 berkley
44
      <property name="replication-path" value="/servlet/replication"/>
45 889 berkley
      <property name="servlet-path" value="/metacat/servlet/metacat"/>
46
      <property name="html-path" value="/metacat"/>
47
      <property name="image-path" value="/img/metacat" />
48
      <property name="style-path" value="/metacat/style"/>
49 906 berkley
      <property name="server" value="alpha.nceas.ucsb.edu:8080"/>
50
      <property name="replication-log" value="/home/berkley/tomcat/webapps/metacat/metacatreplication.log"/>
51
      <property name="user" value="berkley"/>
52
      <property name="password" value=""/>
53 832 jones
      <property name="config-dir" value="${installdir}" />
54
      <property name="default-style" value="knb" />
55 877 jones
      <property name="eml-module" value="mdstandards/eml" />
56
      <property name="eml-version" value="2.0.0beta6" />
57
      <property name="eml-tag" value="RELEASE_EML_2_0_0_BETA_6" />
58
      <property name="cvsroot"
59 887 berkley
                value=":ext:berkley@cvs.nceas.ucsb.edu:/cvs/pbi" />
60 348 jones
61 882 jones
62
      <filter token="docrooturl" value="./" />
63 588 berkley
      <filter token="jdbc-connect" value="${jdbc-connect}"/>
64 882 jones
      <filter token="dbDriver" value="${dbDriver}"/>
65 614 bojilova
      <filter token="install-dir" value="${installdir}"/>
66 882 jones
      <filter token="serverhost" value="${serverhost}"/>
67 586 berkley
      <filter token="server" value="${server}"/>
68
      <filter token="replication-log" value="${replication-log}"/>
69 348 jones
      <filter token="release" value="${release}"/>
70
      <filter token="servlet-path" value="${servlet-path}"/>
71 359 bojilova
      <filter token="html-path" value="${html-path}"/>
72 362 jones
      <filter token="user" value="${user}"/>
73
      <filter token="password" value="${password}"/>
74 409 berkley
      <filter token="image-path" value="${image-path}"/>
75 828 jones
      <filter token="style-path" value="${style-path}"/>
76 506 jones
      <filter token="web-base-url" value="${web-base-url}"/>
77 525 berkley
      <filter token="replication-path" value="${replication-path}"/>
78 832 jones
      <filter token="config-dir" value="${config-dir}"/>
79
      <filter token="default-style" value="${default-style}"/>
80 877 jones
      <filter token="eml-version" value="${eml-version}"/>
81
82 254 jones
      <property name="srcdir" value="./src" />
83 348 jones
      <property name="build.dir" value="./build"/>
84
      <property name="build.src" value="${build.dir}/src"/>
85
      <property name="build.dest" value="${build.dir}/classes"/>
86 516 jones
      <property name="build.docs" value="${build.dir}/docs"/>
87 348 jones
      <property name="build.samples" value="${build.dir}/samples"/>
88
      <property name="build.tests" value="${build.dir}/tests"/>
89
      <property name="build.data" value="${build.dir}/data"/>
90 806 jones
      <property name="build.javadocs" value="${build.dir}/docs/api"/>
91 887 berkley
      <property name="build.img" value="${installdir}/${image-path}"/>
92 348 jones
93 882 jones
      <property name="dist.dir" value="dist"/>
94 806 jones
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
95
      <property name="ver.src" value="${ver.dir}/src"/>
96
97 113 jones
      <property name="oracle_home"
98 329 jones
                value="/oracle01/app/oracle/product/8.1.6" />
99
      <property name="toolsdir"
100
                value="/usr/local/devtools" />
101 185 jones
      <property name="xmlp2"
102 906 berkley
                value="./lib/xerces.jar" />
103 113 jones
      <property name="jdbc"
104 906 berkley
                value="lib/jdbc7.1-1.2.jar" />
105 113 jones
      <property name="jserv"
106
                value="/usr/lib/apache/ApacheJServ.jar" />
107
      <property name="jsdk"
108 906 berkley
                value="/home/berkley/tomcat/lib/common/servlet.jar" />
109 213 jones
      <property name="srb"
110
                value="lib/srbrmi" />
111 798 jones
      <property name="cos"
112
                value="lib/cos.jar" />
113 906 berkley
      <property name="xalan"
114
                value="lib/xalan/xalan.jar" />
115
      <property name="xalanxml-apis"
116
                value="lib/xalan/xml-apis.jar" />
117 113 jones
      <property name="cpath"
118 906 berkley
                value="${xalan}:${xalanxml-apis}:${xmlp2}:${jdbc}:${jserv}:${jsdk}:${srb}:${cos}"/>
119 254 jones
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
120 113 jones
   </target>
121
122 348 jones
   <target name="prepare" depends="init">
123
      <mkdir dir="${build.dir}"/>
124
      <mkdir dir="${build.src}"/>
125
      <mkdir dir="${build.dest}"/>
126 516 jones
      <mkdir dir="${build.javadocs}"/>
127 348 jones
128 822 jones
      <copy todir="${build.src}" filtering="yes">
129
        <fileset dir="${srcdir}">
130
          <include name="edu/**"/>
131
          <include name="com/**"/>
132 877 jones
          <include name="**/*.sql"/>
133 822 jones
          <exclude name="**/CVS*"/>
134
          <exclude name="**/.#*"/>
135
        </fileset>
136
      </copy>
137 348 jones
   </target>
138
139
   <target name="compile" depends="prepare">
140
       <javac srcdir="${build.src}"
141
              destdir="${build.dest}"
142 257 jones
              classpath="${cpath}"
143
              excludes="**/*.sql" />
144 822 jones
       <copy file="lib/metacat.properties"
145
             tofile="${build.dest}/${package.home}/metacat.properties"
146
             filtering="yes" />
147
       <copy file="lib/srbProps.properties"
148
             tofile="${build.dest}/${package.home}/srbProps.properties"/>
149 113 jones
   </target>
150
151 204 jones
   <target name="jar" depends="compile">
152 353 jones
       <delete file="${build.dir}/${name}.jar" />
153 822 jones
       <copy todir="${build.dest}">
154
         <fileset dir="lib/srbrmi"/>
155
       </copy>
156 635 jones
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
157
            excludes="**/protocols/" />
158 113 jones
   </target>
159 635 jones
160
   <target name="protocol" depends="compile">
161
       <delete file="${build.dir}/protocol.jar" />
162
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
163
            includes="**/protocols/" />
164
   </target>
165 113 jones
166 877 jones
   <target name="getdtd" depends="prepare">
167
        <cvs cvsRoot="${cvsroot}"
168
             package="${eml-module}"
169
             tag="${eml-tag}"
170
             dest="${build.src}" />
171 879 jones
       <mkdir dir="lib/dtd" />
172
       <copy todir="lib/dtd" filtering="yes">
173
         <fileset dir="${build.src}/${eml-module}">
174
           <include name="*.dtd"/>
175
         </fileset>
176
         <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
177
       </copy>
178 877 jones
   </target>
179
180
   <target name="dtdsql" depends="prepare">
181
     <echo/>
182
     <echo>Registering the DTDs with the new Metacat instance...</echo>
183
     <sql driver="${dbDriver}"
184
          classpath="${jdbc}"
185
          url="${jdbc-connect}"
186
          userid="${user}"
187
          password="${password}"
188
          src="${build.src}/loaddtd.sql" />
189
   </target>
190
191 204 jones
   <target name="install" depends="jar">
192 329 jones
       <mkdir dir="${installdir}/WEB-INF/lib" />
193 822 jones
       <copy file="${build.dir}/${name}.jar"
194
             tofile="${installdir}/WEB-INF/lib/${name}.jar" />
195
       <copy file="${xmlp2}"
196
             tofile="${installdir}/WEB-INF/lib/xerces.jar" />
197
       <copy file="${xmlp}"
198
             tofile="${installdir}/WEB-INF/lib/xmlparserv2.jar" />
199
       <copy file="${jdbc}"
200
             tofile="${installdir}/WEB-INF/lib/oracle-jdbc111.jar" />
201
       <copy file="${cos}"
202
             tofile="${installdir}/WEB-INF/lib/cos.jar" />
203 906 berkley
       <copy file="${xalan}"
204
             tofile="${installdir}/WEB-INF/lib/xalan.jar" />
205
       <copy file="${xalanxml-apis}"
206
             tofile="${installdir}/WEB-INF/lib/xml-apis.jar" />
207 822 jones
       <copy file="lib/web.xml"
208
             tofile="${installdir}/WEB-INF/web.xml" />
209
       <copy todir="${build.img}" filtering="no">
210
         <fileset dir="lib">
211
           <include name="**/*.jpg"/>
212
           <include name="**/*.png"/>
213
           <include name="**/*.gif"/>
214
         </fileset>
215
       </copy>
216
       <copy todir="${installdir}" filtering="yes">
217
         <fileset dir="lib">
218
           <exclude name="*.jar"/>
219
           <exclude name="*.properties"/>
220
           <exclude name="web.xml"/>
221
           <exclude name="**/srbrmi*"/>
222
         </fileset>
223
       </copy>
224 877 jones
       <echo>
225
             ***********************************************************
226
              Remember to register the default DTDs by running the
227
              "${build.src}/loaddtd.sql script". This is most easily
228
              done by using the "ant dtdsql" which will run it for you.
229
             ***********************************************************
230
       </echo>
231 204 jones
   </target>
232
233 113 jones
   <target name="clean" depends="init">
234 822 jones
       <delete dir="${build.dir}" />
235 113 jones
   </target>
236
237 516 jones
   <target name="jdoc" depends="prepare">
238 822 jones
       <javadoc packagenames="edu.ucsb.nceas.*"
239 516 jones
           sourcepath="${build.src}"
240
           destdir="${build.javadocs}"
241 113 jones
           author="true"
242
           version="true"
243
           use="true"
244 348 jones
           windowtitle="${Name} API"
245
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
246 113 jones
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;"
247
       />
248
   </target>
249
250 879 jones
   <target name="dist" depends="jar,protocol,jdoc,getdtd">
251 806 jones
      <mkdir dir="${dist.dir}"/>
252
      <delete dir="${ver.dir}" />
253
      <mkdir dir="${ver.dir}"/>
254
      <copy todir="${ver.dir}">
255 882 jones
        <fileset dir="."
256
            excludes="**/CVS* **/.#* **/src* **/test* **/build* **/docs* ${dist.dir}"/>
257 806 jones
      </copy>
258
      <copy todir="${ver.dir}" file="build.xml"/>
259
      <copy todir="${ver.dir}/lib" file="${build.dir}/metacat.jar"/>
260
      <copy todir="${ver.dir}/lib" file="${build.dir}/protocol.jar"/>
261 882 jones
262
      <copy todir="${ver.dir}/docs" filtering="yes">
263
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
264
      </copy>
265
      <copy todir="${ver.dir}/docs" filtering="no">
266
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
267
      </copy>
268 806 jones
      <copy todir="${ver.dir}/docs/dev">
269
        <fileset dir="${build.dir}/docs"/>
270
      </copy>
271
272 882 jones
      <delete file="./${name}-${release}.zip"/>
273
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}"/>
274
      <delete file="./${name}-${release}.tar.gz" />
275
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}"/>
276
      <gzip zipfile="./${name}-${release}.tar.gz"
277
                src="./${name}-${release}.tar"/>
278
      <delete file="./${name}-${release}.tar" />
279 806 jones
  </target>
280
281
  <target name="distsrc" depends="dist">
282
      <mkdir dir="${ver.src}"/>
283
      <copy todir="${ver.src}">
284
        <fileset dir="./src"/>
285
      </copy>
286
287 882 jones
      <delete file="./${name}-src-${release}.zip"/>
288
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
289
      <delete file="./${name}-src-${release}.tar.gz" />
290
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
291
      <gzip zipfile="./${name}-src-${release}.tar.gz"
292
                src="./${name}-src-${release}.tar"/>
293
      <delete file="./${name}-src-${release}.tar" />
294 807 jones
      <delete dir="${dist.dir}"/>
295 806 jones
  </target>
296
297 113 jones
</project>