-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
278 lines (198 loc) · 7.81 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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<!-- ==================================================================== -->
<!-- ID: $Revision: 1.6 $ $Date: 2003/11/18 04:07:59 $ -->
<!-- ==================================================================== -->
<project name="jgmail" default="compile" >
<description>
=================================================
JgMail Build
=================================================
</description>
<!-- =================== Initialization properties ==================== -->
<property file="build.properties"/>
<!-- These are global settings -->
<property name="build.dir" value="build" />
<property name="build.classes" value="${build.dir}/classes" />
<property name="build.lib" value="${build.dir}/lib" />
<property name="build.docs" value="${build.dir}/docs" />
<property name="build.samples" value="${build.dir}/samples" />
<property name="jgmail.jar" value="${build.lib}/jgmail.jar" />
<property name="jgmailtags.jar" value="${build.lib}/jgmailtags.jar" />
<!-- ======================= Prepare for Build ======================== -->
<target name="prepare">
<mkdir dir="${build.classes}" />
<mkdir dir="${build.lib}" />
<mkdir dir="${build.docs}" />
<mkdir dir="${build.samples}" />
</target>
<!-- ============================== All =============================== -->
<target name="all" depends="compile, docs, tests"
description="build everything" />
<!-- ============================= Clean ============================== -->
<target name="clean" description="delete all generated files">
<delete dir="${build.dir}/samples" />
<delete dir="${build.classes}/com/messners/mail" />
<delete dir="${build.docs}" />
<delete file="${jgmail.jar}" />
<delete file="${jgmailtags.jar}" />
</target>
<!-- ============================ Compile ============================= -->
<target name="compile" depends="debug-on, prepare"
description="compile files and create jgmail.jar">
<javac
deprecation="on"
debug="${debug.flag}"
optimize="${optimize.flag}"
listfiles="true"
destdir="${build.classes}"
classpath="${build.classes}">
<src path="src" />
<include name="com/messners/mail/*.java" />
</javac>
<!-- Compile the J2ME connector (only done if midpapi.present=true) -->
<available file="${midpapi.zip}" property="midpapi.present"/>
<antcall target="compile-j2me" />
<jar
basedir="${build.classes}"
destfile="${jgmail.jar}"
filesonly="true"
update="true">
<!-- Exclude everything and then include only the files we want -->
<exclude name="**" />
<fileset dir="${build.classes}">
<exclude name="com/messners/mail/taglib/**" />
<include name="com/messners/mail/**" />
</fileset>
<!-- Include all the non-test resources -->
<fileset dir="src">
<include name="com/messners/mail/**/*.properties" />
<include name="com/messners/mail/**/*.map" />
</fileset>
</jar>
<!-- Compile the JSP tab library (only done if servlet.present=true) -->
<available file="${servlet.jar}" property="servlet.present"/>
<antcall target="compile-taglib" />
</target>
<target name="compile-j2me" if="midpapi.present">
<javac
debug="${debug.flag}"
optimize="${optimize.flag}"
listfiles="true"
destdir="${build.classes}"
classpath="${midpapi.zip}">
<src path="src" />
<include name="com/messners/mail/j2me/*.java" />
</javac>
</target>
<target name="compile-taglib" if="servlet.present">
<javac
deprecation="on"
debug="${debug.flag}"
optimize="${optimize.flag}"
listfiles="true"
destdir="${build.classes}"
classpath="${servlet.jar}">
<src path="src" />
<include name="com/messners/mail/taglib/*.java" />
</javac>
<jar
basedir="${build.classes}"
destfile="${jgmailtags.jar}"
filesonly="true"
update="true">
<!-- Exclude everything and then include only the files we want -->
<exclude name="**" />
<fileset dir="${build.classes}">
<include name="com/messners/mail/taglib/**" />
</fileset>
</jar>
</target>
<!-- ====================== Debug Distribution ======================== -->
<target name="debug-dist" depends="debug-on, clean, compile, docs"
description="build a release with debug=on" />
<!-- =========================== Debug Off ============================ -->
<target name="debug-off">
<!-- Flags for no-debug compiling, remember properties are immutable
and once set there value cannot be changed, so if this build
file is called from an upper-level build file these settings
will be inherited not overridden. -->
<property name="debug.flag" value="off" />
<property name="optimize.flag" value="on" />
</target>
<!-- =========================== Debug On ============================= -->
<target name="debug-on">
<!-- Flags for debug compiling, remember properties are immutable
and once set there value cannot be changed, so if this build
file is called from an upper-level build file these settings
will be inherited not overridden. -->
<property name="debug.flag" value="on" />
<property name="optimize.flag" value="off" />
</target>
<!-- ============================= Docs =============================== -->
<target name="docs"
description="build all generated documentation">
<javadoc
destdir="${build.docs}"
author="true"
version="true"
use="true"
public="true"
windowtitle="JgMail">
<classpath>
<pathelement path="${build.classes}" />
<pathelement location="${midpapi.zip}" />
<pathelement location="${servlet.jar}" />
</classpath>
<fileset dir="src" defaultexcludes="yes">
<include name="com/messners/mail/*.java" />
<include name="com/messners/mail/j2me/*.java" />
<include name="com/messners/mail/taglib/*.java" />
</fileset>
<doctitle><![CDATA[<h1>JgMail</h1>]]></doctitle>
<bottom><![CDATA[<i></i>]]></bottom>
</javadoc>
</target>
<!-- ============================= Dist =============================== -->
<target name="dist" depends="debug-off, clean, compile, docs"
description="build a distribution with debug=off, optimize=on">
</target>
<!-- =========================== Run Test ============================= -->
<target name="run-tests" depends="tests"
description="build and run the JUnit tests">
</target>
<!-- ======================== Compile Samples ========================= -->
<target name="samples" depends="compile"
description="compile sample files">
<javac
debug="${debug.flag}"
optimize="${optimize.flag}"
listfiles="true"
destdir="${build.samples}"
classpath="${build.classes}">
<src path="src/samples" />
<include name="*.java" />
</javac>
</target>
<!-- ============================ Tests =============================== -->
<target name="tests" depends="compile"
description="build the JUnit tests">
</target>
<!-- ============================== Help ============================== -->
<target name="help"
description="prints a list of top-level targets">
<echo message=""/>
<echo message="ANT build targets for JgMail" />
<echo message=""/>
<echo message="The following targets are available:" />
<echo message=" all build everything" />
<echo message=" clean delete all generated files" />
<echo message=" compile compile and build JAR" />
<echo message=" debug-dist build a distribution with debug=on, optimize=off" />
<echo message=" docs build all generated documentation" />
<echo message=" help prints this help message" />
<echo message=" dist build a distribution with debug=off, optimize=on" />
<echo message=" run-tests build and run the JUnit tests" />
<echo message=" tests build the JUnit tests" />
<echo message="" />
<echo message="Project will be built in ${basedir}." />
</target>
</project>