source: trunk/openjdk/langtools/make/build.xml@ 6

Last change on this file since 6 was 2, checked in by dmik, 15 years ago

Imported OpenJDK 6 b19 sources from Oracle.

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