Fri, 12 Nov 2010 12:32:43 +0000
6598108: com.sun.source.util.Trees.isAccessible incorrect
Summary: JavacTrees' version of isAccessible should take into account enclosing class accessibility
Reviewed-by: jjg
duke@1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
duke@1 | 2 | <!-- |
ohair@554 | 3 | Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. |
duke@1 | 4 | DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@1 | 5 | |
duke@1 | 6 | This code is free software; you can redistribute it and/or modify it |
duke@1 | 7 | under the terms of the GNU General Public License version 2 only, as |
ohair@554 | 8 | published by the Free Software Foundation. Oracle designates this |
duke@1 | 9 | particular file as subject to the "Classpath" exception as provided |
ohair@554 | 10 | by Oracle in the LICENSE file that accompanied this code. |
duke@1 | 11 | |
duke@1 | 12 | This code is distributed in the hope that it will be useful, but WITHOUT |
duke@1 | 13 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@1 | 14 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@1 | 15 | version 2 for more details (a copy is included in the LICENSE file that |
duke@1 | 16 | accompanied this code). |
duke@1 | 17 | |
duke@1 | 18 | You should have received a copy of the GNU General Public License version |
duke@1 | 19 | 2 along with this work; if not, write to the Free Software Foundation, |
duke@1 | 20 | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@1 | 21 | |
ohair@554 | 22 | Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@554 | 23 | or visit www.oracle.com if you need additional information or have any |
ohair@554 | 24 | questions. |
duke@1 | 25 | --> |
duke@1 | 26 | |
duke@1 | 27 | <!-- |
jjg@579 | 28 | This is the main build file for the complete langtools repository. |
jjg@579 | 29 | It is used when building JDK (in which case it is invoked from the |
jjg@579 | 30 | Makefile), and it can be used when working on the tools themselves, |
jjg@579 | 31 | in an IDE such as NetBeans. |
jjg@579 | 32 | |
jjg@579 | 33 | External dependencies are specified via properties. These can be given |
jjg@579 | 34 | on the command line, or by providing a local build.properties file. |
jjg@579 | 35 | (They can also be edited into make/build.properties, although that is not |
jjg@579 | 36 | recommended.) At a minimum, boot.java.home must be set to the installed |
jjg@579 | 37 | location of the version of JDK used to build this repository. Additional |
jjg@579 | 38 | properties may be required, depending on the targets that are built. |
jjg@579 | 39 | For example, to run any of the jtreg tests you must set jtreg.home, |
jjg@579 | 40 | to run findbugs on the code you must set findbugs.home, and so on. |
jjg@579 | 41 | |
jjg@579 | 42 | For the most part, javac can be built using the previous version of JDK. |
jjg@579 | 43 | However, a small number of javac files require access to the latest JDK, |
jjg@579 | 44 | which may not yet have been compiled. To compile these files, you can do |
jjg@579 | 45 | one of the following: |
jjg@579 | 46 | - Set boot.java.home to a recent build of the latest version of JDK. |
jjg@579 | 47 | - Set import.jdk to either a recent build (containing jre/lib/rt.jar) |
jjg@579 | 48 | or to jdk source repository. In the latter case, stub files will |
jjg@579 | 49 | automatically be generated and used for the required API, to avoid |
jjg@579 | 50 | unnecessary compilation of the source repository. |
jjg@579 | 51 | If you do neither, the relevant files will not be built. |
jjg@579 | 52 | |
jjg@579 | 53 | The main build happens in two phases: |
jjg@579 | 54 | - First, javac and other tools as needed are built using ${boot.java.home}. |
jjg@579 | 55 | (This implies a constraint on the source code that they can be compiled |
jjg@579 | 56 | with the previous version of JDK. |
jjg@579 | 57 | - Second, all required classes are compiled with the latest javac, created |
jjg@579 | 58 | in the previous step. |
jjg@579 | 59 | The first phase is called the bootstrap phase. All targets, properties and |
jjg@579 | 60 | tasks that are specific to that phase have "bootstrap" in their name. |
jjg@579 | 61 | |
jjg@579 | 62 | For more details on the JDK build, see |
jjg@579 | 63 | http://blogs.sun.com/kto/entry/anatomy_of_the_jdk_build |
jjg@579 | 64 | http://openjdk.java.net/groups/build/ |
jjg@579 | 65 | For more details on the stub generator, see |
jjg@579 | 66 | http://blogs.sun.com/jjg/entry/building_javac_for_jdk7 |
jjg@579 | 67 | |
jjg@579 | 68 | Internal details ... |
jjg@579 | 69 | |
jjg@579 | 70 | Interim build products are created in the build/ directory. |
jjg@579 | 71 | Final build products are created in the dist/ directory. |
jjg@579 | 72 | When building JDK, the dist/directory will contain: |
jjg@579 | 73 | - A bootstrap compiler suitable for running with ${boot.java.home} |
jjg@579 | 74 | suitable for compiling downstream parts of JDK |
jjg@579 | 75 | - Source files and class files for inclusion in the JDK being built |
jjg@579 | 76 | When building standalone, the dist/directory will contain: |
jjg@579 | 77 | - Separate jar files for each of the separate langtools components |
jjg@579 | 78 | - Simple scripts to invoke the tools by executing the corresponding |
jjg@579 | 79 | jar files. |
jjg@579 | 80 | These jar files and scripts are "for developer use only". |
jjg@579 | 81 | |
jjg@579 | 82 | This file is organized into sections as follows: |
jjg@579 | 83 | - global property definitions |
jjg@579 | 84 | - general top level targets |
jjg@579 | 85 | - general diagnostic/debugging targets |
jjg@579 | 86 | - groups of targets for each tool: javac, javadoc, doclets, javah, javap, apt |
jjg@579 | 87 | Within each group, the following targets are provided, where applicable |
jjg@579 | 88 | build-bootstrap-TOOL build the bootstrap version of the tool |
jjg@579 | 89 | build-classes-TOOL build the classes for the tool |
jjg@579 | 90 | build-TOOL build the jar file and script for the tool |
jjg@579 | 91 | jtreg-TOOL build the tool and run the appropriate tests |
jjg@579 | 92 | findbugs-TOOL run findbugs on the tool's source oode |
jjg@579 | 93 | TOOL build the tool, run the tests, and run findbugs |
jjg@579 | 94 | - utility definitions |
duke@1 | 95 | --> |
duke@1 | 96 | |
duke@1 | 97 | <project name="langtools" default="build" basedir=".."> |
jjg@579 | 98 | <!-- |
jjg@579 | 99 | **** Global property definitions. |
jjg@579 | 100 | --> |
jjg@371 | 101 | |
aph@273 | 102 | <!-- Force full debuginfo for javac if the debug.classfiles |
aph@273 | 103 | property is set. This must be BEFORE the include of |
aph@273 | 104 | build.properties because it sets javac.debuglevel. --> |
aph@273 | 105 | <condition property="javac.debuglevel" value="source,lines,vars"> |
aph@273 | 106 | <equals arg1="${debug.classfiles}" arg2="true"/> |
aph@273 | 107 | </condition> |
aph@273 | 108 | |
duke@1 | 109 | <!-- The following locations can be used to override default property values. --> |
duke@1 | 110 | |
duke@1 | 111 | <!-- Use this location for customizations specific to this instance of this workspace --> |
duke@1 | 112 | <property file="build.properties"/> |
duke@1 | 113 | |
duke@1 | 114 | <!-- Use this location for customizations common to all OpenJDK langtools workspaces --> |
duke@1 | 115 | <property file="${user.home}/.openjdk/${ant.project.name}-build.properties"/> |
duke@1 | 116 | |
duke@1 | 117 | <!-- Use this location for customizations common to all OpenJDK workspaces --> |
duke@1 | 118 | <property file="${user.home}/.openjdk/build.properties"/> |
jjg@371 | 119 | |
jjg@371 | 120 | <!-- Convenient shorthands for standard locations within the workspace. --> |
duke@1 | 121 | <property name="build.dir" location="build"/> |
duke@1 | 122 | <property name="build.bootstrap.dir" location="${build.dir}/bootstrap"/> |
duke@1 | 123 | <property name="build.coverage.dir" location="${build.dir}/coverage"/> |
duke@1 | 124 | <property name="build.classes.dir" location="${build.dir}/classes"/> |
duke@1 | 125 | <property name="build.gensrc.dir" location="${build.dir}/gensrc"/> |
jjg@441 | 126 | <property name="build.genstubs.dir" location="${build.dir}/genstubs"/> |
duke@1 | 127 | <property name="build.javadoc.dir" location="${build.dir}/javadoc"/> |
duke@1 | 128 | <property name="build.jtreg.dir" location="${build.dir}/jtreg"/> |
duke@1 | 129 | <property name="build.toolclasses.dir" location="${build.dir}/toolclasses"/> |
duke@1 | 130 | <property name="dist.dir" location="dist"/> |
duke@1 | 131 | <property name="dist.bin.dir" location="${dist.dir}/bin"/> |
duke@1 | 132 | <property name="dist.coverage.dir" location="${dist.dir}/coverage"/> |
duke@1 | 133 | <property name="dist.findbugs.dir" location="${dist.dir}/findbugs"/> |
duke@1 | 134 | <property name="dist.lib.dir" location="${dist.dir}/lib"/> |
duke@1 | 135 | <property name="make.dir" location="make"/> |
duke@1 | 136 | <property name="make.tools.dir" location="${make.dir}/tools"/> |
duke@1 | 137 | <property name="src.dir" location="src"/> |
duke@1 | 138 | <property name="src.bin.dir" location="${src.dir}/share/bin"/> |
duke@1 | 139 | <property name="src.classes.dir" location="${src.dir}/share/classes"/> |
duke@1 | 140 | <property name="test.dir" location="test"/> |
duke@1 | 141 | |
duke@1 | 142 | <!-- java.marker is set to a marker file to check for within a Java install dir. |
duke@1 | 143 | The best file to check for across Solaris/Linux/Windows/MacOS is one of the |
duke@1 | 144 | executables; regrettably, that is OS-specific. --> |
duke@1 | 145 | <condition property="java.marker" value="bin/java"> |
jjg@371 | 146 | <os family="unix"/> |
duke@1 | 147 | </condition> |
duke@1 | 148 | <condition property="java.marker" value="bin/java.exe"> |
jjg@371 | 149 | <os family="windows"/> |
duke@1 | 150 | </condition> |
jjg@371 | 151 | |
duke@1 | 152 | <!-- Standard property values, if not overriden by earlier settings. --> |
jjg@371 | 153 | <property file="${make.dir}/build.properties"/> |
jjg@370 | 154 | |
jjg@370 | 155 | <!-- launcher.java is used in the launcher scripts provided to run |
jjg@371 | 156 | the tools' jar files. If it has not already been set, then |
jjg@371 | 157 | default it to use ${target.java.home}, if available, otherwise |
jjg@371 | 158 | quietly default to simply use "java". --> |
jjg@371 | 159 | <condition property="launcher.java" |
jjg@371 | 160 | value="${target.java.home}/bin/java" else="java"> |
jjg@371 | 161 | <isset property="target.java.home"/> |
jjg@370 | 162 | </condition> |
jjg@370 | 163 | |
jjg@441 | 164 | <!-- Logic for handling access import jdk classes, if available. |
jjg@441 | 165 | import.jdk should be unset, or set to jdk home (to use rt.jar) |
jjg@441 | 166 | or to jdk repo (to use src/share/classes). |
jjg@441 | 167 | Based on the value, if any, set up default values for javac's sourcepath, |
jjg@450 | 168 | classpath and bootclasspath. Note: the default values are overridden |
jjg@441 | 169 | in the build-bootstrap-classes macro. --> |
jjg@441 | 170 | |
jjg@441 | 171 | <available property="import.jdk.src.dir" value="${import.jdk}/src/share/classes" |
jjg@441 | 172 | filepath="${import.jdk}/src/share/classes" file="java/nio/file/Path.java"/> |
jjg@441 | 173 | <available property="import.jdk.jar" value="${import.jdk}/jre/lib/rt.jar" |
jjg@441 | 174 | ignoresystemclasses="true" |
jjg@441 | 175 | classpath="${import.jdk}/jre/lib/rt.jar" classname="java.nio.file.Path"/> |
jjg@441 | 176 | |
jjg@579 | 177 | <!-- Set the default bootclasspath option used for javac. |
jjg@579 | 178 | Note that different variants of the option are used, meaning we can't just |
jjg@579 | 179 | define the value for the option. |
jjg@579 | 180 | Note the explicit use of the standard property ${path.separator} in the following. |
jjg@579 | 181 | This is because Ant is not clever enough to handle direct use of : or ; --> |
jjg@441 | 182 | <condition property="javac.bootclasspath.opt" |
jjg@463 | 183 | value="-Xbootclasspath:${build.classes.dir}${path.separator}${import.jdk.jar}" |
jjg@441 | 184 | else="-Xbootclasspath/p:${build.classes.dir}"> |
jjg@441 | 185 | <isset property="import.jdk.jar"/> |
jjg@441 | 186 | </condition> |
jjg@441 | 187 | |
jjg@579 | 188 | <condition property="boot.java.provides.latest.jdk"> |
jjg@579 | 189 | <available |
jjg@579 | 190 | ignoresystemclasses="true" |
jjg@579 | 191 | classpath="${boot.java.home}/jre/lib/rt.jar" classname="java.nio.file.Path"/> |
jjg@441 | 192 | </condition> |
jjg@441 | 193 | |
jjg@579 | 194 | <condition property="bootstrap.exclude.files" value="" else="${require.latest.jdk.files}"> |
jjg@579 | 195 | <isset property="boot.java.provides.latest.jdk"/> |
jjg@579 | 196 | </condition> |
jjg@579 | 197 | |
jjg@579 | 198 | <condition property="exclude.files" value="" else="${require.latest.jdk.files}"> |
jjg@579 | 199 | <or> |
jjg@579 | 200 | <isset property="boot.java.provides.latest.jdk"/> |
jjg@579 | 201 | <isset property="import.jdk"/> |
jjg@579 | 202 | </or> |
jjg@579 | 203 | </condition> |
jjg@579 | 204 | |
jjg@579 | 205 | <condition property="require.import.jdk.stubs"> |
jjg@579 | 206 | <and> |
jjg@579 | 207 | <not> |
jjg@579 | 208 | <isset property="boot.java.provides.latest.jdk"/> |
jjg@579 | 209 | </not> |
jjg@579 | 210 | <isset property="import.jdk.src.dir"/> |
jjg@579 | 211 | </and> |
jjg@579 | 212 | </condition> |
jjg@579 | 213 | |
jjg@579 | 214 | <!-- Set the default value of the sourcepath used for javac. --> |
jjg@579 | 215 | <condition property="javac.sourcepath" value="${build.genstubs.dir}" else=""> |
jjg@579 | 216 | <isset property="require.import.jdk.stubs"/> |
jjg@579 | 217 | </condition> |
jjg@579 | 218 | |
jjg@579 | 219 | <!-- Set the default value of the classpath used for javac. --> |
jjg@579 | 220 | <property name="javac.classpath" value=""/> |
jjg@579 | 221 | |
jjg@579 | 222 | |
jjg@579 | 223 | <!-- |
jjg@579 | 224 | **** General top level targets. |
jjg@579 | 225 | --> |
jjg@371 | 226 | |
duke@1 | 227 | <!-- Standard target to build deliverables for JDK build. --> |
duke@1 | 228 | |
duke@1 | 229 | <target name="build" depends="build-bootstrap-tools,build-all-classes"> |
duke@1 | 230 | <copy todir="${dist.dir}/bootstrap"> |
duke@1 | 231 | <fileset dir="${build.bootstrap.dir}" includes="bin/,lib/"/> |
duke@1 | 232 | </copy> |
duke@1 | 233 | <chmod dir="${dist.dir}/bootstrap/bin" perm="ugo+rx"> |
duke@1 | 234 | <include name="*"/> |
duke@1 | 235 | </chmod> |
duke@1 | 236 | <mkdir dir="${dist.lib.dir}"/> |
duke@1 | 237 | <jar file="${dist.lib.dir}/classes.jar" basedir="${build.classes.dir}"/> |
duke@1 | 238 | <zip file="${dist.lib.dir}/src.zip" basedir="${src.classes.dir}"/> |
duke@1 | 239 | </target> |
jjg@371 | 240 | |
jjg@441 | 241 | <target name="build-bootstrap-tools" |
jjg@441 | 242 | depends="build-bootstrap-javac,build-bootstrap-javadoc,build-bootstrap-doclets,build-bootstrap-javah" |
jjg@441 | 243 | /> |
jjg@371 | 244 | |
jjg@441 | 245 | <target name="build-all-tools" |
jjg@441 | 246 | depends="build-javac,build-javadoc,build-doclets,build-javah,build-javap,build-apt" |
jjg@441 | 247 | /> |
jjg@371 | 248 | |
jjg@441 | 249 | <target name="build-all-classes" depends="build-bootstrap-javac,-create-import-jdk-stubs"> |
jjg@436 | 250 | <build-classes includes="${javac.includes} ${javadoc.includes} ${doclets.includes} ${javah.includes} ${javap.includes} ${apt.includes}"/> |
jjg@436 | 251 | </target> |
jjg@371 | 252 | |
duke@1 | 253 | <!-- clean --> |
duke@1 | 254 | |
duke@1 | 255 | <target name="clean" description="Delete all generated files"> |
duke@1 | 256 | <delete dir="${build.dir}"/> |
duke@1 | 257 | <delete dir="${dist.dir}"/> |
duke@1 | 258 | </target> |
duke@1 | 259 | |
duke@1 | 260 | <!-- Additional targets for running tools on the build --> |
duke@1 | 261 | |
jjg@371 | 262 | <target name="jtreg" depends="build-all-tools,-def-jtreg"> |
jjg@371 | 263 | <jtreg-tool name="all" tests="${jtreg.tests}"/> |
jjg@371 | 264 | </target> |
jjg@371 | 265 | |
duke@1 | 266 | <target name="findbugs" depends="-def-findbugs,build-all-tools"> |
duke@1 | 267 | <property name="findbugs.reportLevel" value="medium"/> |
duke@1 | 268 | <mkdir dir="${dist.findbugs.dir}"/> |
duke@1 | 269 | <findbugs |
duke@1 | 270 | home="${findbugs.home}" |
duke@1 | 271 | projectName="JDK langtools ${full.version}" |
duke@1 | 272 | output="xml" |
duke@1 | 273 | outputFile="${dist.findbugs.dir}/findbugs.xml" |
duke@1 | 274 | reportLevel="${findbugs.reportLevel}" |
duke@1 | 275 | failOnError="false" |
duke@1 | 276 | errorProperty="findbugs.all.errors" |
duke@1 | 277 | warningsProperty="findbugs.all.warnings" |
jjg@681 | 278 | jvm="${target.java.home}/bin/java" |
duke@1 | 279 | jvmargs="-Xmx512M"> |
duke@1 | 280 | <class location="${build.classes.dir}"/> |
duke@1 | 281 | <sourcePath> |
duke@1 | 282 | <pathelement location="${src.classes.dir}"/> |
duke@1 | 283 | </sourcePath> |
duke@1 | 284 | </findbugs> |
duke@1 | 285 | <exec executable="sh"> |
duke@1 | 286 | <arg value="${findbugs.home}/bin/convertXmlToText"/> |
duke@1 | 287 | <arg value="-longBugCodes"/> |
duke@1 | 288 | <arg value="-html:${findbugs.home}/src/xsl/fancy.xsl"/> |
duke@1 | 289 | <arg value="${dist.findbugs.dir}/findbugs.xml"/> |
duke@1 | 290 | <redirector output="${dist.findbugs.dir}/findbugs.html"/> |
jjg@46 | 291 | </exec> |
duke@1 | 292 | </target> |
duke@1 | 293 | |
duke@1 | 294 | <target name="coverage" depends="-def-cobertura,build-all-classes,instrument-classes,jtreg,coverage-report"/> |
duke@1 | 295 | |
duke@1 | 296 | <target name="instrument-classes" depends="-def-cobertura"> |
duke@1 | 297 | <!-- only define the following property when we want coverage info --> |
duke@1 | 298 | <path id="coverage.classpath"> |
duke@1 | 299 | <pathelement location="${build.coverage.dir}/classes"/> |
duke@1 | 300 | <path refid="cobertura.classpath"/> |
duke@1 | 301 | </path> |
duke@1 | 302 | <property name="coverage.options" value="-Dnet.sourceforge.cobertura.datafile=${build.coverage.dir}/cobertura.ser"/> |
duke@1 | 303 | <property name="coverage.classpath" refid="coverage.classpath"/> |
duke@1 | 304 | <mkdir dir="${build.coverage.dir}/classes"/> |
duke@1 | 305 | <delete file="${build.coverage.dir}/cobertura.ser"/> |
duke@1 | 306 | <cobertura-instrument todir="${build.coverage.dir}/classes" |
duke@1 | 307 | datafile="${build.coverage.dir}/cobertura.ser"> |
jjg@371 | 308 | <fileset dir="${build.classes.dir}" |
duke@1 | 309 | includes="**/*.class" excludes="**/resources/*.class"/> |
duke@1 | 310 | </cobertura-instrument> |
jjg@371 | 311 | </target> |
duke@1 | 312 | |
duke@1 | 313 | <target name="coverage-report" depends="-def-cobertura"> |
duke@1 | 314 | <mkdir dir="${dist.coverage.dir}"/> |
jjg@371 | 315 | <cobertura-report |
duke@1 | 316 | srcdir="${src.classes.dir}" |
duke@1 | 317 | destdir="${dist.coverage.dir}" |
duke@1 | 318 | datafile="${build.coverage.dir}/cobertura.ser"/> |
jjg@371 | 319 | <cobertura-report |
jjg@371 | 320 | format="xml" |
jjg@371 | 321 | srcdir="${src.classes.dir}" |
duke@1 | 322 | destdir="${dist.coverage.dir}" |
duke@1 | 323 | datafile="${build.coverage.dir}/cobertura.ser"/> |
duke@1 | 324 | </target> |
jjg@371 | 325 | |
jjg@610 | 326 | <target name="diags-examples" depends="build-javac"> |
jjg@610 | 327 | <!-- can override the following on the command line if desired. --> |
jjg@610 | 328 | <property name="diags.examples.out" location="${build.dir}/diag-examples/diags-examples.html"/> |
jjg@610 | 329 | <mkdir dir="${build.dir}/diag-examples/classes"/> |
jjg@610 | 330 | <javac fork="true" |
jjg@610 | 331 | executable="${dist.bin.dir}/javac" |
jjg@610 | 332 | srcdir="test/tools/javac/diags" |
jjg@610 | 333 | destdir="${build.dir}/diag-examples/classes" |
jjg@610 | 334 | includes="Example.java,FileManager.java,HTMLWriter.java,RunExamples.java" |
jjg@610 | 335 | sourcepath="" |
jjg@610 | 336 | classpath="${dist.lib.dir}/javac.jar" |
jjg@610 | 337 | includeAntRuntime="no" |
jjg@610 | 338 | debug="${javac.debug}" |
jjg@610 | 339 | debuglevel="${javac.debuglevel}"/> |
jjg@610 | 340 | <java fork="true" |
jjg@610 | 341 | jvm="${target.java.home}/bin/java" |
jjg@610 | 342 | dir="test/tools/javac/diags" |
jjg@610 | 343 | classpath="${build.dir}/diag-examples/classes;${dist.lib.dir}/javac.jar" |
jjg@610 | 344 | classname="RunExamples"> |
jjg@610 | 345 | <arg value="-examples"/> |
jjg@610 | 346 | <arg value="examples"/> |
jjg@610 | 347 | <arg value="-o"/> |
jjg@610 | 348 | <arg file="${diags.examples.out}"/> |
jjg@610 | 349 | <arg value="-showFiles"/> |
jjg@610 | 350 | <arg value="-title"/> |
jjg@610 | 351 | <arg value="Examples of javac diagnostics"/> |
jjg@610 | 352 | </java> |
jjg@610 | 353 | </target> |
jjg@610 | 354 | |
jjg@579 | 355 | |
jjg@579 | 356 | <!-- |
jjg@579 | 357 | **** Debugging/diagnostic targets. |
jjg@579 | 358 | --> |
jjg@579 | 359 | |
jjg@579 | 360 | <!-- standard JDK target --> |
jjg@579 | 361 | <target name="sanity" |
jjg@579 | 362 | description="display settings of configuration values"> |
jjg@579 | 363 | <echo level="info">ant.home = ${ant.home}</echo> |
jjg@579 | 364 | <echo level="info">boot.java.home = ${boot.java.home}</echo> |
jjg@579 | 365 | <echo level="info">target.java.home = ${target.java.home}</echo> |
jjg@579 | 366 | <echo level="info">jtreg.home = ${jtreg.home}</echo> |
jjg@579 | 367 | <echo level="info">findbugs.home = ${findbugs.home}</echo> |
jjg@579 | 368 | </target> |
jjg@579 | 369 | |
jjg@579 | 370 | <target name="post-sanity" depends="-def-jtreg,sanity,build" |
jjg@579 | 371 | description="perform basic validation after a standard build"> |
jjg@579 | 372 | <jtreg |
jjg@579 | 373 | dir="make/test" |
jjg@579 | 374 | workDir="${build.jtreg.dir}/post-sanity/work" |
jjg@579 | 375 | reportDir="${build.jtreg.dir}/post-sanity/report" |
jjg@579 | 376 | jdk="${target.java.home}" |
jjg@579 | 377 | verbose="summary" |
jjg@579 | 378 | failonerror="false" resultproperty="jtreg.post-sanity.result"> |
jjg@579 | 379 | </jtreg> |
jjg@579 | 380 | </target> |
jjg@579 | 381 | |
jjg@579 | 382 | <!-- use vizant tool to generate graphical image of this Ant file.--> |
jjg@579 | 383 | <target name="vizant" depends="-def-vizant"> |
jjg@579 | 384 | <mkdir dir="${build.dir}"/> |
jjg@579 | 385 | <echo message="Generating ${build.dir}/build.dot"/> |
jjg@579 | 386 | <vizant antfile="${make.dir}/build.xml" outfile="${build.dir}/build.dot"/> |
jjg@579 | 387 | <echo message="Generating ${build.dir}/build.png"/> |
jjg@579 | 388 | <exec executable="${dot}" > |
jjg@579 | 389 | <arg value="-Tpng"/> |
jjg@579 | 390 | <arg value="-o"/> |
jjg@579 | 391 | <arg file="${build.dir}/build.png"/> |
jjg@579 | 392 | <arg file="${build.dir}/build.dot"/> |
jjg@579 | 393 | </exec> |
jjg@579 | 394 | </target> |
jjg@579 | 395 | |
jjg@579 | 396 | <target name="check-import.jdk"> |
jjg@579 | 397 | <echo message="import.jdk: ${import.jdk}"/> |
jjg@579 | 398 | <echo message="import.jdk.jar: ${import.jdk.jar}"/> |
jjg@579 | 399 | <echo message="import.jdk.src.dir: ${import.jdk.src.dir}"/> |
jjg@579 | 400 | </target> |
jjg@579 | 401 | |
jjg@579 | 402 | <target name="diagnostics"> |
jjg@579 | 403 | <diagnostics/> |
jjg@579 | 404 | </target> |
jjg@579 | 405 | |
jjg@579 | 406 | |
jjg@579 | 407 | <!-- |
jjg@579 | 408 | **** javac targets. |
jjg@579 | 409 | --> |
duke@1 | 410 | |
jjg@436 | 411 | <target name="build-bootstrap-javac" |
jjg@436 | 412 | depends="-def-build-bootstrap-classes,-def-build-bootstrap-jar,-def-build-bootstrap-tool"> |
jjg@436 | 413 | <build-bootstrap-classes includes="${javac.includes}"/> |
jjg@436 | 414 | <build-bootstrap-jar name="javac" includes="${javac.includes}"/> |
jjg@436 | 415 | <build-bootstrap-tool name="javac"/> |
duke@1 | 416 | </target> |
jjg@371 | 417 | |
jjg@441 | 418 | <target name="build-classes-javac" depends="build-bootstrap-javac,-create-import-jdk-stubs"> |
jjg@436 | 419 | <build-classes includes="${javac.includes}"/> |
duke@1 | 420 | </target> |
jjg@371 | 421 | |
jjg@436 | 422 | <target name="build-javac" depends="build-classes-javac"> |
jjg@436 | 423 | <build-jar name="javac" includes="${javac.includes}"/> |
jjg@436 | 424 | <build-tool name="javac"/> |
duke@1 | 425 | </target> |
jjg@371 | 426 | |
duke@1 | 427 | <target name="javadoc-javac" depends="build-javac,-def-javadoc-tool"> |
duke@1 | 428 | <javadoc-tool name="javac" includes="${javac.includes}" options="${javadoc.jls3.option}"/> |
duke@1 | 429 | </target> |
jjg@371 | 430 | |
jjg@436 | 431 | <target name="jtreg-javac" depends="build-javac,build-javap,-def-jtreg"> |
jjg@371 | 432 | <jtreg-tool name="javac" tests="${javac.tests}"/> |
duke@1 | 433 | </target> |
jjg@371 | 434 | |
duke@1 | 435 | <target name="findbugs-javac" depends="build-javac,-def-findbugs"> |
duke@1 | 436 | <findbugs-tool name="javac"/> |
duke@1 | 437 | </target> |
jjg@371 | 438 | |
duke@1 | 439 | <target name="javac" depends="build-javac,jtreg-javac,findbugs-javac"/> |
jjg@371 | 440 | |
jjg@579 | 441 | |
jjg@579 | 442 | <!-- |
jjg@579 | 443 | **** javadoc targets. |
jjg@579 | 444 | --> |
duke@1 | 445 | |
duke@1 | 446 | <target name="build-bootstrap-javadoc" depends="build-bootstrap-javac"> |
jjg@436 | 447 | <build-bootstrap-classes includes="${javadoc.includes}"/> |
jjg@436 | 448 | <build-bootstrap-jar name="javadoc" includes="${javadoc.includes}" |
jjg@436 | 449 | jarclasspath="javac.jar doclets.jar"/> |
jjg@436 | 450 | <build-bootstrap-tool name="javadoc"/> |
duke@1 | 451 | </target> |
jjg@371 | 452 | |
duke@1 | 453 | <target name="build-classes-javadoc" depends="build-classes-javac"> |
jjg@436 | 454 | <build-classes includes="${javadoc.includes}"/> |
duke@1 | 455 | </target> |
jjg@371 | 456 | |
jjg@436 | 457 | <target name="build-javadoc" depends="build-javac,build-classes-javadoc"> |
jjg@436 | 458 | <build-jar name="javadoc" includes="${javadoc.includes}" |
duke@1 | 459 | jarclasspath="javac.jar doclets.jar"/> |
jjg@436 | 460 | <build-tool name="javadoc"/> |
duke@1 | 461 | </target> |
jjg@371 | 462 | |
duke@1 | 463 | <target name="javadoc-javadoc" depends="build-javadoc,-def-javadoc-tool"> |
duke@1 | 464 | <javadoc-tool name="javadoc" includes="${javadoc.includes}"/> |
duke@1 | 465 | </target> |
jjg@371 | 466 | |
duke@1 | 467 | <target name="jtreg-javadoc" depends="build-javadoc,-def-jtreg"> |
jjg@371 | 468 | <jtreg-tool name="javadoc" tests="${javadoc.tests}"/> |
duke@1 | 469 | </target> |
jjg@371 | 470 | |
duke@1 | 471 | <target name="findbugs-javadoc" depends="build-javadoc,-def-findbugs"> |
duke@1 | 472 | <findbugs-tool name="javadoc"/> |
duke@1 | 473 | </target> |
jjg@371 | 474 | |
duke@1 | 475 | <target name="javadoc" depends="build-javadoc,jtreg-javadoc,findbugs-javadoc"/> |
jjg@371 | 476 | |
jjg@579 | 477 | |
jjg@579 | 478 | <!-- |
jjg@579 | 479 | **** doclets targets. |
jjg@579 | 480 | --> |
duke@1 | 481 | |
duke@1 | 482 | <target name="build-bootstrap-doclets" depends="build-bootstrap-javadoc,-def-build-bootstrap-jar"> |
jjg@436 | 483 | <build-bootstrap-classes includes="${doclets.includes}"/> |
jjg@436 | 484 | <build-bootstrap-jar name="doclets" includes="${doclets.includes}" |
jjg@436 | 485 | jarmainclass="com.sun.tools.javadoc.Main" |
jjg@436 | 486 | jarclasspath="javadoc.jar"/> |
duke@1 | 487 | </target> |
jjg@371 | 488 | |
duke@1 | 489 | <target name="build-classes-doclets" depends="build-classes-javadoc"> |
jjg@436 | 490 | <build-classes includes="${doclets.includes}"/> |
duke@1 | 491 | </target> |
jjg@371 | 492 | |
jjg@436 | 493 | <target name="build-doclets" depends="build-javadoc,build-classes-doclets"> |
duke@1 | 494 | <!-- just jar, no bin for doclets --> |
jjg@436 | 495 | <build-jar name="doclets" includes="${doclets.includes}" jarclasspath="javadoc.jar"/> |
duke@1 | 496 | </target> |
duke@1 | 497 | |
duke@1 | 498 | <!-- (no javadoc for doclets) --> |
jjg@371 | 499 | |
duke@1 | 500 | <target name="jtreg-doclets" depends="build-doclets,-def-jtreg"> |
jjg@371 | 501 | <jtreg-tool name="doclets" tests="${doclets.tests}"/> |
duke@1 | 502 | </target> |
jjg@371 | 503 | |
duke@1 | 504 | <target name="findbugs-doclets" depends="build-doclets,-def-findbugs"> |
duke@1 | 505 | <findbugs-tool name="doclets"/> |
duke@1 | 506 | </target> |
jjg@371 | 507 | |
duke@1 | 508 | <target name="doclets" depends="build-doclets,jtreg-doclets,findbugs-doclets"/> |
jjg@371 | 509 | |
jjg@579 | 510 | |
jjg@579 | 511 | <!-- |
jjg@579 | 512 | **** javah targets. |
jjg@579 | 513 | --> |
duke@1 | 514 | |
duke@1 | 515 | <target name="build-bootstrap-javah" depends="build-bootstrap-javadoc"> |
jjg@436 | 516 | <build-bootstrap-classes includes="${javah.includes}"/> |
jjg@436 | 517 | <build-bootstrap-jar name="javah" includes="${javah.includes}" |
jjg@436 | 518 | jarclasspath="javadoc.jar doclets.jar javac.jar"/> |
jjg@436 | 519 | <build-bootstrap-tool name="javah"/> |
duke@1 | 520 | </target> |
jjg@371 | 521 | |
jjg@436 | 522 | <target name="build-javah" depends="build-javac,build-classes-javah"> |
jjg@436 | 523 | <build-jar name="javah" includes="${javah.includes}" jarclasspath="javac.jar"/> |
jjg@436 | 524 | <build-tool name="javah"/> |
duke@1 | 525 | </target> |
jjg@371 | 526 | |
duke@1 | 527 | <target name="build-classes-javah" depends="build-classes-javadoc"> |
jjg@436 | 528 | <build-classes includes="${javah.includes}"/> |
duke@1 | 529 | </target> |
jjg@371 | 530 | |
duke@1 | 531 | <!-- (no javadoc for javah) --> |
duke@1 | 532 | |
duke@1 | 533 | <target name="jtreg-javah" depends="build-javah,-def-jtreg"> |
jjg@371 | 534 | <jtreg-tool name="javah" tests="${javah.tests}"/> |
duke@1 | 535 | </target> |
jjg@371 | 536 | |
duke@1 | 537 | <target name="findbugs-javah" depends="build-javah,-def-findbugs"> |
duke@1 | 538 | <findbugs-tool name="javah"/> |
duke@1 | 539 | </target> |
jjg@371 | 540 | |
duke@1 | 541 | <target name="javah" depends="build-javah,jtreg-javah,findbugs-javah"/> |
jjg@371 | 542 | |
jjg@579 | 543 | |
jjg@579 | 544 | <!-- |
jjg@579 | 545 | **** javap targets. |
jjg@579 | 546 | --> |
duke@1 | 547 | |
jjg@436 | 548 | <target name="build-bootstrap-javap" |
jjg@436 | 549 | depends="-def-build-bootstrap-classes,-def-build-bootstrap-jar,-def-build-bootstrap-tool"> |
jjg@436 | 550 | <build-bootstrap-classes includes="${javap.includes}"/> |
jjg@436 | 551 | <build-bootstrap-jar name="javap" includes="${javap.includes}" |
jjg@436 | 552 | jarmainclass="sun.tools.javap.Main"/> |
jjg@436 | 553 | <build-bootstrap-tool name="javap"/> |
duke@1 | 554 | </target> |
jjg@371 | 555 | |
jjg@46 | 556 | <target name="build-classes-javap" depends="build-classes-javac"> |
jjg@436 | 557 | <build-classes includes="${javap.includes}"/> |
duke@1 | 558 | </target> |
jjg@371 | 559 | |
jjg@436 | 560 | <target name="build-javap" depends="build-javac,build-classes-javap"> |
jjg@436 | 561 | <build-jar name="javap" includes="${javap.includes}" |
jjg@291 | 562 | jarmainclass="com.sun.tools.javap.Main" |
jjg@46 | 563 | jarclasspath="javac.jar"/> |
jjg@436 | 564 | <build-tool name="javap"/> |
duke@1 | 565 | </target> |
jjg@371 | 566 | |
duke@1 | 567 | <!-- (no javadoc for javap) --> |
duke@1 | 568 | |
duke@1 | 569 | <target name="jtreg-javap" depends="build-javap,-def-jtreg"> |
jjg@371 | 570 | <jtreg-tool name="javap" tests="${javap.tests}"/> |
duke@1 | 571 | </target> |
jjg@371 | 572 | |
duke@1 | 573 | <target name="findbugs-javap" depends="build-javap,-def-findbugs"> |
duke@1 | 574 | <findbugs-tool name="javap"/> |
duke@1 | 575 | </target> |
jjg@371 | 576 | |
duke@1 | 577 | <target name="javap" depends="build-javap,jtreg-javap,findbugs-javap"/> |
jjg@371 | 578 | |
jjg@579 | 579 | |
jjg@579 | 580 | <!-- |
jjg@579 | 581 | **** apt targets. |
jjg@579 | 582 | --> |
jjg@371 | 583 | |
duke@1 | 584 | <target name="build-bootstrap-apt" depends="build-bootstrap-javac"> |
jjg@436 | 585 | <build-bootstrap-classes includes="${apt.includes}"/> |
jjg@436 | 586 | <build-bootstrap-jar name="apt" includes="${apt.includes}" |
jjg@436 | 587 | jarclasspath="javac.jar"/> |
jjg@436 | 588 | <build-bootstrap-tool name="apt"/> |
duke@1 | 589 | </target> |
jjg@371 | 590 | |
jjg@436 | 591 | <target name="build-apt" depends="build-javac,build-classes-apt"> |
jjg@436 | 592 | <build-jar name="apt" includes="${apt.includes}" jarclasspath="javac.jar"/> |
jjg@436 | 593 | <build-tool name="apt"/> |
duke@1 | 594 | </target> |
jjg@371 | 595 | |
duke@1 | 596 | <target name="build-classes-apt" depends="build-classes-javac"> |
jjg@436 | 597 | <build-classes includes="${apt.includes}"/> |
duke@1 | 598 | </target> |
jjg@371 | 599 | |
duke@1 | 600 | <target name="javadoc-apt" depends="build-apt,-def-javadoc-tool"> |
duke@1 | 601 | <javadoc-tool name="apt" includes="${apt.includes}"/> |
duke@1 | 602 | </target> |
jjg@371 | 603 | |
jjg@371 | 604 | |
duke@1 | 605 | <target name="jtreg-apt" depends="build-apt,-def-jtreg"> |
jjg@371 | 606 | <jtreg-tool name="apt" tests="${apt.tests}"/> |
duke@1 | 607 | </target> |
jjg@371 | 608 | |
duke@1 | 609 | <target name="findbugs-apt" depends="build-apt,-def-findbugs"> |
duke@1 | 610 | <findbugs-tool name="apt"/> |
duke@1 | 611 | </target> |
jjg@371 | 612 | |
duke@1 | 613 | <target name="apt" depends="build-apt,jtreg-apt,findbugs-apt"/> |
duke@1 | 614 | |
jjg@441 | 615 | |
jjg@579 | 616 | <!-- |
jjg@579 | 617 | **** Create import JDK stubs. |
jjg@579 | 618 | --> |
jjg@579 | 619 | |
jjg@579 | 620 | <target name="-create-import-jdk-stubs" depends="-def-genstubs" if="require.import.jdk.stubs"> |
jjg@441 | 621 | <mkdir dir="${build.genstubs.dir}"/> |
jjg@441 | 622 | <genstubs |
jjg@441 | 623 | srcdir="${import.jdk.src.dir}" destdir="${build.genstubs.dir}" |
jjg@441 | 624 | includes="${import.jdk.stub.files}" |
jjg@680 | 625 | fork="true" classpath="${build.toolclasses.dir}:${build.bootstrap.dir}/classes:${ant.core.lib}" |
jjg@441 | 626 | /> |
jjg@441 | 627 | </target> |
jjg@441 | 628 | |
jjg@579 | 629 | |
jjg@579 | 630 | <!-- |
jjg@579 | 631 | **** Check targets. |
jjg@579 | 632 | **** "-check-*" targets check that a required property is set, and set to a reasonable value. |
jjg@579 | 633 | **** A user friendly message is generated if not, and the build exits. |
jjg@579 | 634 | --> |
jjg@371 | 635 | |
duke@1 | 636 | <target name="-check-boot.java.home" depends="-def-check"> |
duke@1 | 637 | <check name="bootstrap java" property="boot.java.home" marker="${java.marker}"/> |
duke@1 | 638 | </target> |
jjg@371 | 639 | |
duke@1 | 640 | <target name="-check-target.java.home" depends="-def-check"> |
duke@1 | 641 | <check name="target java" property="target.java.home" marker="${java.marker}"/> |
duke@1 | 642 | </target> |
jjg@371 | 643 | |
duke@1 | 644 | <target name="-check-cobertura.home" depends="-def-check"> |
duke@1 | 645 | <check name="cobertura" property="cobertura.home" marker="cobertura.jar"/> |
duke@1 | 646 | </target> |
jjg@371 | 647 | |
duke@1 | 648 | <target name="-check-findbugs.home" depends="-def-check"> |
duke@1 | 649 | <check name="findbugs" property="findbugs.home" marker="lib/findbugs.jar"/> |
duke@1 | 650 | </target> |
jjg@371 | 651 | |
duke@1 | 652 | <target name="-check-jtreg.home" depends="-def-check"> |
duke@1 | 653 | <check name="jtreg" property="jtreg.home" marker="lib/jtreg.jar"/> |
duke@1 | 654 | </target> |
jjg@371 | 655 | |
jjg@578 | 656 | <target name="-check-vizant" depends="-def-check"> |
jjg@578 | 657 | <check name="vizant" property="vizant.jar"/> |
jjg@578 | 658 | <check name="dot" property="dot"/> |
jjg@578 | 659 | </target> |
jjg@578 | 660 | |
jjg@579 | 661 | |
jjg@579 | 662 | <!-- |
jjg@579 | 663 | **** Targets for Ant macro and task definitions. |
jjg@579 | 664 | --> |
duke@1 | 665 | |
jjg@436 | 666 | <target name="-def-build-tool"> |
duke@1 | 667 | <macrodef name="build-tool"> |
duke@1 | 668 | <attribute name="name"/> |
duke@1 | 669 | <attribute name="bin.dir" default="${dist.bin.dir}"/> |
jjg@370 | 670 | <attribute name="java" default="${launcher.java}"/> |
duke@1 | 671 | <sequential> |
duke@1 | 672 | <mkdir dir="@{bin.dir}"/> |
duke@1 | 673 | <copy file="${src.bin.dir}/launcher.sh-template" tofile="@{bin.dir}/@{name}"> |
duke@1 | 674 | <filterset begintoken="#" endtoken="#"> |
jjg@371 | 675 | <filter token="PROGRAM" value="@{name}"/> |
jjg@371 | 676 | <filter token="TARGET_JAVA" value="@{java}"/> |
jjg@656 | 677 | <filter token="PS" value="${path.separator}"/> |
duke@1 | 678 | </filterset> |
duke@1 | 679 | </copy> |
duke@1 | 680 | <chmod file="@{bin.dir}/@{name}" perm="ugo+rx"/> |
duke@1 | 681 | </sequential> |
duke@1 | 682 | </macrodef> |
duke@1 | 683 | </target> |
duke@1 | 684 | |
jjg@436 | 685 | <target name="-def-build-jar"> |
duke@1 | 686 | <macrodef name="build-jar"> |
duke@1 | 687 | <attribute name="name"/> |
duke@1 | 688 | <attribute name="includes"/> |
duke@1 | 689 | <attribute name="classes.dir" default="${build.classes.dir}"/> |
duke@1 | 690 | <attribute name="lib.dir" default="${dist.lib.dir}"/> |
duke@1 | 691 | <attribute name="jarmainclass" default="com.sun.tools.@{name}.Main"/> |
duke@1 | 692 | <attribute name="jarclasspath" default=""/> |
duke@1 | 693 | <sequential> |
duke@1 | 694 | <mkdir dir="@{lib.dir}"/> |
duke@1 | 695 | <jar destfile="@{lib.dir}/@{name}.jar" |
duke@1 | 696 | basedir="@{classes.dir}" |
duke@1 | 697 | includes="@{includes}"> |
jjg@371 | 698 | <manifest> |
duke@1 | 699 | <attribute name="Main-Class" value="@{jarmainclass}"/> |
duke@1 | 700 | <attribute name="Class-Path" value="@{jarclasspath}"/> |
duke@1 | 701 | </manifest> |
duke@1 | 702 | </jar> |
duke@1 | 703 | </sequential> |
duke@1 | 704 | </macrodef> |
duke@1 | 705 | </target> |
duke@1 | 706 | |
duke@1 | 707 | <target name="-def-build-classes" depends="-def-pcompile"> |
duke@1 | 708 | <macrodef name="build-classes"> |
duke@1 | 709 | <attribute name="includes"/> |
jjg@441 | 710 | <attribute name="excludes" default="${exclude.files} **/package-info.java"/> |
duke@1 | 711 | <attribute name="classes.dir" default="${build.classes.dir}"/> |
duke@1 | 712 | <attribute name="gensrc.dir" default="${build.gensrc.dir}"/> |
jjg@441 | 713 | <attribute name="javac.bootclasspath" default="${build.bootstrap.dir}/classes"/> |
jjg@441 | 714 | <attribute name="bootclasspath.opt" default="${javac.bootclasspath.opt}"/> |
jjg@441 | 715 | <attribute name="classpath" default="${javac.classpath}"/> |
jjg@441 | 716 | <attribute name="sourcepath" default="${javac.sourcepath}"/> |
jjg@436 | 717 | <attribute name="java.home" default="${boot.java.home}"/> |
jjg@436 | 718 | <attribute name="source" default="${javac.source}"/> |
jjg@436 | 719 | <attribute name="target" default="${javac.target}"/> |
duke@1 | 720 | <attribute name="release" default="${release}"/> |
duke@1 | 721 | <attribute name="full.version" default="${full.version}"/> |
duke@1 | 722 | <sequential> |
jjg@441 | 723 | <echo level="verbose" message="build-classes: excludes=@{excludes}"/> |
jjg@441 | 724 | <echo level="verbose" message="build-classes: bootclasspath.opt=@{bootclasspath.opt}"/> |
jjg@441 | 725 | <echo level="verbose" message="build-classes: classpath=@{classpath}"/> |
jjg@441 | 726 | <echo level="verbose" message="build-classes: sourcepath=@{sourcepath}"/> |
duke@1 | 727 | <mkdir dir="@{gensrc.dir}"/> |
duke@1 | 728 | <mkdir dir="@{classes.dir}"/> |
duke@1 | 729 | <pcompile srcdir="${src.classes.dir}" |
duke@1 | 730 | destdir="@{gensrc.dir}" |
duke@1 | 731 | includes="@{includes}"/> |
duke@1 | 732 | <copy todir="@{gensrc.dir}"> |
jjg@46 | 733 | <fileset dir="${src.classes.dir}" includes="@{includes}"/> |
duke@1 | 734 | <globmapper from="*.properties-template" to="*.properties"/> |
duke@1 | 735 | <filterset begintoken="$(" endtoken=")"> |
duke@1 | 736 | <filter token="JDK_VERSION" value="${jdk.version}"/> |
duke@1 | 737 | <filter token="RELEASE" value="@{release}"/> |
duke@1 | 738 | <filter token="FULL_VERSION" value="@{full.version}"/> |
duke@1 | 739 | </filterset> |
duke@1 | 740 | </copy> |
duke@1 | 741 | <pcompile srcdir="@{gensrc.dir}" |
duke@1 | 742 | destdir="@{gensrc.dir}" |
duke@1 | 743 | includes="**/*.properties"/> |
duke@1 | 744 | <javac fork="true" |
jjg@436 | 745 | executable="@{java.home}/bin/javac" |
jjg@436 | 746 | srcdir="${src.classes.dir}:@{gensrc.dir}" |
duke@1 | 747 | destdir="@{classes.dir}" |
duke@1 | 748 | includes="@{includes}" |
duke@1 | 749 | excludes="@{excludes}" |
jjg@441 | 750 | sourcepath="@{sourcepath}" |
jjg@441 | 751 | classpath="@{classpath}" |
duke@1 | 752 | includeAntRuntime="no" |
jjg@436 | 753 | source="@{source}" |
jjg@436 | 754 | target="@{target}" |
jjg@371 | 755 | debug="${javac.debug}" |
duke@1 | 756 | debuglevel="${javac.debuglevel}"> |
jjg@441 | 757 | <compilerarg value="-implicit:none"/> |
jjg@441 | 758 | <compilerarg value="-Xprefer:source"/> |
jjg@441 | 759 | <compilerarg value="-J-Xbootclasspath/p:@{javac.bootclasspath}"/> |
jjg@441 | 760 | <compilerarg line="@{bootclasspath.opt}"/> |
duke@1 | 761 | <compilerarg line="${javac.no.jdk.warnings}"/> |
duke@1 | 762 | <compilerarg line="${javac.version.opt}"/> |
duke@1 | 763 | <compilerarg line="${javac.lint.opts}"/> |
duke@1 | 764 | </javac> |
jjg@450 | 765 | <copy todir="@{classes.dir}" includeemptydirs="false"> |
jjg@450 | 766 | <fileset dir="${src.classes.dir}" includes="@{includes}" excludes="@{excludes}"> |
duke@1 | 767 | <exclude name="**/*.java"/> |
duke@1 | 768 | <exclude name="**/*.properties"/> |
duke@1 | 769 | <exclude name="**/*-template"/> |
duke@1 | 770 | <exclude name="**/package.html"/> |
duke@1 | 771 | </fileset> |
duke@1 | 772 | </copy> |
duke@1 | 773 | </sequential> |
duke@1 | 774 | </macrodef> |
duke@1 | 775 | </target> |
jjg@371 | 776 | |
duke@1 | 777 | <target name="-def-build-bootstrap-tool" depends="-check-boot.java.home,-def-build-tool"> |
duke@1 | 778 | <presetdef name="build-bootstrap-tool"> |
duke@1 | 779 | <build-tool |
duke@1 | 780 | bin.dir="${build.bootstrap.dir}/bin" |
jjg@436 | 781 | java="${boot.java}"/> |
duke@1 | 782 | </presetdef> |
duke@1 | 783 | </target> |
jjg@371 | 784 | |
duke@1 | 785 | <target name="-def-build-bootstrap-jar" depends="-def-build-jar"> |
duke@1 | 786 | <presetdef name="build-bootstrap-jar"> |
duke@1 | 787 | <build-jar |
jjg@436 | 788 | classes.dir="${build.bootstrap.dir}/classes" |
jjg@436 | 789 | lib.dir="${build.bootstrap.dir}/lib"/> |
jjg@436 | 790 | </presetdef> |
jjg@436 | 791 | </target> |
jjg@436 | 792 | |
jjg@436 | 793 | <target name="-def-build-bootstrap-classes" depends="-def-build-classes"> |
jjg@436 | 794 | <presetdef name="build-bootstrap-classes"> |
jjg@436 | 795 | <build-classes |
jjg@436 | 796 | source="${boot.javac.source}" |
jjg@436 | 797 | target="${boot.javac.target}" |
duke@1 | 798 | gensrc.dir="${build.bootstrap.dir}/gensrc" |
duke@1 | 799 | classes.dir="${build.bootstrap.dir}/classes" |
jjg@441 | 800 | javac.bootclasspath="" |
jjg@441 | 801 | bootclasspath.opt="-Xbootclasspath/p:${build.bootstrap.dir}/classes" |
jjg@441 | 802 | sourcepath="" |
duke@1 | 803 | release="${bootstrap.release}" |
jjg@441 | 804 | full.version="${bootstrap.full.version}" |
jjg@579 | 805 | excludes="${bootstrap.exclude.files} **/package-info.java"/> |
duke@1 | 806 | </presetdef> |
duke@1 | 807 | </target> |
jjg@371 | 808 | |
duke@1 | 809 | <target name="-def-pcompile"> |
duke@1 | 810 | <mkdir dir="${build.toolclasses.dir}"/> |
jjg@199 | 811 | <javac fork="true" |
andrew@374 | 812 | source="${boot.javac.source}" |
andrew@374 | 813 | target="${boot.javac.target}" |
jjg@199 | 814 | executable="${boot.java.home}/bin/javac" |
jjg@199 | 815 | srcdir="${make.tools.dir}/CompileProperties" |
duke@1 | 816 | destdir="${build.toolclasses.dir}/" |
jjg@680 | 817 | classpath="${ant.core.lib}" |
jjg@680 | 818 | includeantruntime="false"/> |
duke@1 | 819 | <taskdef name="pcompile" |
jjg@371 | 820 | classname="CompilePropertiesTask" |
duke@1 | 821 | classpath="${build.toolclasses.dir}/"/> |
duke@1 | 822 | </target> |
jjg@371 | 823 | |
jjg@579 | 824 | <target name="-def-genstubs" depends="build-bootstrap-javac" if="require.import.jdk.stubs"> |
jjg@441 | 825 | <mkdir dir="${build.toolclasses.dir}"/> |
jjg@441 | 826 | <javac fork="true" |
jjg@441 | 827 | source="${boot.javac.source}" |
jjg@441 | 828 | target="${boot.javac.target}" |
jjg@441 | 829 | executable="${boot.java.home}/bin/javac" |
jjg@441 | 830 | srcdir="${make.tools.dir}/GenStubs" |
jjg@441 | 831 | destdir="${build.toolclasses.dir}/" |
jjg@680 | 832 | classpath="${build.bootstrap.dir}/classes:${ant.core.lib}" |
jjg@680 | 833 | includeantruntime="false"/> |
jjg@441 | 834 | <taskdef name="genstubs" |
jjg@441 | 835 | classname="GenStubs$$Ant" |
jjg@441 | 836 | classpath="${build.toolclasses.dir}/"/> |
jjg@441 | 837 | </target> |
jjg@441 | 838 | |
duke@1 | 839 | <target name="-def-javadoc-tool" depends="-check-target.java.home"> |
duke@1 | 840 | <macrodef name="javadoc-tool"> |
duke@1 | 841 | <attribute name="name"/> |
duke@1 | 842 | <attribute name="includes"/> |
duke@1 | 843 | <attribute name="options" default=""/> |
duke@1 | 844 | <attribute name="source" default="1.5"/> <!-- FIXME --> |
duke@1 | 845 | <sequential> |
duke@1 | 846 | <property name="javadoc.options" value=""/> <!-- default, can be overridden per user or per project --> |
duke@1 | 847 | <!-- Note: even with this default value, includes |
jjg@579 | 848 | from src.classes.dir get javadoc'd; see packageset below --> |
duke@1 | 849 | <property name="javadoc.packagenames" value="none"/> <!-- default, can be overridden per user or per project --> |
jjg@371 | 850 | <javadoc |
duke@1 | 851 | executable="${target.java.home}/bin/javadoc" |
jjg@371 | 852 | destdir="${build.javadoc.dir}/@{name}" |
duke@1 | 853 | source="@{source}" |
jjg@371 | 854 | windowtitle="UNOFFICIAL" |
jjg@371 | 855 | failonerror="true" |
duke@1 | 856 | use="true" |
jjg@371 | 857 | author="false" |
duke@1 | 858 | version="false" |
duke@1 | 859 | packagenames="${javadoc.packagenames}" > |
duke@1 | 860 | <header><![CDATA[<strong>Unofficial Javadoc</strong> generated from developer sources for preview purposes only]]></header> |
duke@1 | 861 | <arg line="@{options}"/> |
duke@1 | 862 | <bootclasspath> |
duke@1 | 863 | <path location="${build.classes.dir}"/> |
duke@1 | 864 | <path location="${target.java.home}/jre/lib/rt.jar"/> |
duke@1 | 865 | </bootclasspath> |
duke@1 | 866 | <sourcepath> |
duke@1 | 867 | <pathelement location="${src.classes.dir}"/> |
duke@1 | 868 | </sourcepath> |
duke@1 | 869 | <!-- XXX just <fileset> (restricted further to **/*.java) and no <packageset> --> |
duke@1 | 870 | <!-- means that {@link some.package} will not work, which is no good. --> |
duke@1 | 871 | <!-- (It correctly skips excluded single classes, but not if packageset is also included, --> |
duke@1 | 872 | <!-- which also causes duplicates in the class index for included files.) --> |
duke@1 | 873 | <packageset dir="${src.classes.dir}" includes="@{includes}"> |
duke@1 | 874 | <or> |
duke@1 | 875 | <filename name="java/"/> |
duke@1 | 876 | <filename name="javax/"/> |
duke@1 | 877 | <filename name="com/sun/javadoc/"/> |
duke@1 | 878 | <filename name="com/sun/mirror/"/> |
duke@1 | 879 | <filename name="com/sun/source/"/> |
duke@1 | 880 | </or> |
duke@1 | 881 | </packageset> |
duke@1 | 882 | </javadoc> |
duke@1 | 883 | </sequential> |
duke@1 | 884 | </macrodef> |
duke@1 | 885 | </target> |
jjg@371 | 886 | |
jjg@371 | 887 | <target name="-def-jtreg" unless="jtreg.defined" depends="-check-jtreg.home,-check-target.java.home"> |
duke@1 | 888 | <taskdef name="jtreg" classname="com.sun.javatest.regtest.Main$$Ant"> |
duke@1 | 889 | <classpath> |
duke@1 | 890 | <pathelement location="${jtreg.home}/lib/jtreg.jar"/> |
duke@1 | 891 | <pathelement location="${jtreg.home}/lib/javatest.jar"/> |
duke@1 | 892 | </classpath> |
duke@1 | 893 | </taskdef> |
duke@1 | 894 | <macrodef name="jtreg-tool"> |
duke@1 | 895 | <attribute name="name"/> |
duke@1 | 896 | <attribute name="tests"/> |
duke@1 | 897 | <attribute name="jdk" default="${target.java.home}"/> |
jjg@371 | 898 | <attribute name="samevm" default="true"/> |
jjg@583 | 899 | <attribute name="verbose" default="${default.jtreg.verbose}"/> |
jjg@583 | 900 | <attribute name="options" default="${other.jtreg.options}"/> |
duke@1 | 901 | <attribute name="keywords" default="-keywords:!ignore"/> |
duke@1 | 902 | <attribute name="jpda.jvmargs" default=""/> |
duke@1 | 903 | <sequential> |
jjg@583 | 904 | <property name="coverage.options" value=""/> <!-- default --> |
jjg@583 | 905 | <property name="coverage.classpath" value=""/> <!-- default --> |
jjg@583 | 906 | <property name="default.jtreg.verbose" value="summary"/> <!-- default --> |
jjg@583 | 907 | <property name="other.jtreg.options" value=""/> <!-- default --> |
jjg@371 | 908 | <jtreg |
duke@1 | 909 | dir="${test.dir}" |
jjg@371 | 910 | workDir="${build.jtreg.dir}/@{name}/work" |
duke@1 | 911 | reportDir="${build.jtreg.dir}/@{name}/report" |
duke@1 | 912 | jdk="@{jdk}" |
duke@1 | 913 | samevm="@{samevm}" verbose="@{verbose}" |
duke@1 | 914 | failonerror="false" resultproperty="jtreg.@{name}.result" |
duke@1 | 915 | javacoptions="-g" |
duke@1 | 916 | vmoptions="${coverage.options} -Xbootclasspath/p:${coverage.classpath}:${build.classes.dir} @{jpda.jvmargs}"> |
duke@1 | 917 | <arg line="@{keywords}"/> |
duke@1 | 918 | <arg line="@{options}"/> |
duke@1 | 919 | <arg line="@{tests}"/> |
duke@1 | 920 | </jtreg> |
jjg@371 | 921 | <!-- the next two properties are for convenience, when only |
duke@1 | 922 | a single instance of jtreg will be invoked. --> |
duke@1 | 923 | <condition property="jtreg.passed"> |
jjg@201 | 924 | <equals arg1="${jtreg.@{name}.result}" arg2="0"/> |
duke@1 | 925 | </condition> |
duke@1 | 926 | <property name="jtreg.report" value="${build.jtreg.dir}/@{name}/report"/> |
duke@1 | 927 | </sequential> |
duke@1 | 928 | </macrodef> |
duke@1 | 929 | <property name="jtreg.defined" value="true"/> |
duke@1 | 930 | </target> |
duke@1 | 931 | |
duke@1 | 932 | <target name="-def-cobertura" depends="-check-cobertura.home"> |
duke@1 | 933 | <path id="cobertura.classpath"> |
duke@1 | 934 | <fileset dir="${cobertura.home}"> |
duke@1 | 935 | <include name="cobertura.jar"/> |
duke@1 | 936 | <include name="lib/**/*.jar"/> |
duke@1 | 937 | </fileset> |
duke@1 | 938 | </path> |
jjg@371 | 939 | <taskdef classpathref="cobertura.classpath" resource="tasks.properties"/> |
duke@1 | 940 | </target> |
jjg@371 | 941 | |
jjg@681 | 942 | <target name="-def-findbugs" unless="findbugs.defined" |
jjg@681 | 943 | depends="-check-findbugs.home,-check-target.java.home"> |
duke@1 | 944 | <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"> |
duke@1 | 945 | <classpath> |
duke@1 | 946 | <pathelement location="${findbugs.home}/lib/findbugs.jar"/> |
duke@1 | 947 | </classpath> |
duke@1 | 948 | </taskdef> |
duke@1 | 949 | <macrodef name="findbugs-tool"> |
duke@1 | 950 | <attribute name="name"/> |
duke@1 | 951 | <attribute name="output" default="emacs"/> |
duke@1 | 952 | <attribute name="outputFile" default=""/> |
duke@1 | 953 | <attribute name="reportLevel" default="high"/> |
duke@1 | 954 | <sequential> |
jjg@371 | 955 | <findbugs |
duke@1 | 956 | home="${findbugs.home}" |
duke@1 | 957 | output="@{output}" |
duke@1 | 958 | outputFile="@{outputFile}" |
duke@1 | 959 | reportLevel="@{reportLevel}" |
duke@1 | 960 | failOnError="false" |
duke@1 | 961 | errorProperty="findbugs.@{name}.errors" |
duke@1 | 962 | warningsProperty="findbugs.@{name}.warnings" |
jjg@681 | 963 | jvm="${target.java.home}/bin/java" |
duke@1 | 964 | jvmargs="-Xmx512M" > |
duke@1 | 965 | <class location="${dist.dir}/lib/@{name}.jar"/> |
duke@1 | 966 | <auxClasspath> |
duke@1 | 967 | <pathelement location="${build.classes.dir}"/> |
duke@1 | 968 | </auxClasspath> |
duke@1 | 969 | <sourcePath> |
duke@1 | 970 | <pathelement location="${src.classes.dir}"/> |
duke@1 | 971 | </sourcePath> |
duke@1 | 972 | </findbugs> |
duke@1 | 973 | </sequential> |
duke@1 | 974 | </macrodef> |
duke@1 | 975 | <property name="findbugs.defined" value="true"/> |
duke@1 | 976 | </target> |
jjg@579 | 977 | |
jjg@578 | 978 | <target name="-def-vizant" unless="vizant.defined" depends="-check-vizant"> |
jjg@579 | 979 | <taskdef name="vizant" classname="net.sourceforge.vizant.Vizant" classpath="${vizant.jar}"/> |
jjg@578 | 980 | <property name="vizant.defined" value="true"/> |
jjg@578 | 981 | </target> |
jjg@371 | 982 | |
duke@1 | 983 | <target name="-def-check"> |
duke@1 | 984 | <macrodef name="check"> |
duke@1 | 985 | <attribute name="name"/> |
duke@1 | 986 | <attribute name="property"/> |
jjg@578 | 987 | <attribute name="marker" default=""/> |
duke@1 | 988 | <sequential> |
duke@1 | 989 | <fail message="Cannot locate @{name}: please set @{property} to its location"> |
duke@1 | 990 | <condition> |
duke@1 | 991 | <not> |
duke@1 | 992 | <isset property="@{property}"/> |
duke@1 | 993 | </not> |
duke@1 | 994 | </condition> |
duke@1 | 995 | </fail> |
duke@1 | 996 | <fail message="@{name} is not installed in ${@{property}}"> |
duke@1 | 997 | <condition> |
jjg@579 | 998 | <and> |
jjg@579 | 999 | <not> |
jjg@579 | 1000 | <equals arg1="@{marker}" arg2=""/> |
jjg@579 | 1001 | </not> |
jjg@578 | 1002 | <not> |
jjg@578 | 1003 | <available file="${@{property}}/@{marker}"/> |
jjg@578 | 1004 | </not> |
jjg@579 | 1005 | </and> |
duke@1 | 1006 | </condition> |
duke@1 | 1007 | </fail> |
duke@1 | 1008 | </sequential> |
duke@1 | 1009 | </macrodef> |
duke@1 | 1010 | </target> |
duke@1 | 1011 | |
duke@1 | 1012 | </project> |
duke@1 | 1013 |