-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.xml
266 lines (224 loc) · 10.5 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
version 2 with the GNU Classpath Exception, which is available at
https://www.gnu.org/software/classpath/license.html.
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
<project name="mailtck" default="default" basedir="." xmlns:if="ant:if">
<description>Builds and runs the project mailtck.</description>
<property name="version" value="2.1"/>
<property name="version.tck" value="2.1.2"/>
<property name="api.module.name" value="jakarta.mail"/>
<property environment="env"/>
<dirname property="mailtck.basedir" file="${ant.file.mailtck}"/>
<property name="ts.home" value="${mailtck.basedir}"/>
<property file="${ts.home}/lib/ts.jte"/>
<property name="class.dir" value="${ts.home}${file.separator}classes"/>
<property name="tests.dir" value="${ts.home}${file.separator}tests"/>
<property name="work.dir" value="${ts.home}/JTwork"/>
<property name="report.dir" value="${ts.home}/JTreport"/>
<property name="lib.dir" value="${ts.home}${file.separator}lib"/>
<property name="harness.dir" value="${ts.home}${file.separator}classes-harness"/>
<property name="class.pluggability.dir" value="${ts.home}${file.separator}classes-pluggability"/>
<property name="class.providers.dir" value="${ts.home}${file.separator}classes-providers"/>
<property name="report.api.dir" value="${ts.home}/JTreport"/>
<property name="report.pluggability.dir" value="${ts.home}/JTreport-Pluggability"/>
<mkdir dir="${harness.dir}"/>
<mkdir dir="${class.dir}"/>
<mkdir dir="${class.pluggability.dir}"/>
<mkdir dir="${class.providers.dir}"/>
<mkdir dir="${work.dir}"/>
<mkdir dir="${report.pluggability.dir}"/>
<mkdir dir="${class.dir}"/>
<mkdir dir="${work.dir}"/>
<mkdir dir="${report.dir}"/>
<condition property="tests.arg" value="-tests ${tests}" else="">
<isset property="tests"/>
</condition>
<condition property="tests.debug" value="-D" else="">
<isset property="debug"/>
</condition>
<property name="module.path" value="${API_JAR}"/>
<property name="class.path" value="${class.dir}${path.separator}${ts.home}/sigtest.jar${path.separator}${ts.home}/javatest.jar${path.separator}${module.path}"/>
<property name="pluggability.class.path" value="${class.pluggability.dir}${path.separator}${ts.home}/javatest.jar${path.separator}"/>
<property name="java.classes.for.sig.ext" value="lib/modules"/>
<!-- Empty string to test without modules, "Mod" to test with modules -->
<property name="lib.modules" value="" />
<target name="build"
description="Compiles all sources to the classes directory">
<javac includeantruntime="false" deprecation="yes"
release="11" srcdir="tests/api"
classpath="${class.path}" destdir="${class.dir}"
debug="on">
</javac>
<javac includeantruntime="false" deprecation="yes"
release="11" srcdir="tests/pluggability"
classpath="${class.path}" destdir="${class.pluggability.dir}"
debug="on">
</javac>
<javac includeantruntime="false" deprecation="yes"
release="11"
srcdir="providers"
classpath="${class.path}" destdir="${class.providers.dir}"
debug="on">
</javac>
<copy todir="${class.providers.dir}/META-INF">
<fileset dir="providers/META-INF"/>
</copy>
<jar destfile="${class.providers.dir}/mail_alternate_provider.jar" basedir="${class.providers.dir}"/>
<javac includeantruntime="false" deprecation="yes"
release="11" srcdir="harness"
classpath="${class.path}" destdir="${harness.dir}"
debug="on">
</javac>
<copy todir="${class.dir}">
<fileset dir="${harness.dir}"/>
</copy>
<copy todir="${class.pluggability.dir}">
<fileset dir="${harness.dir}"/>
</copy>
<javac includeantruntime="false" deprecation="yes"
release="11"
srcdir="${tests.dir}${file.separator}mailboxes"
classpath="${class.path}"
destdir="${tests.dir}${file.separator}mailboxes"
debug="on">
</javac>
</target>
<target name="clean"
description="Cleans all classes from the classes directory">
<delete failonerror="false" includeEmptyDirs="true">
<fileset dir="${class.dir}" includes="*/**"/>
<fileset dir="${harness.dir}" includes="*/**"/>
<fileset dir="${class.pluggability.dir}" includes="*/**"/>
<fileset dir="${class.providers.dir}" includes="*/**"/>
</delete>
</target>
<target name="run"
description="Executes the Jakarta Mail TCK in batch mode">
<local name="ts.jte"/>
<local name="run.class.path"/>
<local name="report.dir"/>
<local name="test.suite"/>
<local name="ts.jtx"/>
<property name="report.dir" value="${report.api.dir}"/>
<property name="test.suite" value="tests/api"/>
<property name="ts.jte" value="ts.jte"/>
<property name="ts.jtx" value="${ts.home}/lib/ts.jtx"/>
<property name="run.class.path" value="${class.path}"/>
<javatest.batch/>
</target>
<target name="run.pluggability"
description="Executes the Mail TCK pluggability tests in batch mode">
<local name="ts.jte"/>
<local name="run.class.path"/>
<local name="report.dir"/>
<local name="test.suite"/>
<local name="ts.jtx"/>
<property name="report.dir" value="${report.pluggability.dir}"/>
<property name="test.suite" value="tests/pluggability"/>
<property name="ts.jte" value="ts.pluggability.jte"/>
<property name="ts.jtx" value="${ts.home}/lib/ts.jtx"/>
<property name="run.class.path" value="${pluggability.class.path}"/>
<javatest.batch/>
</target>
<target name="runmod"
description="Executes the Jakarta Mail TCK in batch mode with modules">
<local name="ts.jte"/>
<local name="run.class.path"/>
<local name="report.dir"/>
<local name="test.suite"/>
<local name="ts.jtx"/>
<property name="report.dir" value="${report.api.dir}"/>
<property name="test.suite" value="tests/api"/>
<property name="ts.jte" value="ts.jte"/>
<property name="ts.jtx" value="${ts.home}/lib/ts.jtx"/>
<property name="run.class.path" value="${class.path}"/>
<property name="lib.modules" value="Mod" />
<javatest.batch/>
</target>
<target name="gui"
description="Executes the Jakarta Mail TCK in GUI mode">
<javatest.gui/>
</target>
<target name="record.sigtest">
<java fork="true" jar="./sigtestdev.jar">
<arg value="Setup"/>
<arg value="-Classpath"/>
<arg value="${java.home}/${java.classes.for.sig.ext}${path.separator}${class.path}"/>
<arg value="-Package"/>
<arg value="jakarta.mail"/>
<arg value="-Package"/>
<arg value="jakarta.mail.event"/>
<arg value="-Package"/>
<arg value="jakarta.mail.internet"/>
<arg value="-Package"/>
<arg value="jakarta.mail.search"/>
<arg value="-Package"/>
<arg value="jakarta.mail.util"/>
<arg value="-FileName"/>
<arg value="${ts.home}/tests/jakarta.mail_${version}_java_${java.specification.version}.sig"/>
<arg value="-Static"/>
<arg value="-Xjimage" if:true="${jdk.modules}"/>
<arg value="${java.home}/bin/jimage" if:true="${jdk.modules}"/>
</java>
</target>
<presetdef name="javatest">
<!--
The javatest task is a presetdef that sets many of the common
attributes and elements used by both the GUI and batch mode
invocations of javatest with the spider workspace. To see the preset
values, refer to the included XML below that shows the content of
the javatest presetdef.
-->
<java classname="com.sun.javatest.tool.Main"
failonerror="${failOnError}" fork="yes" classpath="${run.class.path}">
<sysproperty key="testDebug" value="${tests.debug}"/>
</java>
</presetdef>
<presetdef name="javatest.batch">
<!--
The javatest.batch task is a presetdef that calls the javatest
presetdef passing the additional XML content needed to invoke
javatest in batch mode. To see the preset values, refer to the
included XML below that shows the content of the javatest.batch
presetdef.
-->
<javatest>
<arg line=" -EsysProps" />
<arg line=" -batch" />
<arg line=" -ts ${test.suite}/testsuite.html" />
<arg line=" -workdir ${work.dir}" />
<arg line=" -envFiles ${ts.home}/lib/${ts.jte}" />
<arg line=" -env mailUnix${lib.modules}" />
<arg line=" -excludeList ${ts.home}/lib/ts.jtx" />
<arg line=" -timeoutFactor 1" />
<arg line=" ${tests.arg}" />
<arg line=" -runtests -writereport ${report.dir}"/>
</javatest>
</presetdef>
<presetdef name="javatest.gui">
<!--
The javatest.gui task is a presetdef that calls the javatest presetdef
passing the additional XML content needed to invoke the javatest GUI.
To see the preset values, refer to the included XML below that shows
the content of the javatest.gui presetdef.
-->
<javatest>
<arg line="-open ${ts.home}/lib/ts.jti" />
<arg line="-EsysProps" />
</javatest>
</presetdef>
<presetdef name="javatest.help">
<javatest>
<arg line="-help" />
</javatest>
</presetdef>
</project>