-
Notifications
You must be signed in to change notification settings - Fork 4.9k
/
build.xml
230 lines (192 loc) · 8.82 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="Tomcat 6.0" default="bayeux" basedir="../..">
<!-- ===================== Initialize Property Values =================== -->
<!-- See "build.properties.sample" in the top level directory for all -->
<!-- property values you must customize for successful building!!! -->
<property file="${user.home}/build.properties"/>
<property file="${basedir}/build.properties"/>
<property file="${basedir}/build.properties.default"/>
<!-- Project Properties -->
<property name="project" value="apache-tomcat" />
<property name="name" value="Apache Tomcat" />
<property name="year" value="2008" />
<property name="version.major" value="6" />
<property name="version.minor" value="0" />
<property name="version.build" value="0" />
<property name="version.patch" value="0" />
<property name="version.suffix" value="-dev" />
<property name="version" value="${version.major}.${version.minor}.${version.build}${version.suffix}" />
<property name="version.number" value="${version.major}.${version.minor}.${version.build}.${version.patch}" />
<property name="version.major.minor" value="${version.major}.${version.minor}" />
<property name="final.name" value="${project}-${version}" />
<property name="final-src.name" value="${project}-${version}-src" />
<!-- Build Defaults -->
<property name="tomcat.build" value="${basedir}/output/build"/>
<property name="tomcat.classes" value="${basedir}/output/classes"/>
<property name="tomcat.dist" value="${basedir}/output/dist"/>
<property name="tomcat.extras" value="${basedir}/output/extras"/>
<property name="tomcat.deployer" value="${basedir}/output/deployer"/>
<property name="tomcat.release" value="${basedir}/output/release"/>
<property name="test.failonerror" value="true"/>
<property name="test.runner" value="junit.textui.TestRunner"/>
<!-- Can't be lower - jsp uses templates -->
<property name="compile.source" value="1.5"/>
<!-- JAR artifacts -->
<property name="cometd-api.jar" value="${tomcat.extras}/cometd-api.jar"/>
<property name="tomcat-bayeux.jar" value="${tomcat.extras}/tomcat-bayeux.jar"/>
<property name="cometd.war" value="${tomcat.extras}/cometd.war"/>
<property name="tomcat-bayeux-samples.jar" value="${tomcat.extras}/tomcat-bayeux-samples.jar"/>
<!-- Classpath -->
<path id="tomcat.classpath">
<pathelement location="${tomcat.classes}"/>
</path>
<target name="prepare">
<mkdir dir="${tomcat.extras}"/>
</target>
<target name="clean">
<delete dir="${tomcat.extras}"/>
</target>
<target name="bayeux">
<mkdir dir="${tomcat.extras}"/>
<antcall target="downloadfile">
<param name="sourcefile" value="${json-lib.lib}"/>
<param name="destfile" value="${json-lib.home}/${json-lib.jar}"/>
<param name="destdir" value="${json-lib.home}"/>
</antcall>
<antcall target="downloadgz">
<param name="sourcefile" value="${dojo-js.loc}"/>
<param name="destfile" value="${dojo-js.jar}"/>
</antcall>
<copy todir="${tomcat.extras}" file="${json-lib.home}/${json-lib.jar}"/>
<!-- Classpath -->
<path id="tomcat.bayeux.classpath">
<pathelement path="${tomcat.classpath}"/>
<pathelement path="${json-lib.home}/${json-lib.jar}"/>
</path>
<!-- compile org.apache.tomcat.bayeux -->
<!-- compile org.apache.cometd -->
<javac srcdir="modules/bayeux/java" destdir="${tomcat.classes}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
source="${compile.source}"
optimize="${compile.optimize}"
encoding="ISO-8859-1">
<classpath refid="tomcat.bayeux.classpath" />
<include name="org/apache/tomcat/bayeux/**" />
<include name="org/apache/cometd/**" />
</javac>
<!-- Cometd API JAR File -->
<jar jarfile="${cometd-api.jar}">
<fileset dir="${tomcat.classes}">
<exclude name="**/package.html" />
<exclude name="**/LocalStrings_*" />
<include name="org/apache/cometd/**" />
</fileset>
</jar>
<!-- Cometd API JAR File -->
<jar jarfile="${tomcat-bayeux.jar}">
<fileset dir="${tomcat.classes}">
<exclude name="**/package.html" />
<exclude name="**/LocalStrings_*" />
<include name="org/apache/tomcat/bayeux/**" />
</fileset>
</jar>
<!-- cometd samples application -->
<javac srcdir="modules/bayeux/test" destdir="${tomcat.classes}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
source="${compile.source}"
optimize="${compile.optimize}"
encoding="ISO-8859-1">
<classpath refid="tomcat.bayeux.classpath" />
<include name="org/apache/tomcat/bayeux/**" />
<include name="org/apache/cometd/**" />
</javac>
<!-- Cometd samples JAR File -->
<jar jarfile="${tomcat-bayeux-samples.jar}">
<fileset dir="${tomcat.classes}">
<exclude name="**/package.html" />
<exclude name="**/LocalStrings_*" />
<include name="org/apache/cometd/bayeux/samples/**" />
</fileset>
</jar>
<!-- build samples webapplication /cometd -->
<property name="cometd-app" value="${base.path}/cometd"/>
<mkdir dir="${cometd-app}"/>
<copy todir="${cometd-app}">
<fileset dir="${basedir}/modules/bayeux/webapps/cometd">
<include name="**/**"/>
</fileset>
<fileset dir="${dojo-js.home}">
<include name="dojo/**"/>
<include name="dojox/**"/>
</fileset>
</copy>
<mkdir dir="${cometd-app}/WEB-INF/lib"/>
<copy todir="${cometd-app}/WEB-INF/lib" file="${tomcat-bayeux-samples.jar}"/>
<zip zipfile="${cometd.war}">
<fileset dir="${cometd-app}">
<include name="**/**"/>
</fileset>
</zip>
<delete dir="${cometd-app}"/>
<!-- create checksums -->
<checksum file="${cometd-api.jar}" forceOverwrite="yes" fileext=".md5" />
<checksum file="${tomcat-bayeux.jar}" forceOverwrite="yes" fileext=".md5" />
<checksum file="${cometd.war}" forceOverwrite="yes" fileext=".md5" />
<checksum file="${tomcat.extras}/${json-lib.jar}" forceOverwrite="yes" fileext=".md5" />
<!-- print out how to -->
<echo>You've built the Tomcat Bayeux libraries, simply add the following libraries to your CATALINA_HOME/lib directory:
${cometd-api.jar}
${tomcat-bayeux.jar}
${tomcat.extras}/${json-lib.jar}
To run the sample application, copy the following applications into your CATALINA_BASE/webapps directory
${cometd.war}
</echo>
</target>
<!-- Download and dependency building -->
<target name="proxyflags">
<!-- check proxy parameters. -->
<condition property="useproxy">
<equals arg1="${proxy.use}" arg2="on" />
</condition>
</target>
<target name="setproxy" depends="proxyflags" if="useproxy">
<taskdef name="setproxy"
classname="org.apache.tools.ant.taskdefs.optional.net.SetProxy" />
<setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
proxyuser="${proxy.user}" proxypassword="${proxy.password}" />
<echo message="Using ${proxy.host}:${proxy.port} to download ${sourcefile}"/>
</target>
<target name="testexist">
<echo message="Testing for ${destfile}"/>
<available file="${destfile}" property="exist"/>
</target>
<target name="downloadfile" unless="exist" depends="setproxy,testexist">
<!-- Download extract the file -->
<mkdir dir="${destdir}" />
<get src="${sourcefile}" dest="${destfile}" />
</target>
<target name="downloadgz" unless="exist" depends="setproxy,testexist">
<!-- Download and extract the package -->
<get src="${sourcefile}" dest="${base.path}/file.tar.gz" />
<gunzip src="${base.path}/file.tar.gz" dest="${base.path}/file.tar"/>
<untar src="${base.path}/file.tar" dest="${base.path}"/>
<delete file="${base.path}/file.tar"/>
<delete file="${base.path}/file.tar.gz"/>
</target>
</project>