-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
257 lines (224 loc) · 10.9 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
255
256
257
<!--
Copyright 2008 Flaptor (flaptor.com)
Licensed 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="clusterfest" default="jar" basedir=".">
<property name="project" value="clusterfest"/>
<property name="version" value="0.7-trunk"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="websrc.dir" value="${basedir}/websrc"/>
<property name="test.dir" value="${basedir}/test"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="conf.dir" value="${basedir}/conf"/>
<property name="tools.dir" value="${basedir}/tools" />
<property name="dist.dir" value="${basedir}/dist" />
<property name="doc.dir" value="${basedir}/docs" />
<property name="javadoc.dir" value="${doc.dir}/javadoc"/>
<property name="output.dir" location="${basedir}/output"/>
<property name="bin.dir" location="${basedir}/bin"/>
<property name="tmp.dir" location="${basedir}/tmp"/>
<property name="tmp.bin.dir" location="${tmp.dir}/bin"/>
<property name="tmp.conf.dir" location="${tmp.dir}/conf"/>
<tstamp>
<format property="now" pattern="HH:mm:ss d-MMMM-yyyy"/>
</tstamp>
<path id="classpath.jars.util">
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
</path>
<path id="classpath.jars.tools">
<pathelement location="${build.dir}" />
<fileset dir="${basedir}/tools">
<include name="**/*.jar" />
</fileset>
</path>
<!--******************************************************************************************************-->
<target name="compile" depends="prepare" description="compiles everything">
<javac destdir="${build.dir}" debug="true" debuglevel="lines,vars,source" target="5" >
<compilerarg value="-Xlint:deprecation" />
<compilerarg value="-Xlint:unchecked" />
<compilerarg value="-target" />
<compilerarg value="5" />
<classpath>
<path refid="classpath.jars.util" />
<path refid="classpath.jars.tools" />
</classpath>
<src path="${src.dir}/com/flaptor" />
<src path="${test.dir}/com/flaptor" />
</javac>
</target>
<!--******************************************************************************************************-->
<target name="clean">
<delete dir="${build.dir}" />
<delete dir="${output.dir}" />
<delete dir="${javadoc.dir}" />
<delete dir="${tmp.dir}" />
<delete dir="${dist.dir}" />
<delete dir="${basedir}/reports" />
<delete file="${basedir}/cobertura.ser"/>
<delete>
<fileset dir="${basedir}" includes="TEST-*.txt" />
</delete>
</target>
<target name="clean-tmp">
<delete dir="${tmp.dir}"/>
</target>
<!--******************************************************************************************************-->
<target name="prepare">
<delete dir="${output.dir}"/>
<mkdir dir="${build.dir}"/>
<mkdir dir="${output.dir}"/>
</target>
<!--******************************************************************************************************-->
<target name="jar" depends="compile" description="builds the clusterfest jar file for use in other flaptor projects, includes the webapp but doesnt include libraries" >
<jar jarfile="${output.dir}/${project}-${version}.jar" >
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Version" value="${version}"/>
</manifest>
<fileset dir="${websrc.dir}">
<include name="web-clusterfest/**"/>
</fileset>
<fileset dir="${build.dir}" excludes="**/*Test.class">
<include name="com/flaptor/**/*.class"/>
</fileset>
<fileset dir="${conf.dir}" >
<include name="*.properties.defaults"/>
</fileset>
</jar>
</target>
<target name="fatjar" depends="compile" description="builds the clusterfest jar file, including lib jars and webapp files" >
<jar jarfile="${output.dir}/${project}-${version}.jar" >
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Version" value="${version}"/>
</manifest>
<fileset dir="${websrc.dir}">
<include name="web-clusterfest/**"/>
</fileset>
<fileset dir="${build.dir}" excludes="**/*Test.class">
<include name="com/flaptor/**/*.class"/>
</fileset>
<fileset dir="${conf.dir}" >
<include name="*.properties.defaults"/>
</fileset>
<zipgroupfileset dir="${lib.dir}">
<include name="*.jar" />
</zipgroupfileset>
</jar>
</target>
<target name="distjar" depends="compile" description="builds the clusterfest jar file, including lib jars EXCLUDING webapp files, for DIST" >
<jar jarfile="${output.dir}/${project}-${version}.jar" >
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Version" value="${version}"/>
</manifest>
<fileset dir="${build.dir}" excludes="**/*Test.class">
<include name="com/flaptor/**/*.class"/>
</fileset>
<fileset dir="${conf.dir}" >
<include name="*.properties.defaults"/>
</fileset>
<zipgroupfileset dir="${lib.dir}">
<include name="*.jar" />
</zipgroupfileset>
</jar>
</target>
<!--******************************************************************************************************-->
<target name="dist" depends="clean, distjar, doc" description="builds the binary distribution">
<mkdir dir="${dist.dir}"/>
<copy todir="${tmp.bin.dir}">
<fileset dir="${bin.dir}"/>
</copy>
<copy todir="${tmp.bin.dir}/web-clusterfest/">
<fileset dir="${websrc.dir}/web-clusterfest/"/>
</copy>
<copy todir="${tmp.conf.dir}">
<fileset dir="${conf.dir}">
<include name="*.properties"/>
<include name="*.xml"/>
</fileset>
</copy>
<property name="prefix" value="${project}-${version}"/>
<tar destfile="${dist.dir}/${project}-${version}.tgz" compression="gzip">
<tarfileset file="${doc.dir}/LICENSE" prefix="${prefix}"/>
<tarfileset dir="${doc.dir}" prefix="${prefix}/doc"/>
<tarfileset dir="${output.dir}" prefix="${prefix}">
<include name="${project}-${version}.jar" />
</tarfileset>
<tarfileset dir="${tmp.bin.dir}" prefix="${prefix}" mode="755"/>
<tarfileset dir="${conf.dir}" prefix="${prefix}/conf" />
</tar>
</target>
<target name="distsrc" depends="dist" description="builds the source distribution">
<property name="prefix" value="${project}-${version}"/>
<tar destfile="${dist.dir}/${project}-${version}-src.tgz" compression="gzip">
<tarfileset file="${doc.dir}/LICENSE" prefix="${prefix}"/>
<tarfileset dir="${doc.dir}" prefix="${prefix}/doc"/>
<tarfileset dir="${conf.dir}" prefix="${prefix}/conf" />
<tarfileset file="build.xml" prefix="${prefix}"/>
<tarfileset file="build-test.xml" prefix="${prefix}"/>
<tarfileset dir="${src.dir}" prefix="${prefix}/src"/>
<tarfileset dir="${bin.dir}" mode="755" prefix="${prefix}/bin"/>
<tarfileset dir="${test.dir}" prefix="${prefix}/test"/>
<tarfileset dir="${tools.dir}" prefix="${prefix}/tools"/>
<tarfileset dir="${lib.dir}" prefix="${prefix}/lib"/>
</tar>
</target>
<!--******************************************************************************************************-->
<target name="doc" description="creates the clusterfest javadoc" >
<delete dir="${javadoc.dir}" />
<mkdir dir="${javadoc.dir}" />
<javadoc sourcepath="${src.dir}"
destdir="${javadoc.dir}"
Private="true"
linksource="yes"
>
<fileset dir="${src.dir}" defaultexcludes="yes">
<include name="com/flaptor/**/*.java" />
</fileset>
<fileset dir="${test.dir}" defaultexcludes="yes">
<include name="com/flaptor/**/*.java" />
</fileset>
<doctitle><![CDATA[<h1>Clusterfest Documentation</h1>]]></doctitle>
<classpath>
<path refid="classpath.jars.tools" />
<path refid="classpath.jars.util" />
</classpath>
<taglet name="ToDo" path="tools/taglets.jar" />
<taglet name="FixMe" path="tools/taglets.jar" />
</javadoc>
</target>
<!--******************************************************************************************************-->
<!--TESTING-->
<target name="test" description="Runs all tests." depends="compile" >
<ant antfile="build-test.xml" target="test" inheritAll="false" >
<property name="src.dir" value="${src.dir}" />
<property name="test.dir" value="${test.dir}" />
<property name="lib.dir" value="${lib.dir}" />
<property name="tools.dir" value="${tools.dir}" />
<property name="build.dir" value="${build.dir}" />
<property name="conf.dir" value="${conf.dir}" />
</ant>
</target>
<target name="onetest" description="runs one JUnit test, specified by -Dtestfile= parameter" depends="compile" >
<ant antfile="build-test.xml" target="onetest" inheritAll="false">
<property name="src.dir" value="${src.dir}" />
<property name="test.dir" value="${test.dir}" />
<property name="lib.dir" value="${lib.dir}" />
<property name="tools.dir" value="${tools.dir}" />
<property name="build.dir" value="${build.dir}" />
<property name="conf.dir" value="${conf.dir}" />
</ant>
</target>
</project>