10
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
2 |
<!--
|
|
3 |
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
|
4 |
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
5 |
|
|
6 |
This code is free software; you can redistribute it and/or modify it
|
|
7 |
under the terms of the GNU General Public License version 2 only, as
|
|
8 |
published by the Free Software Foundation. Sun designates this
|
|
9 |
particular file as subject to the "Classpath" exception as provided
|
|
10 |
by Sun in the LICENSE file that accompanied this code.
|
|
11 |
|
|
12 |
This code is distributed in the hope that it will be useful, but WITHOUT
|
|
13 |
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
14 |
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
15 |
version 2 for more details (a copy is included in the LICENSE file that
|
|
16 |
accompanied this code).
|
|
17 |
|
|
18 |
You should have received a copy of the GNU General Public License version
|
|
19 |
2 along with this work; if not, write to the Free Software Foundation,
|
|
20 |
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
21 |
|
|
22 |
Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
|
23 |
CA 95054 USA or visit www.sun.com if you need additional information or
|
|
24 |
have any questions.
|
|
25 |
-->
|
|
26 |
|
|
27 |
<!--
|
|
28 |
This is the main build file for the complete langtools workspace.
|
|
29 |
It is used both when working on the tools in NetBeans, and when building
|
|
30 |
JDK itself, in which case it is invoked from the wrapper Makefile.
|
|
31 |
-->
|
|
32 |
|
|
33 |
<project name="langtools" default="build" basedir="..">
|
|
34 |
|
|
35 |
<!-- The following locations can be used to override default property values. -->
|
|
36 |
|
|
37 |
<!-- Use this location for customizations specific to this instance of this workspace -->
|
|
38 |
<property file="build.properties"/>
|
|
39 |
|
|
40 |
<!-- Use this location for customizations common to all OpenJDK langtools workspaces -->
|
|
41 |
<property file="${user.home}/.openjdk/${ant.project.name}-build.properties"/>
|
|
42 |
|
|
43 |
<!-- Use this location for customizations common to all OpenJDK workspaces -->
|
|
44 |
<property file="${user.home}/.openjdk/build.properties"/>
|
|
45 |
|
|
46 |
<!-- Convenient shorthands for standard locations within the workspace. -->
|
|
47 |
<property name="build.dir" location="build"/>
|
|
48 |
<property name="build.bootstrap.dir" location="${build.dir}/bootstrap"/>
|
|
49 |
<property name="build.coverage.dir" location="${build.dir}/coverage"/>
|
|
50 |
<property name="build.classes.dir" location="${build.dir}/classes"/>
|
|
51 |
<property name="build.gensrc.dir" location="${build.dir}/gensrc"/>
|
|
52 |
<property name="build.javadoc.dir" location="${build.dir}/javadoc"/>
|
|
53 |
<property name="build.jtreg.dir" location="${build.dir}/jtreg"/>
|
|
54 |
<property name="build.toolclasses.dir" location="${build.dir}/toolclasses"/>
|
|
55 |
<property name="dist.dir" location="dist"/>
|
|
56 |
<property name="dist.bin.dir" location="${dist.dir}/bin"/>
|
|
57 |
<property name="dist.coverage.dir" location="${dist.dir}/coverage"/>
|
|
58 |
<property name="dist.findbugs.dir" location="${dist.dir}/findbugs"/>
|
|
59 |
<property name="dist.lib.dir" location="${dist.dir}/lib"/>
|
|
60 |
<property name="make.dir" location="make"/>
|
|
61 |
<property name="make.tools.dir" location="${make.dir}/tools"/>
|
|
62 |
<property name="src.dir" location="src"/>
|
|
63 |
<property name="src.bin.dir" location="${src.dir}/share/bin"/>
|
|
64 |
<property name="src.classes.dir" location="${src.dir}/share/classes"/>
|
|
65 |
<property name="test.dir" location="test"/>
|
|
66 |
|
|
67 |
<!-- java.marker is set to a marker file to check for within a Java install dir.
|
|
68 |
The best file to check for across Solaris/Linux/Windows/MacOS is one of the
|
|
69 |
executables; regrettably, that is OS-specific. -->
|
|
70 |
<condition property="java.marker" value="bin/java">
|
|
71 |
<os family="unix"/>
|
|
72 |
</condition>
|
|
73 |
<condition property="java.marker" value="bin/java.exe">
|
|
74 |
<os family="windows"/>
|
|
75 |
</condition>
|
|
76 |
|
|
77 |
<!-- Standard property values, if not overriden by earlier settings. -->
|
|
78 |
<property file="${make.dir}/build.properties"/>
|
|
79 |
|
|
80 |
<!-- Standard target to build deliverables for JDK build. -->
|
|
81 |
|
|
82 |
<target name="build" depends="build-bootstrap-tools,build-all-classes">
|
|
83 |
<copy todir="${dist.dir}/bootstrap">
|
|
84 |
<fileset dir="${build.bootstrap.dir}" includes="bin/,lib/"/>
|
|
85 |
</copy>
|
|
86 |
<chmod dir="${dist.dir}/bootstrap/bin" perm="ugo+rx">
|
|
87 |
<include name="*"/>
|
|
88 |
</chmod>
|
|
89 |
<mkdir dir="${dist.lib.dir}"/>
|
|
90 |
<jar file="${dist.lib.dir}/classes.jar" basedir="${build.classes.dir}"/>
|
|
91 |
<zip file="${dist.lib.dir}/src.zip" basedir="${src.classes.dir}"/>
|
|
92 |
</target>
|
|
93 |
|
|
94 |
<target name="build-bootstrap-tools" depends="build-bootstrap-javac,build-bootstrap-javadoc,build-bootstrap-doclets,build-bootstrap-javah"/>
|
|
95 |
|
|
96 |
<target name="build-all-tools" depends="build-javac,build-javadoc,build-doclets,build-javah,build-javap,build-apt"/>
|
|
97 |
|
|
98 |
<target name="build-all-classes" depends="build-classes-javac,build-classes-javadoc,build-classes-doclets,build-classes-javah,build-classes-javap,build-classes-apt"/>
|
|
99 |
|
|
100 |
<!-- clean -->
|
|
101 |
|
|
102 |
<target name="clean" description="Delete all generated files">
|
|
103 |
<delete dir="${build.dir}"/>
|
|
104 |
<delete dir="${dist.dir}"/>
|
|
105 |
</target>
|
|
106 |
|
|
107 |
<!-- Additional targets for running tools on the build -->
|
|
108 |
|
|
109 |
<!-- An alternative for the following would be to do a single jtreg run for all tests.
|
|
110 |
However, that would currently be slower, since we would have to run all the tests
|
|
111 |
with samevm="false", since not all test directories currently support samevm="true". -->
|
|
112 |
|
|
113 |
<target name="jtreg" depends="jtreg-javac,jtreg-javadoc,jtreg-doclets,jtreg-javah,jtreg-javap,jtreg-apt"/>
|
|
114 |
|
|
115 |
<target name="findbugs" depends="-def-findbugs,build-all-tools">
|
|
116 |
<property name="findbugs.reportLevel" value="medium"/>
|
|
117 |
<mkdir dir="${dist.findbugs.dir}"/>
|
|
118 |
<findbugs
|
|
119 |
home="${findbugs.home}"
|
|
120 |
projectName="JDK langtools ${full.version}"
|
|
121 |
output="xml"
|
|
122 |
outputFile="${dist.findbugs.dir}/findbugs.xml"
|
|
123 |
reportLevel="${findbugs.reportLevel}"
|
|
124 |
failOnError="false"
|
|
125 |
errorProperty="findbugs.all.errors"
|
|
126 |
warningsProperty="findbugs.all.warnings"
|
|
127 |
jvmargs="-Xmx512M">
|
|
128 |
<class location="${build.classes.dir}"/>
|
|
129 |
<sourcePath>
|
|
130 |
<pathelement location="${src.classes.dir}"/>
|
|
131 |
</sourcePath>
|
|
132 |
</findbugs>
|
|
133 |
<exec executable="sh">
|
|
134 |
<arg value="${findbugs.home}/bin/convertXmlToText"/>
|
|
135 |
<arg value="-longBugCodes"/>
|
|
136 |
<arg value="-html:${findbugs.home}/src/xsl/fancy.xsl"/>
|
|
137 |
<arg value="${dist.findbugs.dir}/findbugs.xml"/>
|
|
138 |
<redirector output="${dist.findbugs.dir}/findbugs.html"/>
|
|
139 |
</exec>
|
|
140 |
</target>
|
|
141 |
|
|
142 |
<target name="coverage" depends="-def-cobertura,build-all-classes,instrument-classes,jtreg,coverage-report"/>
|
|
143 |
|
|
144 |
<target name="instrument-classes" depends="-def-cobertura">
|
|
145 |
<!-- only define the following property when we want coverage info -->
|
|
146 |
<path id="coverage.classpath">
|
|
147 |
<pathelement location="${build.coverage.dir}/classes"/>
|
|
148 |
<path refid="cobertura.classpath"/>
|
|
149 |
</path>
|
|
150 |
<property name="coverage.options" value="-Dnet.sourceforge.cobertura.datafile=${build.coverage.dir}/cobertura.ser"/>
|
|
151 |
<property name="coverage.classpath" refid="coverage.classpath"/>
|
|
152 |
<mkdir dir="${build.coverage.dir}/classes"/>
|
|
153 |
<delete file="${build.coverage.dir}/cobertura.ser"/>
|
|
154 |
<cobertura-instrument todir="${build.coverage.dir}/classes"
|
|
155 |
datafile="${build.coverage.dir}/cobertura.ser">
|
|
156 |
<fileset dir="${build.classes.dir}"
|
|
157 |
includes="**/*.class" excludes="**/resources/*.class"/>
|
|
158 |
</cobertura-instrument>
|
|
159 |
</target>
|
|
160 |
|
|
161 |
<target name="coverage-report" depends="-def-cobertura">
|
|
162 |
<mkdir dir="${dist.coverage.dir}"/>
|
|
163 |
<cobertura-report
|
|
164 |
srcdir="${src.classes.dir}"
|
|
165 |
destdir="${dist.coverage.dir}"
|
|
166 |
datafile="${build.coverage.dir}/cobertura.ser"/>
|
|
167 |
<cobertura-report
|
|
168 |
format="xml"
|
|
169 |
srcdir="${src.classes.dir}"
|
|
170 |
destdir="${dist.coverage.dir}"
|
|
171 |
datafile="${build.coverage.dir}/cobertura.ser"/>
|
|
172 |
</target>
|
|
173 |
|
|
174 |
<!-- javac targets -->
|
|
175 |
|
|
176 |
<target name="build-bootstrap-javac" depends="-def-build-bootstrap-tool">
|
|
177 |
<build-bootstrap-tool name="javac" includes="${javac.includes}"/>
|
|
178 |
</target>
|
|
179 |
|
|
180 |
<target name="build-classes-javac" depends="build-bootstrap-javac">
|
|
181 |
<build-classes name="javac" includes="${javac.includes}"/>
|
|
182 |
</target>
|
|
183 |
|
|
184 |
<target name="build-javac" depends="build-bootstrap-javac">
|
|
185 |
<build-tool name="javac" includes="${javac.includes}"/>
|
|
186 |
</target>
|
|
187 |
|
|
188 |
<target name="javadoc-javac" depends="build-javac,-def-javadoc-tool">
|
|
189 |
<javadoc-tool name="javac" includes="${javac.includes}" options="${javadoc.jls3.option}"/>
|
|
190 |
</target>
|
|
191 |
|
|
192 |
<target name="jtreg-javac" depends="build-javac,-def-jtreg">
|
|
193 |
<jtreg-tool name="javac" samevm="true" tests="${javac.tests}"/>
|
|
194 |
</target>
|
|
195 |
|
|
196 |
<target name="findbugs-javac" depends="build-javac,-def-findbugs">
|
|
197 |
<findbugs-tool name="javac"/>
|
|
198 |
</target>
|
|
199 |
|
|
200 |
<target name="javac" depends="build-javac,jtreg-javac,findbugs-javac"/>
|
|
201 |
|
|
202 |
<!-- javadoc targets -->
|
|
203 |
|
|
204 |
<target name="build-bootstrap-javadoc" depends="build-bootstrap-javac">
|
|
205 |
<build-bootstrap-tool name="javadoc"
|
|
206 |
includes="${javadoc.includes}"
|
|
207 |
jarclasspath="javac.jar doclets.jar"/>
|
|
208 |
</target>
|
|
209 |
|
|
210 |
<target name="build-classes-javadoc" depends="build-classes-javac">
|
|
211 |
<build-classes name="javadoc" includes="${javadoc.includes}"/>
|
|
212 |
</target>
|
|
213 |
|
|
214 |
<target name="build-javadoc" depends="build-javac">
|
|
215 |
<build-tool name="javadoc"
|
|
216 |
includes="${javadoc.includes}"
|
|
217 |
jarclasspath="javac.jar doclets.jar"/>
|
|
218 |
</target>
|
|
219 |
|
|
220 |
<target name="javadoc-javadoc" depends="build-javadoc,-def-javadoc-tool">
|
|
221 |
<javadoc-tool name="javadoc" includes="${javadoc.includes}"/>
|
|
222 |
</target>
|
|
223 |
|
|
224 |
<target name="jtreg-javadoc" depends="build-javadoc,-def-jtreg">
|
|
225 |
<jtreg-tool name="javadoc" samevm="false" tests="${javadoc.tests}"/>
|
|
226 |
</target>
|
|
227 |
|
|
228 |
<target name="findbugs-javadoc" depends="build-javadoc,-def-findbugs">
|
|
229 |
<findbugs-tool name="javadoc"/>
|
|
230 |
</target>
|
|
231 |
|
|
232 |
<target name="javadoc" depends="build-javadoc,jtreg-javadoc,findbugs-javadoc"/>
|
|
233 |
|
|
234 |
<!-- doclets targets -->
|
|
235 |
|
|
236 |
<target name="build-bootstrap-doclets" depends="build-bootstrap-javadoc,-def-build-bootstrap-jar">
|
|
237 |
<build-bootstrap-jar name="doclets"
|
|
238 |
includes="${doclets.includes}"
|
|
239 |
jarmainclass="com.sun.tools.javadoc.Main"
|
|
240 |
jarclasspath="javadoc.jar"/>
|
|
241 |
</target>
|
|
242 |
|
|
243 |
<target name="build-classes-doclets" depends="build-classes-javadoc">
|
|
244 |
<build-classes name="doclets" includes="${doclets.includes}"/>
|
|
245 |
</target>
|
|
246 |
|
|
247 |
<target name="build-doclets" depends="build-javadoc">
|
|
248 |
<!-- just jar, no bin for doclets -->
|
|
249 |
<build-jar name="doclets"
|
|
250 |
includes="${doclets.includes}"
|
|
251 |
jarclasspath="javadoc.jar"/>
|
|
252 |
</target>
|
|
253 |
|
|
254 |
<!-- (no javadoc for doclets) -->
|
|
255 |
|
|
256 |
<target name="jtreg-doclets" depends="build-doclets,-def-jtreg">
|
|
257 |
<jtreg-tool name="doclets" samevm="false" tests="${doclets.tests}"/>
|
|
258 |
</target>
|
|
259 |
|
|
260 |
<target name="findbugs-doclets" depends="build-doclets,-def-findbugs">
|
|
261 |
<findbugs-tool name="doclets"/>
|
|
262 |
</target>
|
|
263 |
|
|
264 |
<target name="doclets" depends="build-doclets,jtreg-doclets,findbugs-doclets"/>
|
|
265 |
|
|
266 |
<!-- javah targets -->
|
|
267 |
|
|
268 |
<target name="build-bootstrap-javah" depends="build-bootstrap-javadoc">
|
|
269 |
<build-bootstrap-tool name="javah"
|
|
270 |
includes="${javah.includes}"
|
|
271 |
jarclasspath="javadoc.jar doclets.jar javac.jar"/>
|
|
272 |
</target>
|
|
273 |
|
|
274 |
<target name="build-javah" depends="build-javadoc">
|
|
275 |
<build-tool name="javah"
|
|
276 |
includes="${javah.includes}"
|
|
277 |
jarclasspath="javadoc.jar doclets.jar javac.jar"/>
|
|
278 |
</target>
|
|
279 |
|
|
280 |
<target name="build-classes-javah" depends="build-classes-javadoc">
|
|
281 |
<build-classes name="javah" includes="${javah.includes}"/>
|
|
282 |
</target>
|
|
283 |
|
|
284 |
<!-- (no javadoc for javah) -->
|
|
285 |
|
|
286 |
<target name="jtreg-javah" depends="build-javah,-def-jtreg">
|
|
287 |
<jtreg-tool name="javah" samevm="true" tests="${javah.tests}"/>
|
|
288 |
</target>
|
|
289 |
|
|
290 |
<target name="findbugs-javah" depends="build-javah,-def-findbugs">
|
|
291 |
<findbugs-tool name="javah"/>
|
|
292 |
</target>
|
|
293 |
|
|
294 |
<target name="javah" depends="build-javah,jtreg-javah,findbugs-javah"/>
|
|
295 |
|
|
296 |
<!-- javap targets -->
|
|
297 |
|
|
298 |
<target name="build-bootstrap-javap" depends="-def-build-bootstrap-tool">
|
|
299 |
<build-bootstrap-tool name="javap"
|
|
300 |
includes="${javap.includes}"
|
|
301 |
jarmainclass="sun.tools.javap.Main"/>
|
|
302 |
</target>
|
|
303 |
|
|
304 |
<target name="build-classes-javap" depends="build-bootstrap-javac">
|
|
305 |
<build-classes name="javap" includes="${javap.includes}"/>
|
|
306 |
</target>
|
|
307 |
|
|
308 |
<target name="build-javap" depends="build-bootstrap-javac">
|
|
309 |
<build-tool name="javap"
|
|
310 |
includes="${javap.includes}"
|
|
311 |
jarmainclass="sun.tools.javap.Main"/>
|
|
312 |
</target>
|
|
313 |
|
|
314 |
<!-- (no javadoc for javap) -->
|
|
315 |
|
|
316 |
<target name="jtreg-javap" depends="build-javap,-def-jtreg">
|
|
317 |
<jtreg-tool name="javap" samevm="true" tests="${javap.tests}"/>
|
|
318 |
</target>
|
|
319 |
|
|
320 |
<target name="findbugs-javap" depends="build-javap,-def-findbugs">
|
|
321 |
<findbugs-tool name="javap"/>
|
|
322 |
</target>
|
|
323 |
|
|
324 |
<target name="javap" depends="build-javap,jtreg-javap,findbugs-javap"/>
|
|
325 |
|
|
326 |
<!-- apt targets -->
|
|
327 |
|
|
328 |
<target name="build-bootstrap-apt" depends="build-bootstrap-javac">
|
|
329 |
<build-bootstrap-tool name="apt"
|
|
330 |
includes="${apt.includes}"
|
|
331 |
jarclasspath="javac.jar"/>
|
|
332 |
</target>
|
|
333 |
|
|
334 |
<target name="build-apt" depends="build-javac">
|
|
335 |
<build-tool name="apt"
|
|
336 |
includes="${apt.includes}"
|
|
337 |
jarclasspath="javac.jar"/>
|
|
338 |
</target>
|
|
339 |
|
|
340 |
<target name="build-classes-apt" depends="build-classes-javac">
|
|
341 |
<build-classes name="apt" includes="${apt.includes}"/>
|
|
342 |
</target>
|
|
343 |
|
|
344 |
<target name="javadoc-apt" depends="build-apt,-def-javadoc-tool">
|
|
345 |
<javadoc-tool name="apt" includes="${apt.includes}"/>
|
|
346 |
</target>
|
|
347 |
|
|
348 |
|
|
349 |
<target name="jtreg-apt" depends="build-apt,-def-jtreg">
|
|
350 |
<jtreg-tool name="apt" samevm="true" tests="${apt.tests}"/>
|
|
351 |
</target>
|
|
352 |
|
|
353 |
<target name="findbugs-apt" depends="build-apt,-def-findbugs">
|
|
354 |
<findbugs-tool name="apt"/>
|
|
355 |
</target>
|
|
356 |
|
|
357 |
<target name="apt" depends="build-apt,jtreg-apt,findbugs-apt"/>
|
|
358 |
|
|
359 |
<!-- Check targets -->
|
|
360 |
|
|
361 |
<target name="-check-boot.java.home" depends="-def-check">
|
|
362 |
<check name="bootstrap java" property="boot.java.home" marker="${java.marker}"/>
|
|
363 |
</target>
|
|
364 |
|
|
365 |
<target name="-check-target.java.home" depends="-def-check">
|
|
366 |
<check name="target java" property="target.java.home" marker="${java.marker}"/>
|
|
367 |
</target>
|
|
368 |
|
|
369 |
<target name="-check-cobertura.home" depends="-def-check">
|
|
370 |
<check name="cobertura" property="cobertura.home" marker="cobertura.jar"/>
|
|
371 |
</target>
|
|
372 |
|
|
373 |
<target name="-check-findbugs.home" depends="-def-check">
|
|
374 |
<check name="findbugs" property="findbugs.home" marker="lib/findbugs.jar"/>
|
|
375 |
</target>
|
|
376 |
|
|
377 |
<target name="-check-jtreg.home" depends="-def-check">
|
|
378 |
<check name="jtreg" property="jtreg.home" marker="lib/jtreg.jar"/>
|
|
379 |
</target>
|
|
380 |
|
|
381 |
<!-- Ant macro and preset defs -->
|
|
382 |
|
|
383 |
<target name="-def-build-tool" depends="-def-build-jar">
|
|
384 |
<macrodef name="build-tool">
|
|
385 |
<attribute name="name"/>
|
|
386 |
<attribute name="includes"/>
|
|
387 |
<attribute name="excludes" default="**/package-info.java"/>
|
|
388 |
<attribute name="bin.dir" default="${dist.bin.dir}"/>
|
|
389 |
<attribute name="classes.dir" default="${build.classes.dir}"/>
|
|
390 |
<attribute name="gensrc.dir" default="${build.gensrc.dir}"/>
|
|
391 |
<attribute name="lib.dir" default="${dist.lib.dir}"/>
|
|
392 |
<attribute name="java" default="java"/>
|
|
393 |
<attribute name="javac.bootclasspath" default="-J-Xbootclasspath/p:${build.bootstrap.dir}/classes"/>
|
|
394 |
<attribute name="javac.target" default="${javac.target}"/>
|
|
395 |
<attribute name="jarmainclass" default="com.sun.tools.@{name}.Main"/>
|
|
396 |
<attribute name="jarclasspath" default=""/>
|
|
397 |
<attribute name="release" default="${release}"/>
|
|
398 |
<attribute name="full.version" default="${full.version}"/>
|
|
399 |
<sequential>
|
|
400 |
<build-jar
|
|
401 |
name="@{name}"
|
|
402 |
gensrc.dir="@{gensrc.dir}"
|
|
403 |
classes.dir="@{classes.dir}"
|
|
404 |
lib.dir="@{lib.dir}"
|
|
405 |
includes="@{includes}"
|
|
406 |
excludes="@{excludes}"
|
|
407 |
jarmainclass="@{jarmainclass}"
|
|
408 |
jarclasspath="@{jarclasspath}"
|
|
409 |
release="@{release}"
|
|
410 |
full.version="@{full.version}"
|
|
411 |
javac.bootclasspath="@{javac.bootclasspath}"
|
|
412 |
javac.target="@{javac.target}"
|
|
413 |
/>
|
|
414 |
<mkdir dir="@{bin.dir}"/>
|
|
415 |
<copy file="${src.bin.dir}/launcher.sh-template" tofile="@{bin.dir}/@{name}">
|
|
416 |
<filterset begintoken="#" endtoken="#">
|
|
417 |
<filter token="PROGRAM" value="@{name}"/>
|
|
418 |
<filter token="TARGET_JAVA" value="@{java}"/>
|
|
419 |
</filterset>
|
|
420 |
</copy>
|
|
421 |
<chmod file="@{bin.dir}/@{name}" perm="ugo+rx"/>
|
|
422 |
</sequential>
|
|
423 |
</macrodef>
|
|
424 |
</target>
|
|
425 |
|
|
426 |
<target name="-def-build-jar" depends="-def-build-classes">
|
|
427 |
<macrodef name="build-jar">
|
|
428 |
<attribute name="name"/>
|
|
429 |
<attribute name="includes"/>
|
|
430 |
<attribute name="excludes" default="**/package-info.java"/>
|
|
431 |
<attribute name="classes.dir" default="${build.classes.dir}"/>
|
|
432 |
<attribute name="gensrc.dir" default="${build.gensrc.dir}"/>
|
|
433 |
<attribute name="lib.dir" default="${dist.lib.dir}"/>
|
|
434 |
<attribute name="javac.bootclasspath" default="-J-Xbootclasspath/p:${build.bootstrap.dir}/classes"/>
|
|
435 |
<attribute name="javac.target" default="${javac.target}"/>
|
|
436 |
<attribute name="jarmainclass" default="com.sun.tools.@{name}.Main"/>
|
|
437 |
<attribute name="jarclasspath" default=""/>
|
|
438 |
<attribute name="release" default="${release}"/>
|
|
439 |
<attribute name="full.version" default="${full.version}"/>
|
|
440 |
<sequential>
|
|
441 |
<build-classes
|
|
442 |
name="@{name}"
|
|
443 |
gensrc.dir="@{gensrc.dir}"
|
|
444 |
classes.dir="@{classes.dir}"
|
|
445 |
includes="@{includes}"
|
|
446 |
excludes="@{excludes}"
|
|
447 |
release="@{release}"
|
|
448 |
full.version="@{full.version}"
|
|
449 |
javac.bootclasspath="@{javac.bootclasspath}"
|
|
450 |
javac.target="@{javac.target}"
|
|
451 |
/>
|
|
452 |
<mkdir dir="@{lib.dir}"/>
|
|
453 |
<jar destfile="@{lib.dir}/@{name}.jar"
|
|
454 |
basedir="@{classes.dir}"
|
|
455 |
includes="@{includes}">
|
|
456 |
<manifest>
|
|
457 |
<attribute name="Main-Class" value="@{jarmainclass}"/>
|
|
458 |
<attribute name="Class-Path" value="@{jarclasspath}"/>
|
|
459 |
</manifest>
|
|
460 |
</jar>
|
|
461 |
</sequential>
|
|
462 |
</macrodef>
|
|
463 |
</target>
|
|
464 |
|
|
465 |
<target name="-def-build-classes" depends="-def-pcompile">
|
|
466 |
<macrodef name="build-classes">
|
|
467 |
<attribute name="name"/>
|
|
468 |
<attribute name="includes"/>
|
|
469 |
<attribute name="excludes" default="**/package-info.java"/>
|
|
470 |
<attribute name="classes.dir" default="${build.classes.dir}"/>
|
|
471 |
<attribute name="gensrc.dir" default="${build.gensrc.dir}"/>
|
|
472 |
<attribute name="javac.bootclasspath" default="${build.bootstrap.dir}/classes"/>
|
|
473 |
<attribute name="javac.target" default="${javac.target}"/>
|
|
474 |
<attribute name="release" default="${release}"/>
|
|
475 |
<attribute name="full.version" default="${full.version}"/>
|
|
476 |
<sequential>
|
|
477 |
<mkdir dir="@{gensrc.dir}"/>
|
|
478 |
<mkdir dir="@{classes.dir}"/>
|
|
479 |
<pcompile srcdir="${src.classes.dir}"
|
|
480 |
destdir="@{gensrc.dir}"
|
|
481 |
includes="@{includes}"/>
|
|
482 |
<copy todir="@{gensrc.dir}">
|
|
483 |
<fileset dir="${src.classes.dir}" includes="${javac.includes}"/>
|
|
484 |
<globmapper from="*.properties-template" to="*.properties"/>
|
|
485 |
<filterset begintoken="$(" endtoken=")">
|
|
486 |
<filter token="JDK_VERSION" value="${jdk.version}"/>
|
|
487 |
<filter token="RELEASE" value="@{release}"/>
|
|
488 |
<filter token="FULL_VERSION" value="@{full.version}"/>
|
|
489 |
</filterset>
|
|
490 |
</copy>
|
|
491 |
<pcompile srcdir="@{gensrc.dir}"
|
|
492 |
destdir="@{gensrc.dir}"
|
|
493 |
includes="**/*.properties"/>
|
|
494 |
<javac fork="true"
|
|
495 |
srcdir="@{gensrc.dir}"
|
|
496 |
destdir="@{classes.dir}"
|
|
497 |
includes="@{includes}"
|
|
498 |
sourcepath=""
|
|
499 |
includeAntRuntime="no"
|
|
500 |
target="@{javac.target}">
|
|
501 |
<compilerarg value="-J-Xbootclasspath/p:@{javac.bootclasspath}"/>
|
|
502 |
<compilerarg line="${javac.version.opt}"/>
|
|
503 |
<compilerarg line="-Xlint"/>
|
|
504 |
</javac>
|
|
505 |
<javac fork="true"
|
|
506 |
srcdir="${src.classes.dir}"
|
|
507 |
destdir="@{classes.dir}"
|
|
508 |
includes="@{includes}"
|
|
509 |
excludes="@{excludes}"
|
|
510 |
sourcepath=""
|
|
511 |
includeAntRuntime="no"
|
|
512 |
target="@{javac.target}"
|
|
513 |
debug="${javac.debug}"
|
|
514 |
debuglevel="${javac.debuglevel}">
|
|
515 |
<compilerarg value="-J-Xbootclasspath/p:@{javac.bootclasspath}"/>
|
|
516 |
<compilerarg value="-Xbootclasspath/p:@{classes.dir}"/>
|
|
517 |
<compilerarg line="${javac.no.jdk.warnings}"/>
|
|
518 |
<compilerarg line="${javac.version.opt}"/>
|
|
519 |
<compilerarg line="${javac.lint.opts}"/>
|
|
520 |
</javac>
|
|
521 |
<copy todir="@{classes.dir}">
|
|
522 |
<fileset dir="${src.classes.dir}">
|
|
523 |
<include name="@{includes}"/>
|
|
524 |
<exclude name="**/*.java"/>
|
|
525 |
<exclude name="**/*.properties"/>
|
|
526 |
<exclude name="**/*-template"/>
|
|
527 |
<exclude name="**/package.html"/>
|
|
528 |
</fileset>
|
|
529 |
</copy>
|
|
530 |
</sequential>
|
|
531 |
</macrodef>
|
|
532 |
</target>
|
|
533 |
|
|
534 |
<target name="-def-build-bootstrap-tool" depends="-check-boot.java.home,-def-build-tool">
|
|
535 |
<presetdef name="build-bootstrap-tool">
|
|
536 |
<build-tool
|
|
537 |
javac.target="${boot.javac.target}"
|
|
538 |
gensrc.dir="${build.bootstrap.dir}/gensrc"
|
|
539 |
classes.dir="${build.bootstrap.dir}/classes"
|
|
540 |
bin.dir="${build.bootstrap.dir}/bin"
|
|
541 |
lib.dir="${build.bootstrap.dir}/lib"
|
|
542 |
java="${boot.java}"
|
|
543 |
javac.bootclasspath=""
|
|
544 |
release="${bootstrap.release}"
|
|
545 |
full.version="${bootstrap.full.version}"/>
|
|
546 |
</presetdef>
|
|
547 |
</target>
|
|
548 |
|
|
549 |
<target name="-def-build-bootstrap-jar" depends="-def-build-jar">
|
|
550 |
<presetdef name="build-bootstrap-jar">
|
|
551 |
<build-jar
|
|
552 |
javac.target="${boot.javac.target}"
|
|
553 |
gensrc.dir="${build.bootstrap.dir}/gensrc"
|
|
554 |
classes.dir="${build.bootstrap.dir}/classes"
|
|
555 |
lib.dir="${build.bootstrap.dir}/lib"
|
|
556 |
javac.bootclasspath=""
|
|
557 |
release="${bootstrap.release}"
|
|
558 |
full.version="${bootstrap.full.version}"/>
|
|
559 |
</presetdef>
|
|
560 |
</target>
|
|
561 |
|
|
562 |
<target name="-def-pcompile">
|
|
563 |
<mkdir dir="${build.toolclasses.dir}"/>
|
|
564 |
<javac srcdir="${make.tools.dir}/CompileProperties"
|
|
565 |
destdir="${build.toolclasses.dir}/"
|
|
566 |
classpath="${ant.home}/lib/ant.jar"/>
|
|
567 |
<taskdef name="pcompile"
|
|
568 |
classname="CompilePropertiesTask"
|
|
569 |
classpath="${build.toolclasses.dir}/"/>
|
|
570 |
</target>
|
|
571 |
|
|
572 |
<target name="-def-javadoc-tool" depends="-check-target.java.home">
|
|
573 |
<macrodef name="javadoc-tool">
|
|
574 |
<attribute name="name"/>
|
|
575 |
<attribute name="includes"/>
|
|
576 |
<attribute name="options" default=""/>
|
|
577 |
<attribute name="source" default="1.5"/> <!-- FIXME -->
|
|
578 |
<sequential>
|
|
579 |
<property name="javadoc.options" value=""/> <!-- default, can be overridden per user or per project -->
|
|
580 |
<!-- Note: even with this default value, includes
|
|
581 |
from src.classes.dir get javadoc'd; see packageset below -->
|
|
582 |
<property name="javadoc.packagenames" value="none"/> <!-- default, can be overridden per user or per project -->
|
|
583 |
<javadoc
|
|
584 |
executable="${target.java.home}/bin/javadoc"
|
|
585 |
destdir="${build.javadoc.dir}/@{name}"
|
|
586 |
source="@{source}"
|
|
587 |
windowtitle="UNOFFICIAL"
|
|
588 |
failonerror="true"
|
|
589 |
use="true"
|
|
590 |
author="false"
|
|
591 |
version="false"
|
|
592 |
packagenames="${javadoc.packagenames}" >
|
|
593 |
<header><![CDATA[<strong>Unofficial Javadoc</strong> generated from developer sources for preview purposes only]]></header>
|
|
594 |
<arg line="@{options}"/>
|
|
595 |
<bootclasspath>
|
|
596 |
<path location="${build.classes.dir}"/>
|
|
597 |
<path location="${target.java.home}/jre/lib/rt.jar"/>
|
|
598 |
</bootclasspath>
|
|
599 |
<sourcepath>
|
|
600 |
<pathelement location="${src.classes.dir}"/>
|
|
601 |
</sourcepath>
|
|
602 |
<!-- XXX just <fileset> (restricted further to **/*.java) and no <packageset> -->
|
|
603 |
<!-- means that {@link some.package} will not work, which is no good. -->
|
|
604 |
<!-- (It correctly skips excluded single classes, but not if packageset is also included, -->
|
|
605 |
<!-- which also causes duplicates in the class index for included files.) -->
|
|
606 |
<packageset dir="${src.classes.dir}" includes="@{includes}">
|
|
607 |
<or>
|
|
608 |
<filename name="java/"/>
|
|
609 |
<filename name="javax/"/>
|
|
610 |
<filename name="com/sun/javadoc/"/>
|
|
611 |
<filename name="com/sun/mirror/"/>
|
|
612 |
<filename name="com/sun/source/"/>
|
|
613 |
</or>
|
|
614 |
</packageset>
|
|
615 |
</javadoc>
|
|
616 |
</sequential>
|
|
617 |
</macrodef>
|
|
618 |
</target>
|
|
619 |
|
|
620 |
<target name="-def-jtreg" unless="jtreg.defined" depends="-check-jtreg.home">
|
|
621 |
<taskdef name="jtreg" classname="com.sun.javatest.regtest.Main$$Ant">
|
|
622 |
<classpath>
|
|
623 |
<pathelement location="${jtreg.home}/lib/jtreg.jar"/>
|
|
624 |
<pathelement location="${jtreg.home}/lib/javatest.jar"/>
|
|
625 |
</classpath>
|
|
626 |
</taskdef>
|
|
627 |
<macrodef name="jtreg-tool">
|
|
628 |
<attribute name="name"/>
|
|
629 |
<attribute name="tests"/>
|
|
630 |
<attribute name="jdk" default="${target.java.home}"/>
|
|
631 |
<attribute name="samevm" default="false"/>
|
|
632 |
<attribute name="verbose" default="summary"/>
|
|
633 |
<attribute name="options" default=""/>
|
|
634 |
<attribute name="keywords" default="-keywords:!ignore"/>
|
|
635 |
<attribute name="jpda.jvmargs" default=""/>
|
|
636 |
<sequential>
|
|
637 |
<property name="coverage.options" value=""/> <!-- default -->
|
|
638 |
<property name="coverage.classpath" value=""/> <!-- default -->
|
|
639 |
<jtreg
|
|
640 |
dir="${test.dir}"
|
|
641 |
workDir="${build.jtreg.dir}/@{name}/work"
|
|
642 |
reportDir="${build.jtreg.dir}/@{name}/report"
|
|
643 |
jdk="@{jdk}"
|
|
644 |
samevm="@{samevm}" verbose="@{verbose}"
|
|
645 |
failonerror="false" resultproperty="jtreg.@{name}.result"
|
|
646 |
javacoptions="-g"
|
|
647 |
vmoptions="${coverage.options} -Xbootclasspath/p:${coverage.classpath}:${build.classes.dir} @{jpda.jvmargs}">
|
|
648 |
<arg line="@{keywords}"/>
|
|
649 |
<arg line="@{options}"/>
|
|
650 |
<arg line="@{tests}"/>
|
|
651 |
</jtreg>
|
|
652 |
<!-- the next two properties are for convenience, when only
|
|
653 |
a single instance of jtreg will be invoked. -->
|
|
654 |
<condition property="jtreg.passed">
|
|
655 |
<equals arg1="${jtreg.javac.result}" arg2="0"/>
|
|
656 |
</condition>
|
|
657 |
<property name="jtreg.report" value="${build.jtreg.dir}/@{name}/report"/>
|
|
658 |
</sequential>
|
|
659 |
</macrodef>
|
|
660 |
<property name="jtreg.defined" value="true"/>
|
|
661 |
</target>
|
|
662 |
|
|
663 |
<target name="-def-cobertura" depends="-check-cobertura.home">
|
|
664 |
<path id="cobertura.classpath">
|
|
665 |
<fileset dir="${cobertura.home}">
|
|
666 |
<include name="cobertura.jar"/>
|
|
667 |
<include name="lib/**/*.jar"/>
|
|
668 |
</fileset>
|
|
669 |
</path>
|
|
670 |
<taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>
|
|
671 |
</target>
|
|
672 |
|
|
673 |
<target name="-def-findbugs" unless="findbugs.defined" depends="-check-findbugs.home">
|
|
674 |
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask">
|
|
675 |
<classpath>
|
|
676 |
<pathelement location="${findbugs.home}/lib/findbugs.jar"/>
|
|
677 |
</classpath>
|
|
678 |
</taskdef>
|
|
679 |
<macrodef name="findbugs-tool">
|
|
680 |
<attribute name="name"/>
|
|
681 |
<attribute name="output" default="emacs"/>
|
|
682 |
<attribute name="outputFile" default=""/>
|
|
683 |
<attribute name="reportLevel" default="high"/>
|
|
684 |
<sequential>
|
|
685 |
<findbugs
|
|
686 |
home="${findbugs.home}"
|
|
687 |
output="@{output}"
|
|
688 |
outputFile="@{outputFile}"
|
|
689 |
reportLevel="@{reportLevel}"
|
|
690 |
failOnError="false"
|
|
691 |
errorProperty="findbugs.@{name}.errors"
|
|
692 |
warningsProperty="findbugs.@{name}.warnings"
|
|
693 |
jvmargs="-Xmx512M" >
|
|
694 |
<class location="${dist.dir}/lib/@{name}.jar"/>
|
|
695 |
<auxClasspath>
|
|
696 |
<pathelement location="${build.classes.dir}"/>
|
|
697 |
</auxClasspath>
|
|
698 |
<sourcePath>
|
|
699 |
<pathelement location="${src.classes.dir}"/>
|
|
700 |
</sourcePath>
|
|
701 |
</findbugs>
|
|
702 |
</sequential>
|
|
703 |
</macrodef>
|
|
704 |
<property name="findbugs.defined" value="true"/>
|
|
705 |
</target>
|
|
706 |
|
|
707 |
<target name="-def-check">
|
|
708 |
<macrodef name="check">
|
|
709 |
<attribute name="name"/>
|
|
710 |
<attribute name="property"/>
|
|
711 |
<attribute name="marker"/>
|
|
712 |
<sequential>
|
|
713 |
<fail message="Cannot locate @{name}: please set @{property} to its location">
|
|
714 |
<condition>
|
|
715 |
<not>
|
|
716 |
<isset property="@{property}"/>
|
|
717 |
</not>
|
|
718 |
</condition>
|
|
719 |
</fail>
|
|
720 |
<fail message="@{name} is not installed in ${@{property}}">
|
|
721 |
<condition>
|
|
722 |
<not>
|
|
723 |
<available file="${@{property}}/@{marker}"/>
|
|
724 |
</not>
|
|
725 |
</condition>
|
|
726 |
</fail>
|
|
727 |
</sequential>
|
|
728 |
</macrodef>
|
|
729 |
</target>
|
|
730 |
|
|
731 |
<!-- standard JDK target -->
|
|
732 |
<target name="sanity"
|
|
733 |
description="display settings of congiguration values">
|
|
734 |
<echo level="info">ant.home = ${ant.home}</echo>
|
|
735 |
<echo level="info">boot.java.home = ${boot.java.home}</echo>
|
|
736 |
<echo level="info">target.java.home = ${target.java.home}</echo>
|
|
737 |
<echo level="info">jtreg.home = ${jtreg.home}</echo>
|
|
738 |
<echo level="info">findbugs.home = ${findbugs.home}</echo>
|
|
739 |
</target>
|
|
740 |
|
|
741 |
<!-- useful debugging targets -->
|
|
742 |
<target name="diagnostics">
|
|
743 |
<diagnostics/>
|
|
744 |
</target>
|
|
745 |
|
|
746 |
<target name="post-sanity" depends="-def-jtreg,sanity,build"
|
|
747 |
description="perform basic validation after a standard build">
|
|
748 |
<jtreg
|
|
749 |
dir="make/test"
|
|
750 |
workDir="${build.jtreg.dir}/post-sanity/work"
|
|
751 |
reportDir="${build.jtreg.dir}/post-sanity/report"
|
|
752 |
jdk="${target.java.home}"
|
|
753 |
verbose="summary"
|
|
754 |
failonerror="false" resultproperty="jtreg.post-sanity.result">
|
|
755 |
</jtreg>
|
|
756 |
|
|
757 |
</target>
|
|
758 |
</project>
|
|
759 |
|