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-23 11:06:00 -0800 (Wed, 23 Jan 2002) $'
11
  *  '$Revision: 911 $'
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/metacat"/>
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="metacat"/>
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="xmlp2" 
98
                value="./lib/xerces.jar" />
99
      <property name="jdbc" 
100
                value="lib/jdbc7.1-1.2.jar" />
101
      <property name="jsdk" 
102
                value="/home/berkley/metacat/tomcat/lib/common/servlet.jar" />
103
      <property name="srb" 
104
                value="lib/srbrmi" />
105
      <property name="cos" 
106
                value="lib/cos.jar" />
107
      <property name="xalan"
108
                value="lib/xalan/xalan.jar" />
109
      <property name="xalanxml-apis"
110
                value="lib/xalan/xml-apis.jar" />
111
      <property name="cpath" 
112
                value="${xalan}:${xalanxml-apis}:${xmlp2}:${jdbc}:${jserv}:${jsdk}:${srb}:${cos}"/>
113
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
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
       <mkdir dir="lib/dtd" />
166
       <copy todir="lib/dtd" filtering="yes">
167
         <fileset dir="${build.src}/${eml-module}">
168
           <include name="*.dtd"/>
169
         </fileset>
170
         <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
171
       </copy>
172
   </target>
173

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

    
185
   <target name="install" depends="jar">
186
       <mkdir dir="${installdir}/WEB-INF/lib" />
187
       <copy file="${build.dir}/${name}.jar" 
188
             tofile="${installdir}/WEB-INF/lib/${name}.jar" />
189
       <copy file="${xmlp2}" 
190
             tofile="${installdir}/WEB-INF/lib/xerces.jar" />
191
       <copy file="${jdbc}" 
192
             tofile="${installdir}/WEB-INF/lib/oracle-jdbc111.jar" />
193
       <copy file="${cos}" 
194
             tofile="${installdir}/WEB-INF/lib/cos.jar" />
195
       <copy file="${xalan}" 
196
             tofile="${installdir}/WEB-INF/lib/xalan.jar" />
197
       <copy file="${xalanxml-apis}" 
198
             tofile="${installdir}/WEB-INF/lib/xml-apis.jar" />
199
       <copy file="lib/web.xml" 
200
             tofile="${installdir}/WEB-INF/web.xml" />
201
       <copy todir="${build.img}" filtering="no">
202
         <fileset dir="lib">
203
           <include name="**/*.jpg"/>
204
           <include name="**/*.png"/>
205
           <include name="**/*.gif"/>
206
         </fileset>
207
       </copy>
208
       <copy todir="${installdir}" filtering="yes">
209
         <fileset dir="lib">
210
           <exclude name="*.jar"/>
211
           <exclude name="*.properties"/>
212
           <exclude name="web.xml"/>
213
           <exclude name="**/srbrmi*"/>
214
         </fileset>
215
       </copy>
216
       <echo>
217
             ***********************************************************
218
              Remember to register the default DTDs by running the
219
              "${build.src}/loaddtd.sql script". This is most easily
220
              done by using the "ant dtdsql" which will run it for you.
221
             ***********************************************************
222
       </echo>
223
   </target> 
224

    
225
   <target name="clean" depends="init">
226
       <delete dir="${build.dir}" />
227
   </target>
228

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

    
242
   <target name="dist" depends="jar,protocol,jdoc,getdtd">
243
      <mkdir dir="${dist.dir}"/>
244
      <delete dir="${ver.dir}" />
245
      <mkdir dir="${ver.dir}"/>
246
      <copy todir="${ver.dir}">
247
        <fileset dir="." 
248
            excludes="**/CVS* **/.#* **/src* **/test* **/build* **/docs* ${dist.dir}"/>
249
      </copy>
250
      <copy todir="${ver.dir}" file="build.xml"/>
251
      <copy todir="${ver.dir}/lib" file="${build.dir}/metacat.jar"/>
252
      <copy todir="${ver.dir}/lib" file="${build.dir}/protocol.jar"/>
253

    
254
      <copy todir="${ver.dir}/docs" filtering="yes">
255
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
256
      </copy>
257
      <copy todir="${ver.dir}/docs" filtering="no">
258
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
259
      </copy>
260
      <copy todir="${ver.dir}/docs/dev">
261
        <fileset dir="${build.dir}/docs"/>
262
      </copy>
263
       
264
      <delete file="./${name}-${release}.zip"/>
265
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}"/>
266
      <delete file="./${name}-${release}.tar.gz" />
267
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}"/>
268
      <gzip zipfile="./${name}-${release}.tar.gz" 
269
                src="./${name}-${release}.tar"/>
270
      <delete file="./${name}-${release}.tar" />
271
  </target> 
272

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

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

    
289
</project>
(4-4/6)