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