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: jones $'
10
  *      '$Date: 2001-12-17 21:52:03 -0800 (Mon, 17 Dec 2001) $'
11
  *  '$Revision: 877 $'
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:oracle:thin:@dev.nceas.ucsb.edu:1521:exp"/>
36
      <property name="dbDriver" value="oracle.jdbc.driver.OracleDriver"/>
37
      <property name="installdir" value="/opt/tomcat/webapps/jones" />
38
      <property name="name" value="metacat"/>
39
      <property name="Name" value="MetaCat"/>
40
      <property name="release" value="1.0.1"/>
41
      <property name="web-base-url" 
42
                value="http://knb.ecoinformatics.org"/>
43
      <property name="replication-path" value="/servlet/replication"/>
44
      <property name="servlet-path" value="/jones/servlet/metacat"/>
45
      <property name="html-path" value="/jones"/>
46
      <property name="image-path" value="/img/jones" />
47
      <property name="style-path" value="/jones/style"/>
48
      <property name="server" value="dev.nceas.ucsb.edu"/>
49
      <property name="replication-log" value="/tmp/metacatreplication.log"/>
50
      <property name="user" value="jones"/>
51
      <property name="password" value="your-pw-goes-here"/>
52
      <property name="config-dir" value="${installdir}" />
53
      <property name="default-style" value="knb" />
54
      <property name="eml-module" value="mdstandards/eml" />
55
      <property name="eml-version" value="2.0.0beta6" />
56
      <property name="eml-tag" value="RELEASE_EML_2_0_0_BETA_6" />
57
      <property name="cvsroot" 
58
                value=":ext:jones@cvs.nceas.ucsb.edu:/cvs/pbi" />
59

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

    
77
      <property name="srcdir" value="./src" />
78
      <property name="build.dir" value="./build"/>
79
      <property name="build.src" value="${build.dir}/src"/>
80
      <property name="build.dest" value="${build.dir}/classes"/>
81
      <property name="build.docs" value="${build.dir}/docs"/>
82
      <property name="build.samples" value="${build.dir}/samples"/>
83
      <property name="build.tests" value="${build.dir}/tests"/>
84
      <property name="build.data" value="${build.dir}/data"/>
85
      <property name="build.javadocs" value="${build.dir}/docs/api"/>
86
      <property name="build.img" value="/opt/httpd/html${image-path}"/>
87

    
88
      <property name="dist.dir" value="./dist"/>
89
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
90
      <property name="ver.src" value="${ver.dir}/src"/>
91

    
92
      <property name="oracle_home" 
93
                value="/oracle01/app/oracle/product/8.1.6" />
94
      <property name="toolsdir" 
95
                value="/usr/local/devtools" />
96
      <property name="xmlp" 
97
                value="${toolsdir}/OracleXSU111/lib/xmlparserv2.jar" />
98
      <property name="xmlp2" 
99
                value="${toolsdir}/xerces-1_1_3/xerces.jar" />
100
      <property name="jdbc" 
101
                value="${oracle_home}/jdbc/lib/classes111.zip" />
102
      <property name="jserv" 
103
                value="/usr/lib/apache/ApacheJServ.jar" />
104
      <property name="jsdk" 
105
                value="${toolsdir}/jakarta-tomcat/lib/servlet.jar" />
106
      <property name="srb" 
107
                value="lib/srbrmi" />
108
      <property name="cos" 
109
                value="lib/cos.jar" />
110
      <property name="cpath" 
111
                value="${xmlp2}:${xmlp}:${jdbc}:${jserv}:${jsdk}:${srb}:${cos}"/>
112
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
113

    
114
   </target>
115
   
116
   <target name="prepare" depends="init">
117
      <mkdir dir="${build.dir}"/>
118
      <mkdir dir="${build.src}"/>
119
      <mkdir dir="${build.dest}"/>
120
      <mkdir dir="${build.javadocs}"/>
121

    
122
      <copy todir="${build.src}" filtering="yes">
123
        <fileset dir="${srcdir}">
124
          <include name="edu/**"/>
125
          <include name="com/**"/>
126
          <include name="**/*.sql"/>
127
          <exclude name="**/CVS*"/>
128
          <exclude name="**/.#*"/>
129
        </fileset>
130
      </copy>
131
   </target>
132

    
133
   <target name="compile" depends="prepare">
134
       <javac srcdir="${build.src}" 
135
              destdir="${build.dest}" 
136
              classpath="${cpath}" 
137
              excludes="**/*.sql" /> 
138
       <copy file="lib/metacat.properties" 
139
             tofile="${build.dest}/${package.home}/metacat.properties" 
140
             filtering="yes" />
141
       <copy file="lib/srbProps.properties" 
142
             tofile="${build.dest}/${package.home}/srbProps.properties"/>
143
   </target> 
144

    
145
   <target name="jar" depends="compile">
146
       <delete file="${build.dir}/${name}.jar" />
147
       <copy todir="${build.dest}">
148
         <fileset dir="lib/srbrmi"/>
149
       </copy>
150
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
151
            excludes="**/protocols/" />
152
   </target> 
153
 
154
   <target name="protocol" depends="compile">
155
       <delete file="${build.dir}/protocol.jar" />
156
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
157
            includes="**/protocols/" />
158
   </target> 
159

    
160
   <target name="getdtd" depends="prepare">
161
        <cvs cvsRoot="${cvsroot}"
162
             package="${eml-module}"
163
             tag="${eml-tag}"
