author | trims |
Wed, 01 Apr 2009 22:31:26 -0700 | |
changeset 2275 | 94c3ff1a20d0 |
parent 2212 | 1d3dc0e0ba0c |
child 2982 | 090c71af18f6 |
child 2850 | 307d7719ccb7 |
permissions | -rw-r--r-- |
10 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
2 |
<!-- |
|
2212 | 3 |
Copyright 2007-2009 Sun Microsystems, Inc. All Rights Reserved. |
10 | 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"/> |
|
727
cb50c1ae7bab
4075303: Use javap to enquire aboput a specific inner class
jjg
parents:
10
diff
changeset
|
139 |
</exec> |
10 | 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 |
||
727
cb50c1ae7bab
4075303: Use javap to enquire aboput a specific inner class
jjg
parents:
10
diff
changeset
|
304 |
<target name="build-classes-javap" depends="build-classes-javac"> |
10 | 305 |
<build-classes name="javap" includes="${javap.includes}"/> |
306 |
</target> |
|
307 |
||
727
cb50c1ae7bab
4075303: Use javap to enquire aboput a specific inner class
jjg
parents:
10
diff
changeset
|
308 |
<target name="build-javap" depends="build-javac"> |
10 | 309 |
<build-tool name="javap" |
310 |
includes="${javap.includes}" |
|
727
cb50c1ae7bab
4075303: Use javap to enquire aboput a specific inner class
jjg
parents:
10
diff
changeset
|
311 |
jarmainclass="sun.tools.javap.Main" |
cb50c1ae7bab
4075303: Use javap to enquire aboput a specific inner class
jjg
parents:
10
diff
changeset
|
312 |
jarclasspath="javac.jar"/> |
10 | 313 |
</target> |
314 |
||
315 |
<!-- (no javadoc for javap) --> |
|
316 |
||
317 |
<target name="jtreg-javap" depends="build-javap,-def-jtreg"> |
|
318 |
<jtreg-tool name="javap" samevm="true" tests="${javap.tests}"/> |
|
319 |
</target> |
|
320 |
||
321 |
<target name="findbugs-javap" depends="build-javap,-def-findbugs"> |
|
322 |
<findbugs-tool name="javap"/> |
|
323 |
</target> |
|
324 |
||
325 |
<target name="javap" depends="build-javap,jtreg-javap,findbugs-javap"/> |
|
326 |
||
327 |
<!-- apt targets --> |
|
328 |
||
329 |
<target name="build-bootstrap-apt" depends="build-bootstrap-javac"> |
|
330 |
<build-bootstrap-tool name="apt" |
|
331 |
includes="${apt.includes}" |
|
332 |
jarclasspath="javac.jar"/> |
|
333 |
</target> |
|
334 |
||
335 |
<target name="build-apt" depends="build-javac"> |
|
336 |
<build-tool name="apt" |
|
337 |
includes="${apt.includes}" |
|
338 |
jarclasspath="javac.jar"/> |
|
339 |
</target> |
|
340 |
||
341 |
<target name="build-classes-apt" depends="build-classes-javac"> |
|
342 |
<build-classes name="apt" includes="${apt.includes}"/> |
|
343 |
</target> |
|
344 |
||
345 |
<target name="javadoc-apt" depends="build-apt,-def-javadoc-tool"> |
|
346 |
<javadoc-tool name="apt" includes="${apt.includes}"/> |
|
347 |
</target> |
|
348 |
||
349 |
||
350 |
<target name="jtreg-apt" depends="build-apt,-def-jtreg"> |
|
351 |
<jtreg-tool name="apt" samevm="true" tests="${apt.tests}"/> |
|
352 |
</target> |
|
353 |
||
354 |
<target name="findbugs-apt" depends="build-apt,-def-findbugs"> |
|
355 |
<findbugs-tool name="apt"/> |
|
356 |
</target> |
|
357 |
||
358 |
<target name="apt" depends="build-apt,jtreg-apt,findbugs-apt"/> |
|
359 |
||
360 |
<!-- Check targets --> |
|
361 |
||
362 |
<target name="-check-boot.java.home" depends="-def-check"> |
|
363 |
<check name="bootstrap java" property="boot.java.home" marker="${java.marker}"/> |
|
364 |
</target> |
|
365 |
||
366 |
<target name="-check-target.java.home" depends="-def-check"> |
|
367 |
<check name="target java" property="target.java.home" marker="${java.marker}"/> |
|
368 |
</target> |
|
369 |
||
370 |
<target name="-check-cobertura.home" depends="-def-check"> |
|
371 |
<check name="cobertura" property="cobertura.home" marker="cobertura.jar"/> |
|
372 |
</target> |
|
373 |
||
374 |
<target name="-check-findbugs.home" depends="-def-check"> |
|
375 |
<check name="findbugs" property="findbugs.home" marker="lib/findbugs.jar"/> |
|
376 |
</target> |
|
377 |
||
378 |
<target name="-check-jtreg.home" depends="-def-check"> |
|
379 |
<check name="jtreg" property="jtreg.home" marker="lib/jtreg.jar"/> |
|
380 |
</target> |
|
381 |
||
382 |
<!-- Ant macro and preset defs --> |
|
383 |
||
384 |
<target name="-def-build-tool" depends="-def-build-jar"> |
|
385 |
<macrodef name="build-tool"> |
|
386 |
<attribute name="name"/> |
|
387 |
<attribute name="includes"/> |
|
388 |
<attribute name="excludes" default="**/package-info.java"/> |
|
389 |
<attribute name="bin.dir" default="${dist.bin.dir}"/> |
|
390 |
<attribute name="classes.dir" default="${build.classes.dir}"/> |
|
391 |
<attribute name="gensrc.dir" default="${build.gensrc.dir}"/> |
|
392 |
<attribute name="lib.dir" default="${dist.lib.dir}"/> |
|
1872 | 393 |
<attribute name="java" default="java"/> |
10 | 394 |
<attribute name="javac.bootclasspath" default="-J-Xbootclasspath/p:${build.bootstrap.dir}/classes"/> |
1871
9bb6518238ff
6795030: Files in langtools build can be compiled ignoring java.home settings
jjg
parents:
735
diff
changeset
|
395 |
<attribute name="javac.java.home" default="${boot.java.home}"/> |
10 | 396 |
<attribute name="javac.target" default="${javac.target}"/> |
397 |
<attribute name="jarmainclass" default="com.sun.tools.@{name}.Main"/> |
|
398 |
<attribute name="jarclasspath" default=""/> |
|
399 |
<attribute name="release" default="${release}"/> |
|
400 |
<attribute name="full.version" default="${full.version}"/> |
|
401 |
<sequential> |
|
402 |
<build-jar |
|
403 |
name="@{name}" |
|
404 |
gensrc.dir="@{gensrc.dir}" |
|
405 |
classes.dir="@{classes.dir}" |
|
406 |
lib.dir="@{lib.dir}" |
|
407 |
includes="@{includes}" |
|
408 |
excludes="@{excludes}" |
|
409 |
jarmainclass="@{jarmainclass}" |
|
410 |
jarclasspath="@{jarclasspath}" |
|
411 |
release="@{release}" |
|
412 |
full.version="@{full.version}" |
|
413 |
javac.bootclasspath="@{javac.bootclasspath}" |
|
414 |
javac.target="@{javac.target}" |
|
415 |
/> |
|
416 |
<mkdir dir="@{bin.dir}"/> |
|
417 |
<copy file="${src.bin.dir}/launcher.sh-template" tofile="@{bin.dir}/@{name}"> |
|
418 |
<filterset begintoken="#" endtoken="#"> |
|
419 |
<filter token="PROGRAM" value="@{name}"/> |
|
420 |
<filter token="TARGET_JAVA" value="@{java}"/> |
|
421 |
</filterset> |
|
422 |
</copy> |
|
423 |
<chmod file="@{bin.dir}/@{name}" perm="ugo+rx"/> |
|
424 |
</sequential> |
|
425 |
</macrodef> |
|
426 |
</target> |
|
427 |
||
428 |
<target name="-def-build-jar" depends="-def-build-classes"> |
|
429 |
<macrodef name="build-jar"> |
|
430 |
<attribute name="name"/> |
|
431 |
<attribute name="includes"/> |
|
432 |
<attribute name="excludes" default="**/package-info.java"/> |
|
433 |
<attribute name="classes.dir" default="${build.classes.dir}"/> |
|
434 |
<attribute name="gensrc.dir" default="${build.gensrc.dir}"/> |
|
435 |
<attribute name="lib.dir" default="${dist.lib.dir}"/> |
|
436 |
<attribute name="javac.bootclasspath" default="-J-Xbootclasspath/p:${build.bootstrap.dir}/classes"/> |
|
1871
9bb6518238ff
6795030: Files in langtools build can be compiled ignoring java.home settings
jjg
parents:
735
diff
changeset
|
437 |
<attribute name="javac.java.home" default="${boot.java.home}"/> |
10 | 438 |
<attribute name="javac.target" default="${javac.target}"/> |
439 |
<attribute name="jarmainclass" default="com.sun.tools.@{name}.Main"/> |
|
440 |
<attribute name="jarclasspath" default=""/> |
|
441 |
<attribute name="release" default="${release}"/> |
|
442 |
<attribute name="full.version" default="${full.version}"/> |
|
443 |
<sequential> |
|
444 |
<build-classes |
|
445 |
name="@{name}" |
|
446 |
gensrc.dir="@{gensrc.dir}" |
|
447 |
classes.dir="@{classes.dir}" |
|
448 |
includes="@{includes}" |
|
449 |
excludes="@{excludes}" |
|
450 |
release="@{release}" |
|
451 |
full.version="@{full.version}" |
|
452 |
javac.bootclasspath="@{javac.bootclasspath}" |
|
453 |
javac.target="@{javac.target}" |
|
454 |
/> |
|
455 |
<mkdir dir="@{lib.dir}"/> |
|
456 |
<jar destfile="@{lib.dir}/@{name}.jar" |
|
457 |
basedir="@{classes.dir}" |
|
458 |
includes="@{includes}"> |
|
459 |
<manifest> |
|
460 |
<attribute name="Main-Class" value="@{jarmainclass}"/> |
|
461 |
<attribute name="Class-Path" value="@{jarclasspath}"/> |
|
462 |
</manifest> |
|
463 |
</jar> |
|
464 |
</sequential> |
|
465 |
</macrodef> |
|
466 |
</target> |
|
467 |
||
468 |
<target name="-def-build-classes" depends="-def-pcompile"> |
|
469 |
<macrodef name="build-classes"> |
|
470 |
<attribute name="name"/> |
|
471 |
<attribute name="includes"/> |
|
472 |
<attribute name="excludes" default="**/package-info.java"/> |
|
473 |
<attribute name="classes.dir" default="${build.classes.dir}"/> |
|
474 |
<attribute name="gensrc.dir" default="${build.gensrc.dir}"/> |
|
475 |
<attribute name="javac.bootclasspath" default="${build.bootstrap.dir}/classes"/> |
|
1871
9bb6518238ff
6795030: Files in langtools build can be compiled ignoring java.home settings
jjg
parents:
735
diff
changeset
|
476 |
<attribute name="javac.java.home" default="${boot.java.home}"/> |
10 | 477 |
<attribute name="javac.target" default="${javac.target}"/> |
478 |
<attribute name="release" default="${release}"/> |
|
479 |
<attribute name="full.version" default="${full.version}"/> |
|
480 |
<sequential> |
|
481 |
<mkdir dir="@{gensrc.dir}"/> |
|
482 |
<mkdir dir="@{classes.dir}"/> |
|
483 |
<pcompile srcdir="${src.classes.dir}" |
|
484 |
destdir="@{gensrc.dir}" |
|
485 |
includes="@{includes}"/> |
|
486 |
<copy todir="@{gensrc.dir}"> |
|
727
cb50c1ae7bab
4075303: Use javap to enquire aboput a specific inner class
jjg
parents:
10
diff
changeset
|
487 |
<fileset dir="${src.classes.dir}" includes="@{includes}"/> |
10 | 488 |
<globmapper from="*.properties-template" to="*.properties"/> |
489 |
<filterset begintoken="$(" endtoken=")"> |
|
490 |
<filter token="JDK_VERSION" value="${jdk.version}"/> |
|
491 |
<filter token="RELEASE" value="@{release}"/> |
|
492 |
<filter token="FULL_VERSION" value="@{full.version}"/> |
|
493 |
</filterset> |
|
494 |
</copy> |
|
495 |
<pcompile srcdir="@{gensrc.dir}" |
|
496 |
destdir="@{gensrc.dir}" |
|
497 |
includes="**/*.properties"/> |
|
498 |
<javac fork="true" |
|
1871
9bb6518238ff
6795030: Files in langtools build can be compiled ignoring java.home settings
jjg
parents:
735
diff
changeset
|
499 |
executable="@{javac.java.home}/bin/javac" |
10 | 500 |
srcdir="@{gensrc.dir}" |
501 |
destdir="@{classes.dir}" |
|
502 |
includes="@{includes}" |
|
503 |
sourcepath="" |
|
504 |
includeAntRuntime="no" |
|
505 |
target="@{javac.target}"> |
|
506 |
<compilerarg value="-J-Xbootclasspath/p:@{javac.bootclasspath}"/> |
|
507 |
<compilerarg line="${javac.version.opt}"/> |
|
508 |
<compilerarg line="-Xlint"/> |
|
509 |
</javac> |
|
510 |
<javac fork="true" |
|
1871
9bb6518238ff
6795030: Files in langtools build can be compiled ignoring java.home settings
jjg
parents:
735
diff
changeset
|
511 |
executable="@{javac.java.home}/bin/javac" |
10 | 512 |
srcdir="${src.classes.dir}" |
513 |
destdir="@{classes.dir}" |
|
514 |
includes="@{includes}" |
|
515 |
excludes="@{excludes}" |
|
516 |
sourcepath="" |
|
517 |
includeAntRuntime="no" |
|
518 |
target="@{javac.target}" |
|
519 |
debug="${javac.debug}" |
|
520 |
debuglevel="${javac.debuglevel}"> |
|
521 |
<compilerarg value="-J-Xbootclasspath/p:@{javac.bootclasspath}"/> |
|
522 |
<compilerarg value="-Xbootclasspath/p:@{classes.dir}"/> |
|
523 |
<compilerarg line="${javac.no.jdk.warnings}"/> |
|
524 |
<compilerarg line="${javac.version.opt}"/> |
|
525 |
<compilerarg line="${javac.lint.opts}"/> |
|
526 |
</javac> |
|
527 |
<copy todir="@{classes.dir}"> |
|
528 |
<fileset dir="${src.classes.dir}"> |
|
529 |
<include name="@{includes}"/> |
|
530 |
<exclude name="**/*.java"/> |
|
531 |
<exclude name="**/*.properties"/> |
|
532 |
<exclude name="**/*-template"/> |
|
533 |
<exclude name="**/package.html"/> |
|
534 |
</fileset> |
|
535 |
</copy> |
|
536 |
</sequential> |
|
537 |
</macrodef> |
|
538 |
</target> |
|
539 |
||
540 |
<target name="-def-build-bootstrap-tool" depends="-check-boot.java.home,-def-build-tool"> |
|
541 |
<presetdef name="build-bootstrap-tool"> |
|
542 |
<build-tool |
|
543 |
javac.target="${boot.javac.target}" |
|
544 |
gensrc.dir="${build.bootstrap.dir}/gensrc" |
|
545 |
classes.dir="${build.bootstrap.dir}/classes" |
|
546 |
bin.dir="${build.bootstrap.dir}/bin" |
|
547 |
lib.dir="${build.bootstrap.dir}/lib" |
|
1872 | 548 |
java="${boot.java}" |
10 | 549 |
javac.bootclasspath="" |
550 |
release="${bootstrap.release}" |
|
551 |
full.version="${bootstrap.full.version}"/> |
|
552 |
</presetdef> |
|
553 |
</target> |
|
554 |
||
555 |
<target name="-def-build-bootstrap-jar" depends="-def-build-jar"> |
|
556 |
<presetdef name="build-bootstrap-jar"> |
|
557 |
<build-jar |
|
558 |
javac.target="${boot.javac.target}" |
|
559 |
gensrc.dir="${build.bootstrap.dir}/gensrc" |
|
560 |
classes.dir="${build.bootstrap.dir}/classes" |
|
561 |
lib.dir="${build.bootstrap.dir}/lib" |
|
562 |
javac.bootclasspath="" |
|
563 |
release="${bootstrap.release}" |
|
564 |
full.version="${bootstrap.full.version}"/> |
|
565 |
</presetdef> |
|
566 |
</target> |
|
567 |
||
568 |
<target name="-def-pcompile"> |
|
569 |
<mkdir dir="${build.toolclasses.dir}"/> |
|
1871
9bb6518238ff
6795030: Files in langtools build can be compiled ignoring java.home settings
jjg
parents:
735
diff
changeset
|
570 |
<javac fork="true" |
9bb6518238ff
6795030: Files in langtools build can be compiled ignoring java.home settings
jjg
parents:
735
diff
changeset
|
571 |
executable="${boot.java.home}/bin/javac" |
9bb6518238ff
6795030: Files in langtools build can be compiled ignoring java.home settings
jjg
parents:
735
diff
changeset
|
572 |
srcdir="${make.tools.dir}/CompileProperties" |
10 | 573 |
destdir="${build.toolclasses.dir}/" |
574 |
classpath="${ant.home}/lib/ant.jar"/> |
|
575 |
<taskdef name="pcompile" |
|
576 |
classname="CompilePropertiesTask" |
|
577 |
classpath="${build.toolclasses.dir}/"/> |
|
578 |
</target> |
|
579 |
||
580 |
<target name="-def-javadoc-tool" depends="-check-target.java.home"> |
|
581 |
<macrodef name="javadoc-tool"> |
|
582 |
<attribute name="name"/> |
|
583 |
<attribute name="includes"/> |
|
584 |
<attribute name="options" default=""/> |
|
585 |
<attribute name="source" default="1.5"/> <!-- FIXME --> |
|
586 |
<sequential> |
|
587 |
<property name="javadoc.options" value=""/> <!-- default, can be overridden per user or per project --> |
|
588 |
<!-- Note: even with this default value, includes |
|
589 |
from src.classes.dir get javadoc'd; see packageset below --> |
|
590 |
<property name="javadoc.packagenames" value="none"/> <!-- default, can be overridden per user or per project --> |
|
591 |
<javadoc |
|
592 |
executable="${target.java.home}/bin/javadoc" |
|
593 |
destdir="${build.javadoc.dir}/@{name}" |
|
594 |
source="@{source}" |
|
595 |
windowtitle="UNOFFICIAL" |
|
596 |
failonerror="true" |
|
597 |
use="true" |
|
598 |
author="false" |
|
599 |
version="false" |
|
600 |
packagenames="${javadoc.packagenames}" > |
|
601 |
<header><![CDATA[<strong>Unofficial Javadoc</strong> generated from developer sources for preview purposes only]]></header> |
|
602 |
<arg line="@{options}"/> |
|
603 |
<bootclasspath> |
|
604 |
<path location="${build.classes.dir}"/> |
|
605 |
<path location="${target.java.home}/jre/lib/rt.jar"/> |
|
606 |
</bootclasspath> |
|
607 |
<sourcepath> |
|
608 |
<pathelement location="${src.classes.dir}"/> |
|
609 |
</sourcepath> |
|
610 |
<!-- XXX just <fileset> (restricted further to **/*.java) and no <packageset> --> |
|
611 |
<!-- means that {@link some.package} will not work, which is no good. --> |
|
612 |
<!-- (It correctly skips excluded single classes, but not if packageset is also included, --> |
|
613 |
<!-- which also causes duplicates in the class index for included files.) --> |
|
614 |
<packageset dir="${src.classes.dir}" includes="@{includes}"> |
|
615 |
<or> |
|
616 |
<filename name="java/"/> |
|
617 |
<filename name="javax/"/> |
|
618 |
<filename name="com/sun/javadoc/"/> |
|
619 |
<filename name="com/sun/mirror/"/> |
|
620 |
<filename name="com/sun/source/"/> |
|
621 |
</or> |
|
622 |
</packageset> |
|
623 |
</javadoc> |
|
624 |
</sequential> |
|
625 |
</macrodef> |
|
626 |
</target> |
|
627 |
||
628 |
<target name="-def-jtreg" unless="jtreg.defined" depends="-check-jtreg.home"> |
|
629 |
<taskdef name="jtreg" classname="com.sun.javatest.regtest.Main$$Ant"> |
|
630 |
<classpath> |
|
631 |
<pathelement location="${jtreg.home}/lib/jtreg.jar"/> |
|
632 |
<pathelement location="${jtreg.home}/lib/javatest.jar"/> |
|
633 |
</classpath> |
|
634 |
</taskdef> |
|
635 |
<macrodef name="jtreg-tool"> |
|
636 |
<attribute name="name"/> |
|
637 |
<attribute name="tests"/> |
|
638 |
<attribute name="jdk" default="${target.java.home}"/> |
|
639 |
<attribute name="samevm" default="false"/> |
|
640 |
<attribute name="verbose" default="summary"/> |
|
641 |
<attribute name="options" default=""/> |
|
642 |
<attribute name="keywords" default="-keywords:!ignore"/> |
|
643 |
<attribute name="jpda.jvmargs" default=""/> |
|
644 |
<sequential> |
|
645 |
<property name="coverage.options" value=""/> <!-- default --> |
|
646 |
<property name="coverage.classpath" value=""/> <!-- default --> |
|
647 |
<jtreg |
|
648 |
dir="${test.dir}" |
|
649 |
workDir="${build.jtreg.dir}/@{name}/work" |
|
650 |
reportDir="${build.jtreg.dir}/@{name}/report" |
|
651 |
jdk="@{jdk}" |
|
652 |
samevm="@{samevm}" verbose="@{verbose}" |
|
653 |
failonerror="false" resultproperty="jtreg.@{name}.result" |
|
654 |
javacoptions="-g" |
|
655 |
vmoptions="${coverage.options} -Xbootclasspath/p:${coverage.classpath}:${build.classes.dir} @{jpda.jvmargs}"> |
|
656 |
<arg line="@{keywords}"/> |
|
657 |
<arg line="@{options}"/> |
|
658 |
<arg line="@{tests}"/> |
|
659 |
</jtreg> |
|
660 |
<!-- the next two properties are for convenience, when only |
|
661 |
a single instance of jtreg will be invoked. --> |
|
662 |
<condition property="jtreg.passed"> |
|
1873
658385834998
6795365: NetBeans projects in langtools repository are not NB6.5-friendly
jjg
parents:
1872
diff
changeset
|
663 |
<equals arg1="${jtreg.@{name}.result}" arg2="0"/> |
10 | 664 |
</condition> |
665 |
<property name="jtreg.report" value="${build.jtreg.dir}/@{name}/report"/> |
|
666 |
</sequential> |
|
667 |
</macrodef> |
|
668 |
<property name="jtreg.defined" value="true"/> |
|
669 |
</target> |
|
670 |
||
671 |
<target name="-def-cobertura" depends="-check-cobertura.home"> |
|
672 |
<path id="cobertura.classpath"> |
|
673 |
<fileset dir="${cobertura.home}"> |
|
674 |
<include name="cobertura.jar"/> |
|
675 |
<include name="lib/**/*.jar"/> |
|
676 |
</fileset> |
|
677 |
</path> |
|
678 |
<taskdef classpathref="cobertura.classpath" resource="tasks.properties"/> |
|
679 |
</target> |
|
680 |
||
681 |
<target name="-def-findbugs" unless="findbugs.defined" depends="-check-findbugs.home"> |
|
682 |
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"> |
|
683 |
<classpath> |
|
684 |
<pathelement location="${findbugs.home}/lib/findbugs.jar"/> |
|
685 |
</classpath> |
|
686 |
</taskdef> |
|
687 |
<macrodef name="findbugs-tool"> |
|
688 |
<attribute name="name"/> |
|
689 |
<attribute name="output" default="emacs"/> |
|
690 |
<attribute name="outputFile" default=""/> |
|
691 |
<attribute name="reportLevel" default="high"/> |
|
692 |
<sequential> |
|
693 |
<findbugs |
|
694 |
home="${findbugs.home}" |
|
695 |
output="@{output}" |
|
696 |
outputFile="@{outputFile}" |
|
697 |
reportLevel="@{reportLevel}" |
|
698 |
failOnError="false" |
|
699 |
errorProperty="findbugs.@{name}.errors" |
|
700 |
warningsProperty="findbugs.@{name}.warnings" |
|
701 |
jvmargs="-Xmx512M" > |
|
702 |
<class location="${dist.dir}/lib/@{name}.jar"/> |
|
703 |
<auxClasspath> |
|
704 |
<pathelement location="${build.classes.dir}"/> |
|
705 |
</auxClasspath> |
|
706 |
<sourcePath> |
|
707 |
<pathelement location="${src.classes.dir}"/> |
|
708 |
</sourcePath> |
|
709 |
</findbugs> |
|
710 |
</sequential> |
|
711 |
</macrodef> |
|
712 |
<property name="findbugs.defined" value="true"/> |
|
713 |
</target> |
|
714 |
||
715 |
<target name="-def-check"> |
|
716 |
<macrodef name="check"> |
|
717 |
<attribute name="name"/> |
|
718 |
<attribute name="property"/> |
|
719 |
<attribute name="marker"/> |
|
720 |
<sequential> |
|
721 |
<fail message="Cannot locate @{name}: please set @{property} to its location"> |
|
722 |
<condition> |
|
723 |
<not> |
|
724 |
<isset property="@{property}"/> |
|
725 |
</not> |
|
726 |
</condition> |
|
727 |
</fail> |
|
728 |
<fail message="@{name} is not installed in ${@{property}}"> |
|
729 |
<condition> |
|
730 |
<not> |
|
731 |
<available file="${@{property}}/@{marker}"/> |
|
732 |
</not> |
|
733 |
</condition> |
|
734 |
</fail> |
|
735 |
</sequential> |
|
736 |
</macrodef> |
|
737 |
</target> |
|
738 |
||
739 |
<!-- standard JDK target --> |
|
740 |
<target name="sanity" |
|
741 |
description="display settings of congiguration values"> |
|
742 |
<echo level="info">ant.home = ${ant.home}</echo> |
|
743 |
<echo level="info">boot.java.home = ${boot.java.home}</echo> |
|
744 |
<echo level="info">target.java.home = ${target.java.home}</echo> |
|
745 |
<echo level="info">jtreg.home = ${jtreg.home}</echo> |
|
746 |
<echo level="info">findbugs.home = ${findbugs.home}</echo> |
|
747 |
</target> |
|
748 |
||
749 |
<!-- useful debugging targets --> |
|
750 |
<target name="diagnostics"> |
|
751 |
<diagnostics/> |
|
752 |
</target> |
|
753 |
||
754 |
<target name="post-sanity" depends="-def-jtreg,sanity,build" |
|
755 |
description="perform basic validation after a standard build"> |
|
756 |
<jtreg |
|
757 |
dir="make/test" |
|
758 |
workDir="${build.jtreg.dir}/post-sanity/work" |
|
759 |
reportDir="${build.jtreg.dir}/post-sanity/report" |
|
760 |
jdk="${target.java.home}" |
|
761 |
verbose="summary" |
|
762 |
failonerror="false" resultproperty="jtreg.post-sanity.result"> |
|
763 |
</jtreg> |
|
764 |
||
765 |
</target> |
|
766 |
</project> |
|
767 |