annotate langtools/make/build.xml @ 2212:1d3dc0e0ba0c

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