164
             dest="${build.src}" />
165
   </target>
166

    
167
   <target name="instdtd" depends="getdtd">
168
       <mkdir dir="${installdir}/dtd" />
169
       <copy todir="${installdir}/dtd" filtering="yes">
170
         <fileset dir="${build.src}/${eml-module}">
171
           <include name="*.dtd"/>
172
         </fileset>
173
         <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
174
       </copy>
175
   </target> 
176

    
177
   <target name="dtdsql" depends="prepare">
178
     <echo/>
179
     <echo>Registering the DTDs with the new Metacat instance...</echo>
180
     <sql driver="${dbDriver}"
181
          classpath="${jdbc}"
182
          url="${jdbc-connect}"
183
          userid="${user}"
184
          password="${password}"
185
          src="${build.src}/loaddtd.sql" />
186
   </target>
187

    
188
   <target name="install" depends="jar">
189
       <mkdir dir="${installdir}/WEB-INF/lib" />
190
       <copy file="${build.dir}/${name}.jar" 
191
             tofile="${installdir}/WEB-INF/lib/${name}.jar" />
192
       <copy file="${xmlp2}" 
193
             tofile="${installdir}/WEB-INF/lib/xerces.jar" />
194
       <copy file="${xmlp}" 
195
             tofile="${installdir}/WEB-INF/lib/xmlparserv2.jar" />
196
       <copy file="${jdbc}" 
197
             tofile="${installdir}/WEB-INF/lib/oracle-jdbc111.jar" />
198
       <copy file="${cos}" 
199
             tofile="${installdir}/WEB-INF/lib/cos.jar" />
200
       <copy file="lib/web.xml" 
201
             tofile="${installdir}/WEB-INF/web.xml" />
202
       <copy todir="${build.img}" filtering="no">
203
         <fileset dir="lib">
204
           <include name="**/*.jpg"/>
205
           <include name="**/*.png"/>
206
           <include name="**/*.gif"/>
207
         </fileset>
208
       </copy>
209
       <copy todir="${installdir}" filtering="yes">
210
         <fileset dir="lib">
211
           <exclude name="*.jar"/>
212
           <exclude name="*.properties"/>
213
           <exclude name="web.xml"/>
214
           <exclude name="**/srbrmi*"/>
215
         </fileset>
216
       </copy>
217
       <mkdir dir="${installdir}/dtd" />
218
       <echo>
219
             ***********************************************************
220
              Remember to copy the appropriate DTD
221
              files to the installation dtd directory. If you have cvs
222
              access this can be done using "ant instdtd".
223

    
224
              Remember to register the default DTDs by running the
225
              "${build.src}/loaddtd.sql script". This is most easily
226
              done by using the "ant dtdsql" which will run it for you.
227
             ***********************************************************
228
       </echo>
229
   </target> 
230

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

    
235
   <target name="jdoc" depends="prepare">
236
       <javadoc packagenames="edu.ucsb.nceas.*"
237
           sourcepath="${build.src}"
238
           destdir="${build.javadocs}"
239
           author="true"
240
           version="true"
241
           use="true"
242
           windowtitle="${Name} API"
243
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
244
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;"
245
       />
246
   </target>
247

    
248
   <target name="dist" depends="jar,protocol,jdoc">
249
      <mkdir dir="${dist.dir}"/>
250
      <delete dir="${ver.dir}" />
251
      <mkdir dir="${ver.dir}"/>
252
      <copy todir="${ver.dir}">
253
        <fileset dir="." excludes="**/CVS* **/.#* **/src* **/test* **/build*"/>
254
      </copy>
255
      <copy todir="${ver.dir}" file="build.xml"/>
256
      <copy todir="${ver.dir}/lib" file="${build.dir}/metacat.jar"/>
257
      <copy todir="${ver.dir}/lib" file="${build.dir}/protocol.jar"/>
258
      <copy todir="${ver.dir}/docs/dev">
259
        <fileset dir="${build.dir}/docs"/>
260
      </copy>
261
       
262
      <delete file="./lib/${name}-${release}.zip"/>
263
      <zip zipfile="./lib/${name}-${release}.zip" basedir="${dist.dir}"/>
264
      <delete file="./lib/${name}-${release}.tar.gz" />
265
      <tar tarfile="./lib/${name}-${release}.tar" basedir="${dist.dir}"/>
266
      <gzip zipfile="./lib/${name}-${release}.tar.gz" 
267
                src="./lib/${name}-${release}.tar"/>
268
      <delete file="./lib/${name}-${release}.tar" />
269
  </target> 
270

    
271
  <target name="distsrc" depends="dist">
272
      <mkdir dir="${ver.src}"/>
273
      <copy todir="${ver.src}">
274
        <fileset dir="./src"/>
275
      </copy>
276

    
277
      <delete file="./lib/${name}-src-${release}.zip"/>
278
      <zip zipfile="./lib/${name}-src-${release}.zip" basedir="${dist.dir}"/>
279
      <delete file="./lib/${name}-src-${release}.tar.gz" />
280
      <tar tarfile="./lib/${name}-src-${release}.tar" basedir="${dist.dir}"/>
281
      <gzip zipfile="./lib/${name}-src-${release}.tar.gz" 
282
                src="./lib/${name}-src-${release}.tar"/>
283
      <delete file="./lib/${name}-src-${release}.tar" />
284
      <delete dir="${dist.dir}"/>
285
  </target> 
286

    
287
</project>
(4-4/4)