Project

General

Profile

1
<?xml version="1.0"?>
2
<!-- 
3
  *   '$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
  *
9
  *    '$Author: berkley $'
10
  *      '$Date: 2002-01-22 11:30:41 -0800 (Tue, 22 Jan 2002) $'
11
  *  '$Revision: 906 $'
12
  *
13
  * Build file for the Ant cross-platform build system for metacat
14
  * See http://jakarta.apache.org for details on Ant
15
  *
16
  * usage: ant [compile|jar|install|jdoc]
17
  *
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
--> 
32
<project name="metacat" default="jar" basedir=".">
33
   <target name="init">
34
      <property name="jdbc-connect" 
35
                value="jdbc:postgresql://localhost/berkley"/>
36
      <property name="installdir" value="/home/berkley/tomcat/webapps/metacat" />
37
      <property name="dbDriver" value="org.postgresql.Driver"/>
38
      <property name="name" value="metacat"/>
39
      <property name="Name" value="MetaCat"/>
40
      <property name="release" value="1.0.3"/>
41
      <property name="web-base-url" 
42
                value="http://alpha.nceas.ucsb.edu:8080/"/>
43

    
44
      <property name="replication-path" value="/servlet/replication"/>
45
      <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
      <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
      <property name="config-dir" value="${installdir}" />
54
      <property name="default-style" value="knb" />
55
      <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
                value=":ext:berkley@cvs.nceas.ucsb.edu:/cvs/pbi" />
60

    
61

    
62
      <filter token="docrooturl" value="./" />
63
      <filter token="jdbc-connect" value="${jdbc-connect}"/>
64
      <filter token="dbDriver" value="${dbDriver}"/>
65
      <filter token="install-dir" value="${installdir}"/>
66
      <filter token="serverhost" value="${serverhost}"/>
67
      <filter token="server" value="${server}"/>
68
      <filter token="replication-log" value="${replication-log}"/>
69
      <filter token="release" value="${release}"/>
70
      <filter token="servlet-path" value="${servlet-path}"/>
71
      <filter token="html-path" value="${html-path}"/>
72
      <filter token="user" value="${user}"/>
73
      <filter token="password" value="${password}"/>
74
      <filter token="image-path" value="${image-path}"/>
75
      <filter token="style-path" value="${style-path}"/>
76
      <filter token="web-base-url" value="${web-base-url}"/>
77
      <filter token="replication-path" value="${replication-path}"/>
78
      <filter token="config-dir" value="${config-dir}"/>
79
      <filter token="default-style" value="${default-style}"/>
80
      <filter token="eml-version" value="${eml-version}"/>
81

    
82
      <property name="srcdir" value="./src" />
83
      <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
      <property name="build.docs" value="${build.dir}/docs"/>
87
      <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
      <property name="build.javadocs" value="${build.dir}/docs/api"/>
91
      <property name="build.img" value="${installdir}/${image-path}"/>
92

    
93
      <property name="dist.dir" value="dist"/>
94
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
95
      <property name="ver.src" value="${ver.dir}/src"/>
96

    
97
      <property name="oracle_home" 
98
                value="/oracle01/app/oracle/product/8.1.6" />
99
      <property name="toolsdir" 
100
                value="/usr/local/devtools" />
101
      <property name="xmlp2" 
102
                value="./lib/xerces.jar" />
103
      <property name="jdbc" 
104
                value="lib/jdbc7.1-1.2.jar" />
105
      <property name="jserv" 
106
                value="/usr/lib/apache/ApacheJServ.jar" />
107
      <property name="jsdk" 
108
                value="/home/berkley/tomcat/lib/common/servlet.jar" />
109
      <property name="srb" 
110
                value="lib/srbrmi" />
111
      <property name="cos" 
112
                value="lib/cos.jar" />
113
      <property name="xalan"
114
                value="lib/xalan/xalan.jar" />
115
      <property name="xalanxml-apis"
116
                value="lib/xalan/xml-apis.jar" />
117
      <property name="cpath" 
118
                value="${xalan}:${xalanxml-apis}:${xmlp2}:${jdbc}:${jserv}:${jsdk}:${srb}:${cos}"/>
119
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
120
   </target>
121
   
122
   <target name="prepare" depends="init">
123
      <mkdir dir="${build.dir}"/>
124
      <mkdir dir="${build.src}"/>
125
      <mkdir dir="${build.dest}"/>
126
      <mkdir dir="${build.javadocs}"/>
127

    
128
      <copy todir="${build.src}" filtering="yes">
129
        <fileset dir="${srcdir}">
130
          <include name="edu/**"/>
131
          <include name="com/**"/>
132
          <include name="**/*.sql"/>
133
          <exclude name="**/CVS*"/>
134
          <exclude name="**/.#*"/>
135
        </fileset>
136
      </copy>
137
   </target>
138

    
139
   <target name="compile" depends="prepare">
140
       <javac srcdir="${build.src}" 
141
              destdir="${build.dest}" 
142
              classpath="${cpath}" 
143
              excludes="**/*.sql" /> 
144
       <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
   </target> 
150

    
151
   <target name="jar" depends="compile">
152
       <delete file="${build.dir}/${name}.jar" />
153
       <copy todir="${build.dest}">
154
         <fileset dir="lib/srbrmi"/>
155
       </copy>
156
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
157
            excludes="**/protocols/" />
158
   </target> 
159
 
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

    
166
   <target name="getdtd" depends="prepare">
167
        <cvs cvsRoot="${cvsroot}"
168
             package="${eml-module}"
169
             tag="${eml-tag}"
170
             dest="${build.src}" />
171
       <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
   </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
   <target name="install" depends="jar">
192
       <mkdir dir="${installdir}/WEB-INF/lib" />
193
       <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
       <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
       <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
       <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
   </target> 
232

    
233
   <target name="clean" depends="init">
234
       <delete dir="${build.dir}" />
235
   </target>
236

    
237
   <target name="jdoc" depends="prepare">
238
       <javadoc packagenames="edu.ucsb.nceas.*"
239
           sourcepath="${build.src}"
240
           destdir="${build.javadocs}"
241
           author="true"
242
           version="true"
243
           use="true"
244
           windowtitle="${Name} API"
245
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
246
           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
   <target name="dist" depends="jar,protocol,jdoc,getdtd">
251
      <mkdir dir="${dist.dir}"/>
252
      <delete dir="${ver.dir}" />
253
      <mkdir dir="${ver.dir}"/>
254
      <copy todir="${ver.dir}">
255
        <fileset dir="." 
256
            excludes="**/CVS* **/.#* **/src* **/test* **/build* **/docs* ${dist.dir}"/>
257
      </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

    
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
      <copy todir="${ver.dir}/docs/dev">
269
        <fileset dir="${build.dir}/docs"/>
270
      </copy>
271
       
272
      <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
  </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
      <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
      <delete dir="${dist.dir}"/>
295
  </target> 
296

    
297
</project>
(6-6/6)