-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.xml
254 lines (222 loc) · 9.05 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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
<!--
BEGIN COPYRIGHT BLOCK
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Red Hat, Inc.
All rights reserved.
END COPYRIGHT BLOCK -->
<project name="tomcatjss" default="main" basedir=".">
<!--
Give user a chance to override without editing this file
(and without typing -D each time it compiles it)
-->
<property file=".ant.properties"/>
<property file="${user.home}/.ant.properties"/>
<property environment="env"/>
<exec executable="uname" failonerror="true" outputproperty="arch">
<arg line="-i"/>
</exec>
<!--
Set the properties that control names and versions
-->
<property name="Name" value="Tomcat JSS"/>
<property name="name" value="tomcatjss"/>
<property name="version" value="7.6.1"/>
<property name="manifest-version" value="${version}-a1"/>
<!--
Set the properties that control various build options
-->
<property name="debug" value="true"/>
<property name="chmod.fail" value="true"/>
<property name="chmod.maxparallel" value="250"/>
<property name="deprecation" value="false"/>
<property name="optimize" value="true"/>
<property name="specfile" value="tomcatjss.spec"/>
<property name="jnidir" value="/usr/lib/java" />
<property name="package" value="${name}" />
<property name="install.doc.dir" value="/usr/share/doc" />
<property name="install.jar.dir" value="/usr/share/java" />
<!--
Set the properties related to the source tree
-->
<exec executable="pwd" failonerror="true" outputproperty="cwd"/>
<property name="src.dir" value="tomcat-9.0"/>
<property name="lib.dir" value="lib"/>
<property name="docs.dir" value="docs"/>
<!--
Set the properties for the build area
-->
<property name="build.dir" value="build"/>
<property name="bootstrap.dir" value="bootstrap"/>
<property name="build.jars" value="${build.dir}/jars"/>
<property name="build.classes" value="${build.dir}/classes"/>
<property name="build.lib" value="${build.dir}/lib"/>
<property name="build.javadocs" value="${build.dir}/javadocs"/>
<property name="build.tests" value="${build.dir}/testcases"/>
<property name="build.tests.javadocs" value="${build.dir}/javadocs.test/"/>
<property name="manifest.tmp" value="${build.dir}/optional.manifest"/>
<!--
Set up properties for the distribution area
-->
<property name="dist.name" value="${name}-${version}"/>
<property name="dist.base" value="dist"/>
<property name="dist.base.source" value="${dist.base}/source"/>
<property name="dist.base.binaries" value="${dist.base}/binary"/>
<property name="dist.dir" value="dist"/>
<property name="dist.bin" value="${dist.dir}/bin"/>
<property name="dist.lib" value="${dist.dir}/lib"/>
<property name="dist.docs" value="${dist.dir}/docs"/>
<property name="dist.etc" value="${dist.dir}/etc"/>
<property name="src.dist.name" value="${name}-${version}"/>
<property name="src.dist.dir" value="dist-src"/>
<property name="src.dist.docs" value="${src.dist.dir}/docs"/>
<property name="src.dist.lib" value="${src.dist.dir}/lib"/>
<property name="rpm.dist.dir" value="${cwd}/${dist.base}/rpmpkg"/>
<!--
JARs
-->
<property name="jar.home" value="/usr/share/java" />
<property name="commons-logging.jar" value="${jar.home}/commons-logging-api.jar" />
<property name="slf4j-api.jar" value="${jar.home}/slf4j/slf4j-api.jar" />
<property name="tomcat.home" value="/usr/share/tomcat" />
<property name="catalina.jar" value="${tomcat.home}/lib/catalina.jar" />
<property name="tomcat-api.jar" value="${tomcat.home}/lib/tomcat-api.jar" />
<property name="tomcat-coyote.jar" value="${tomcat.home}/lib/tomcat-coyote.jar" />
<property name="tomcat-juli.jar" value="${tomcat.home}/bin/tomcat-juli.jar" />
<property name="jss.home" value="${jnidir}" />
<!-- This property is set to '/dirsec' when built on rhel4 -->
<property name="dirsec" value="" />
<property name="jss.jar" value="${jss.home}${dirsec}/jss.jar" />
<property name="commons-lang3.jar" value="${jar.home}/commons-lang3.jar" />
<!--
Classpath
-->
<path id="classpath">
<pathelement location="${jss.jar}"/>
<pathelement location="${catalina.jar}"/>
<pathelement location="${tomcat-api.jar}"/>
<pathelement location="${tomcat-coyote.jar}"/>
<pathelement location="${tomcat-juli.jar}"/>
<pathelement location="${commons-logging.jar}"/>
<pathelement location="${commons-lang3.jar}"/>
<pathelement location="${slf4j-api.jar}"/>
</path>
<!--
Create binary distributions
-->
<target name="main_distribution" description="--> creates the zip and tar distributions">
<delete dir="${dist.name}"/>
<mkdir dir="${dist.base}"/>
<mkdir dir="${dist.base.source}"/>
<mkdir dir="${dist.base.binaries}"/>
<zip destfile="${dist.base.binaries}/${dist.name}.zip">
<zipfileset dir="./build/jars" filemode="755" prefix="usr/share/java">
<include name="**"/>
</zipfileset>
</zip>
<tar longfile="gnu" destfile="${dist.base.binaries}/${dist.name}.tar">
<tarfileset dir="./build/jars" mode="755" prefix="${dist.name}/usr/share/java">
<include name="**"/>
</tarfileset>
</tar>
<gzip destfile="${dist.base.binaries}/${dist.name}.tar.gz" src="${dist.base.binaries}/${dist.name}.tar"/>
<delete file="${dist.base.binaries}/${dist.name}.tar"/>
<delete dir="${dist.name}"/>
<checksum fileext=".md5">
<fileset dir="${dist.base.binaries}/">
<include name="**/*"/>
<exclude name="**/*.asc"/>
<exclude name="**/*.md5"/>
</fileset>
</checksum>
<checksum fileext=".sha1" algorithm="SHA">
<fileset dir="${dist.base.binaries}/">
<include name="**/*"/>
<exclude name="**/*.asc"/>
<exclude name="**/*.md5"/>
</fileset>
</checksum>
<!--
Create source distributions
-->
<zip destfile="${dist.base.source}/${src.dist.name}.zip">
<zipfileset dir="." filemode="755" prefix="${src.dist.name}">
<include name="README.adoc"/>
<include name="LICENSE"/>
<include name="build.xml"/>
<include name="core/src/**"/>
<include name="${src.dir}/**"/>
</zipfileset>
</zip>
<tar longfile="gnu" destfile="${dist.base.source}/${src.dist.name}.tar">
<tarfileset dir="." mode="755" prefix="${src.dist.name}">
<include name="README.adoc"/>
<include name="LICENSE"/>
<include name="build.xml"/>
<include name="core/src/**"/>
<include name="${src.dir}/**"/>
</tarfileset>
</tar>
<gzip destfile="${dist.base.source}/${src.dist.name}.tar.gz" src="${dist.base.source}/${src.dist.name}.tar"/>
<delete file="${dist.base.source}/${src.dist.name}.tar"/>
<delete dir="${dist.name}"/>
<checksum fileext=".md5">
<fileset dir="${dist.base.source}/">
<include name="**/*"/>
<exclude name="**/*.asc"/>
<exclude name="**/*.md5"/>
</fileset>
</checksum>
<checksum fileext=".sha1" algorithm="SHA">
<fileset dir="${dist.base.source}/">
<include name="**/*"/>
<exclude name="**/*.asc"/>
<exclude name="**/*.md5"/>
</fileset>
</checksum>
</target>
<target name="download"
description="Builds and download dependent components">
</target>
<target name="compile" depends=""
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<mkdir dir="${build.classes}"/>
<javac debug="on" destdir="${build.classes}" includeantruntime="false">
<src path="core/src/main/java"/>
<src path="${src.dir}/src/main/java"/>
<classpath refid="classpath"/>
</javac>
</target>
<target name="package" >
<mkdir dir="${build.jars}"/>
<jar jarfile="${build.jars}/tomcatjss.jar">
<fileset dir="${build.classes}">
<include name="org/**" />
</fileset>
</jar>
</target>
<target name="dist" depends="compile,package,main_distribution" description="--> creates the full Apache Ant distribution">
</target>
<target name="install" depends="compile,package">
<copy file="LICENSE" todir="${install.doc.dir}/${package}"/>
<copy file="README.adoc" todir="${install.doc.dir}/${package}"/>
<delete file="${install.jar.dir}/tomcatjss.jar"/>
<copy file="${build.jars}/tomcatjss.jar" tofile="${install.jar.dir}/tomcatjss.jar"/>
</target>
<target name="main" depends="compile,package">
</target>
<target name="clean">
<delete dir="${dist.base}"/>
<delete dir="${build.dir}"/>
</target>
</project>