Wed, 24 Sep 2014 08:49:20 -0700
Merge
duke@1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
duke@1 | 2 | <!-- |
jjg@1647 | 3 | Copyright (c) 2007, 2013, 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 |
darcy@1194 | 86 | - groups of targets for each tool: javac, javadoc, doclets, javah, javap |
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@2134 | 92 | findbugs-TOOL run findbugs on the tool's source code |
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"/> |
ksrini@1137 | 134 | <property name="dist.checkstyle.dir" location="${dist.dir}/checkstyle"/> |
duke@1 | 135 | <property name="dist.lib.dir" location="${dist.dir}/lib"/> |
duke@1 | 136 | <property name="make.dir" location="make"/> |
ksrini@1137 | 137 | <property name="make.conf.dir" location="${make.dir}/conf"/> |
duke@1 | 138 | <property name="make.tools.dir" location="${make.dir}/tools"/> |
duke@1 | 139 | <property name="src.dir" location="src"/> |
duke@1 | 140 | <property name="src.bin.dir" location="${src.dir}/share/bin"/> |
duke@1 | 141 | <property name="src.classes.dir" location="${src.dir}/share/classes"/> |
duke@1 | 142 | <property name="test.dir" location="test"/> |
duke@1 | 143 | |
duke@1 | 144 | <!-- java.marker is set to a marker file to check for within a Java install dir. |
duke@1 | 145 | The best file to check for across Solaris/Linux/Windows/MacOS is one of the |
duke@1 | 146 | executables; regrettably, that is OS-specific. --> |
duke@1 | 147 | <condition property="java.marker" value="bin/java"> |
jjg@371 | 148 | <os family="unix"/> |
duke@1 | 149 | </condition> |
duke@1 | 150 | <condition property="java.marker" value="bin/java.exe"> |
jjg@371 | 151 | <os family="windows"/> |
duke@1 | 152 | </condition> |
jjg@371 | 153 | |
duke@1 | 154 | <!-- Standard property values, if not overriden by earlier settings. --> |
jjg@371 | 155 | <property file="${make.dir}/build.properties"/> |
jjg@370 | 156 | |
jjg@370 | 157 | <!-- launcher.java is used in the launcher scripts provided to run |
jjg@371 | 158 | the tools' jar files. If it has not already been set, then |
jjg@371 | 159 | default it to use ${target.java.home}, if available, otherwise |
jjg@371 | 160 | quietly default to simply use "java". --> |
jjg@371 | 161 | <condition property="launcher.java" |
jjg@371 | 162 | value="${target.java.home}/bin/java" else="java"> |
jjg@371 | 163 | <isset property="target.java.home"/> |
jjg@370 | 164 | </condition> |
jjg@370 | 165 | |
jjg@441 | 166 | <!-- Logic for handling access import jdk classes, if available. |
jjg@441 | 167 | import.jdk should be unset, or set to jdk home (to use rt.jar) |
jjg@441 | 168 | or to jdk repo (to use src/share/classes). |
jjg@441 | 169 | Based on the value, if any, set up default values for javac's sourcepath, |
jjg@450 | 170 | classpath and bootclasspath. Note: the default values are overridden |
jjg@441 | 171 | in the build-bootstrap-classes macro. --> |
jjg@441 | 172 | |
jjg@441 | 173 | <available property="import.jdk.src.dir" value="${import.jdk}/src/share/classes" |
jjg@441 | 174 | filepath="${import.jdk}/src/share/classes" file="java/nio/file/Path.java"/> |
jjg@441 | 175 | <available property="import.jdk.jar" value="${import.jdk}/jre/lib/rt.jar" |
jjg@441 | 176 | ignoresystemclasses="true" |
jjg@441 | 177 | classpath="${import.jdk}/jre/lib/rt.jar" classname="java.nio.file.Path"/> |
jjg@441 | 178 | |
jjg@579 | 179 | <!-- Set the default bootclasspath option used for javac. |
jjg@579 | 180 | Note that different variants of the option are used, meaning we can't just |
jjg@579 | 181 | define the value for the option. |
jjg@579 | 182 | Note the explicit use of the standard property ${path.separator} in the following. |
jjg@579 | 183 | This is because Ant is not clever enough to handle direct use of : or ; --> |
jjg@441 | 184 | <condition property="javac.bootclasspath.opt" |
jjg@463 | 185 | value="-Xbootclasspath:${build.classes.dir}${path.separator}${import.jdk.jar}" |
jjg@441 | 186 | else="-Xbootclasspath/p:${build.classes.dir}"> |
jjg@441 | 187 | <isset property="import.jdk.jar"/> |
jjg@441 | 188 | </condition> |
jjg@441 | 189 | |
jjg@579 | 190 | <condition property="boot.java.provides.latest.jdk"> |
jjg@579 | 191 | <available |
jjg@579 | 192 | ignoresystemclasses="true" |
jjg@579 | 193 | classpath="${boot.java.home}/jre/lib/rt.jar" classname="java.nio.file.Path"/> |
jjg@441 | 194 | </condition> |
jjg@441 | 195 | |
jjg@579 | 196 | <condition property="bootstrap.exclude.files" value="" else="${require.latest.jdk.files}"> |
jjg@579 | 197 | <isset property="boot.java.provides.latest.jdk"/> |
jjg@579 | 198 | </condition> |
jjg@579 | 199 | |
jjg@579 | 200 | <condition property="exclude.files" value="" else="${require.latest.jdk.files}"> |
jjg@579 | 201 | <or> |
jjg@579 | 202 | <isset property="boot.java.provides.latest.jdk"/> |
jjg@579 | 203 | <isset property="import.jdk"/> |
jjg@579 | 204 | </or> |
jjg@579 | 205 | </condition> |
jjg@579 | 206 | |
jjg@579 | 207 | <condition property="require.import.jdk.stubs"> |
jjg@579 | 208 | <and> |
jjg@579 | 209 | <not> |
jjg@579 | 210 | <isset property="boot.java.provides.latest.jdk"/> |
jjg@579 | 211 | </not> |
jjg@579 | 212 | <isset property="import.jdk.src.dir"/> |
jjg@579 | 213 | </and> |
jjg@579 | 214 | </condition> |
jjg@579 | 215 | |
jjg@579 | 216 | <!-- Set the default value of the sourcepath used for javac. --> |
jjg@579 | 217 | <condition property="javac.sourcepath" value="${build.genstubs.dir}" else=""> |
jjg@579 | 218 | <isset property="require.import.jdk.stubs"/> |
jjg@579 | 219 | </condition> |
jjg@579 | 220 | |
jjg@579 | 221 | <!-- Set the default value of the classpath used for javac. --> |
jjg@579 | 222 | <property name="javac.classpath" value=""/> |
jjg@579 | 223 | |
jjg@579 | 224 | |
jjg@579 | 225 | <!-- |
jjg@579 | 226 | **** General top level targets. |
jjg@579 | 227 | --> |
jjg@371 | 228 | |
duke@1 | 229 | <!-- Standard target to build deliverables for JDK build. --> |
duke@1 | 230 | |
duke@1 | 231 | <target name="build" depends="build-bootstrap-tools,build-all-classes"> |
duke@1 | 232 | <copy todir="${dist.dir}/bootstrap"> |
duke@1 | 233 | <fileset dir="${build.bootstrap.dir}" includes="bin/,lib/"/> |
duke@1 | 234 | </copy> |
duke@1 | 235 | <chmod dir="${dist.dir}/bootstrap/bin" perm="ugo+rx"> |
duke@1 | 236 | <include name="*"/> |
duke@1 | 237 | </chmod> |
duke@1 | 238 | <mkdir dir="${dist.lib.dir}"/> |
duke@1 | 239 | <jar file="${dist.lib.dir}/classes.jar" basedir="${build.classes.dir}"/> |
duke@1 | 240 | <zip file="${dist.lib.dir}/src.zip" basedir="${src.classes.dir}"/> |
duke@1 | 241 | </target> |
jjg@371 | 242 | |
jjg@441 | 243 | <target name="build-bootstrap-tools" |
ohrstrom@1504 | 244 | depends="build-bootstrap-javac,build-bootstrap-javadoc,build-bootstrap-doclets,build-bootstrap-javah,build-bootstrap-sjavac" |
jjg@441 | 245 | /> |
jjg@371 | 246 | |
jjg@441 | 247 | <target name="build-all-tools" |
ohrstrom@1504 | 248 | depends="build-javac,build-javadoc,build-doclets,build-javah,build-javap,build-sjavac" |
jjg@441 | 249 | /> |
jjg@371 | 250 | |
jjg@441 | 251 | <target name="build-all-classes" depends="build-bootstrap-javac,-create-import-jdk-stubs"> |
ohrstrom@1504 | 252 | <build-classes includes="${javac.includes} ${javadoc.includes} ${doclets.includes} ${javah.includes} ${javap.includes} ${sjavac.includes}"/> |
jjg@436 | 253 | </target> |
jjg@371 | 254 | |
duke@1 | 255 | <!-- clean --> |
duke@1 | 256 | |
duke@1 | 257 | <target name="clean" description="Delete all generated files"> |
duke@1 | 258 | <delete dir="${build.dir}"/> |
duke@1 | 259 | <delete dir="${dist.dir}"/> |
duke@1 | 260 | </target> |
duke@1 | 261 | |
duke@1 | 262 | <!-- Additional targets for running tools on the build --> |
duke@1 | 263 | |
jjg@371 | 264 | <target name="jtreg" depends="build-all-tools,-def-jtreg"> |
jjg@371 | 265 | <jtreg-tool name="all" tests="${jtreg.tests}"/> |
jjg@371 | 266 | </target> |
jjg@371 | 267 | |
ksrini@1137 | 268 | <target name="checkstyle" depends="-def-checkstyle" |
ksrini@1137 | 269 | description="Generates reports for code convention violations."> |
ksrini@1137 | 270 | <mkdir dir="${dist.checkstyle.dir}"/> |
ksrini@1137 | 271 | <checkstyle config="${make.conf.dir}/checkstyle-langtools.xml" |
ksrini@1137 | 272 | failureProperty="checkstyle.failure" |
ksrini@1137 | 273 | failOnViolation="false"> |
ksrini@1137 | 274 | <formatter type="xml" tofile="${dist.checkstyle.dir}/checkstyle_report.xml"/> |
ksrini@1137 | 275 | <fileset dir="src" includes="**/*.java, **/*.properties"/> |
ksrini@1137 | 276 | </checkstyle> |
ksrini@1137 | 277 | <!-- transform the output to a simple html --> |
ksrini@1137 | 278 | <xslt in="${dist.checkstyle.dir}/checkstyle_report.xml" |
ksrini@1137 | 279 | out="${dist.checkstyle.dir}/checkstyle_report.html" |
jjg@1409 | 280 | style="${checkstyle.home}/contrib/checkstyle-simple.xsl"/> |
ksrini@1137 | 281 | <!-- transform the output to a very simple emacs friendly text file --> |
ksrini@1137 | 282 | <xslt in="${dist.checkstyle.dir}/checkstyle_report.xml" |
ksrini@1137 | 283 | out="${dist.checkstyle.dir}/checkstyle_report.tmp" |
ksrini@1137 | 284 | style="${make.conf.dir}/checkstyle-emacs.xsl"/> |
ksrini@1137 | 285 | <!-- beautify remove extra lines --> |
ksrini@1137 | 286 | <move file="${dist.checkstyle.dir}/checkstyle_report.tmp" |
ksrini@1137 | 287 | toFile="${dist.checkstyle.dir}/checkstyle_report.emacs.txt"> |
ksrini@1137 | 288 | <filterchain> |
ksrini@1137 | 289 | <ignoreblank/> |
ksrini@1137 | 290 | <replaceregex byline="true" pattern="^File:" replace="${line.separator}File:"/> |
ksrini@1137 | 291 | </filterchain> |
ksrini@1137 | 292 | </move> |
ksrini@1137 | 293 | </target> |
ksrini@1137 | 294 | <!-- target can be invoked from an ide, the output of which can be used |
ksrini@1137 | 295 | to access and fix the errors directly. |
ksrini@1137 | 296 | --> |
ksrini@1137 | 297 | <target name="checkstyle-ide" depends="checkstyle"> |
ksrini@1137 | 298 | <concat> |
ksrini@1137 | 299 | <fileset file="${dist.checkstyle.dir}/checkstyle_report.emacs.txt"/> |
jjg@1409 | 300 | </concat> |
ksrini@1137 | 301 | </target> |
jjg@1409 | 302 | |
duke@1 | 303 | <target name="findbugs" depends="-def-findbugs,build-all-tools"> |
duke@1 | 304 | <property name="findbugs.reportLevel" value="medium"/> |
duke@1 | 305 | <mkdir dir="${dist.findbugs.dir}"/> |
duke@1 | 306 | <findbugs |
duke@1 | 307 | home="${findbugs.home}" |
duke@1 | 308 | projectName="JDK langtools ${full.version}" |
duke@1 | 309 | output="xml" |
duke@1 | 310 | outputFile="${dist.findbugs.dir}/findbugs.xml" |
duke@1 | 311 | reportLevel="${findbugs.reportLevel}" |
duke@1 | 312 | failOnError="false" |
duke@1 | 313 | errorProperty="findbugs.all.errors" |
duke@1 | 314 | warningsProperty="findbugs.all.warnings" |
jjg@681 | 315 | jvm="${target.java.home}/bin/java" |
duke@1 | 316 | jvmargs="-Xmx512M"> |
duke@1 | 317 | <class location="${build.classes.dir}"/> |
duke@1 | 318 | <sourcePath> |
duke@1 | 319 | <pathelement location="${src.classes.dir}"/> |
duke@1 | 320 | </sourcePath> |
duke@1 | 321 | </findbugs> |
duke@1 | 322 | <exec executable="sh"> |
duke@1 | 323 | <arg value="${findbugs.home}/bin/convertXmlToText"/> |
duke@1 | 324 | <arg value="-longBugCodes"/> |
duke@1 | 325 | <arg value="-html:${findbugs.home}/src/xsl/fancy.xsl"/> |
duke@1 | 326 | <arg value="${dist.findbugs.dir}/findbugs.xml"/> |
duke@1 | 327 | <redirector output="${dist.findbugs.dir}/findbugs.html"/> |
jjg@46 | 328 | </exec> |
duke@1 | 329 | </target> |
duke@1 | 330 | |
duke@1 | 331 | <target name="coverage" depends="-def-cobertura,build-all-classes,instrument-classes,jtreg,coverage-report"/> |
duke@1 | 332 | |
duke@1 | 333 | <target name="instrument-classes" depends="-def-cobertura"> |
duke@1 | 334 | <!-- only define the following property when we want coverage info --> |
duke@1 | 335 | <path id="coverage.classpath"> |
duke@1 | 336 | <pathelement location="${build.coverage.dir}/classes"/> |
duke@1 | 337 | <path refid="cobertura.classpath"/> |
duke@1 | 338 | </path> |
duke@1 | 339 | <property name="coverage.options" value="-Dnet.sourceforge.cobertura.datafile=${build.coverage.dir}/cobertura.ser"/> |
duke@1 | 340 | <property name="coverage.classpath" refid="coverage.classpath"/> |
duke@1 | 341 | <mkdir dir="${build.coverage.dir}/classes"/> |
duke@1 | 342 | <delete file="${build.coverage.dir}/cobertura.ser"/> |
duke@1 | 343 | <cobertura-instrument todir="${build.coverage.dir}/classes" |
duke@1 | 344 | datafile="${build.coverage.dir}/cobertura.ser"> |
jjg@371 | 345 | <fileset dir="${build.classes.dir}" |
duke@1 | 346 | includes="**/*.class" excludes="**/resources/*.class"/> |
duke@1 | 347 | </cobertura-instrument> |
jjg@371 | 348 | </target> |
duke@1 | 349 | |
duke@1 | 350 | <target name="coverage-report" depends="-def-cobertura"> |
duke@1 | 351 | <mkdir dir="${dist.coverage.dir}"/> |
jjg@371 | 352 | <cobertura-report |
duke@1 | 353 | srcdir="${src.classes.dir}" |
duke@1 | 354 | destdir="${dist.coverage.dir}" |
duke@1 | 355 | datafile="${build.coverage.dir}/cobertura.ser"/> |
jjg@371 | 356 | <cobertura-report |
jjg@371 | 357 | format="xml" |
jjg@371 | 358 | srcdir="${src.classes.dir}" |
duke@1 | 359 | destdir="${dist.coverage.dir}" |
duke@1 | 360 | datafile="${build.coverage.dir}/cobertura.ser"/> |
duke@1 | 361 | </target> |
jjg@371 | 362 | |
jlahoda@2099 | 363 | <target name="diags-examples" depends="build-javac,build-javap"> |
jjg@610 | 364 | <!-- can override the following on the command line if desired. --> |
jjg@610 | 365 | <property name="diags.examples.out" location="${build.dir}/diag-examples/diags-examples.html"/> |
jjg@610 | 366 | <mkdir dir="${build.dir}/diag-examples/classes"/> |
jjg@610 | 367 | <javac fork="true" |
jjg@610 | 368 | executable="${dist.bin.dir}/javac" |
jjg@610 | 369 | srcdir="test/tools/javac/diags" |
jjg@610 | 370 | destdir="${build.dir}/diag-examples/classes" |
jjg@1409 | 371 | includes="ArgTypeCompilerFactory.java,Example.java,FileManager.java,HTMLWriter.java,RunExamples.java,DocCommentProcessor.java" |
jjg@610 | 372 | sourcepath="" |
jlahoda@2099 | 373 | classpath="${dist.lib.dir}/javac.jar;${dist.lib.dir}/javap.jar" |
jjg@610 | 374 | includeAntRuntime="no" |
jjg@610 | 375 | debug="${javac.debug}" |
jjg@1045 | 376 | debuglevel="${javac.debuglevel}"> |
jjg@1045 | 377 | <compilerarg line="${javac.lint.opts}"/> |
jjg@1045 | 378 | </javac> |
jjg@610 | 379 | <java fork="true" |
jjg@610 | 380 | jvm="${target.java.home}/bin/java" |
jjg@610 | 381 | dir="test/tools/javac/diags" |
jlahoda@2099 | 382 | classpath="${build.dir}/diag-examples/classes;${dist.lib.dir}/javac.jar;${dist.lib.dir}/javap.jar" |
jjg@610 | 383 | classname="RunExamples"> |
jjg@1409 | 384 | <jvmarg value="-Dtest.classes=${build.dir}/diag-examples/classes"/> |
jjg@610 | 385 | <arg value="-examples"/> |
jjg@610 | 386 | <arg value="examples"/> |
jjg@610 | 387 | <arg value="-o"/> |
jjg@610 | 388 | <arg file="${diags.examples.out}"/> |
jjg@610 | 389 | <arg value="-showFiles"/> |
jjg@610 | 390 | <arg value="-title"/> |
jjg@610 | 391 | <arg value="Examples of javac diagnostics"/> |
jjg@610 | 392 | </java> |
jjg@610 | 393 | </target> |
jjg@610 | 394 | |
ksrini@825 | 395 | <!-- a patching facility to speed up incorporating the langtools' classfiles |
ksrini@825 | 396 | into a jdk of your choice. Either target.java.home or patch.jdk can be |
ksrini@825 | 397 | set on the command line; setting target.java.home has the advantage of |
ksrini@825 | 398 | patching the jdk used for jtreg and other tests. |
ksrini@825 | 399 | --> |
ksrini@825 | 400 | <target name="patch" depends="build-all-classes"> |
ksrini@825 | 401 | <condition property="patch.jdk" value="${target.java.home}"> |
ksrini@825 | 402 | <available file="${target.java.home}" type="dir"/> |
ksrini@825 | 403 | </condition> |
ksrini@825 | 404 | <fail message="patch.jdk or target.java.home is not set, please set target.java.home, or patch.jdk for an alternate jdk image to patch"> |
ksrini@825 | 405 | <condition> |
ksrini@825 | 406 | <not> |
ksrini@825 | 407 | <isset property="patch.jdk"/> |
ksrini@825 | 408 | </not> |
ksrini@825 | 409 | </condition> |
ksrini@825 | 410 | </fail> |
ksrini@825 | 411 | <property name="patch.tools.jar" location="${patch.jdk}/lib/tools.jar"/> |
ksrini@825 | 412 | <property name="patch.rt.jar" location="${patch.jdk}/jre/lib/rt.jar"/> |
ksrini@825 | 413 | <fail message="patch.jdk or target.java.home must point to a valid jdk image: missing tools.jar"> |
ksrini@825 | 414 | <condition> |
ksrini@825 | 415 | <not> |
ksrini@825 | 416 | <available file="${patch.tools.jar}" type="file"/> |
ksrini@825 | 417 | </not> |
ksrini@825 | 418 | </condition> |
ksrini@825 | 419 | </fail> |
ksrini@825 | 420 | <fail message="patch.jdk or target.java.home must point to a valid jdk image: missing rt.jar"> |
ksrini@825 | 421 | <condition> |
ksrini@825 | 422 | <not> |
ksrini@825 | 423 | <available file="${patch.rt.jar}" type="file"/> |
ksrini@825 | 424 | </not> |
ksrini@825 | 425 | </condition> |
ksrini@825 | 426 | </fail> |
ksrini@825 | 427 | <zip zipfile="${patch.tools.jar}" update="true"> |
ksrini@825 | 428 | <zipfileset dir="${build.classes.dir}" includes="com/**"/> |
ksrini@825 | 429 | </zip> |
ksrini@825 | 430 | <zip zipfile="${patch.rt.jar}" update="true"> |
ksrini@825 | 431 | <zipfileset dir="${build.classes.dir}" includes="javax/**"/> |
ksrini@825 | 432 | </zip> |
ksrini@825 | 433 | </target> |
jjg@579 | 434 | |
jjg@1647 | 435 | <target name="doclint-api" depends="build-all-classes"> |
jjg@1647 | 436 | <delete dir="${build.dir}/doclint/classes"/> |
jjg@1647 | 437 | <mkdir dir="${build.dir}/doclint/classes"/> |
jjg@1647 | 438 | <javac fork="true" |
jjg@1647 | 439 | executable="${boot.javac}" |
jjg@1647 | 440 | srcdir="${src.classes.dir}:${build.gensrc.dir}" |
jjg@1647 | 441 | destdir="${build.dir}/doclint/classes" |
jjg@1647 | 442 | includes="javax/lang/model/** com/sun/javadoc/** com/sun/source/**" |
jjg@1647 | 443 | excludes="" |
jjg@1647 | 444 | sourcepath="${javac.sourcepath}" |
jjg@1647 | 445 | classpath="${javac.classpath}" |
jjg@1647 | 446 | includeAntRuntime="no" |
jjg@1647 | 447 | source="${javac.source}" |
jjg@1647 | 448 | target="${javac.target}" |
jjg@1647 | 449 | debug="${javac.debug}" |
jjg@1647 | 450 | debuglevel="${javac.debuglevel}"> |
jjg@1647 | 451 | <compilerarg value="-implicit:none"/> |
jjg@1647 | 452 | <compilerarg value="-Xprefer:source"/> |
jjg@1647 | 453 | <compilerarg value="-J-Xbootclasspath/p:${build.bootstrap.dir}/classes"/> |
jjg@1647 | 454 | <compilerarg line="${javac.no.jdk.warnings}"/> |
jjg@1647 | 455 | <compilerarg line="${javac.version.opt}"/> |
jjg@1647 | 456 | <compilerarg line="-Xdoclint:all/protected,-missing"/> |
jjg@1647 | 457 | </javac> |
jjg@1647 | 458 | </target> |
jjg@1647 | 459 | |
jjg@579 | 460 | <!-- |
jjg@579 | 461 | **** Debugging/diagnostic targets. |
jjg@579 | 462 | --> |
jjg@579 | 463 | |
jjg@579 | 464 | <!-- standard JDK target --> |
jjg@579 | 465 | <target name="sanity" |
jjg@579 | 466 | description="display settings of configuration values"> |
jjg@579 | 467 | <echo level="info">ant.home = ${ant.home}</echo> |
jjg@579 | 468 | <echo level="info">boot.java.home = ${boot.java.home}</echo> |
jjg@579 | 469 | <echo level="info">target.java.home = ${target.java.home}</echo> |
jjg@579 | 470 | <echo level="info">jtreg.home = ${jtreg.home}</echo> |
jjg@579 | 471 | <echo level="info">findbugs.home = ${findbugs.home}</echo> |
ksrini@1137 | 472 | <echo level="info">checkstyle.home = ${checkstyle.home}</echo> |
jjg@579 | 473 | </target> |
jjg@579 | 474 | |
jjg@579 | 475 | <target name="post-sanity" depends="-def-jtreg,sanity,build" |
jjg@579 | 476 | description="perform basic validation after a standard build"> |
jjg@579 | 477 | <jtreg |
jjg@579 | 478 | dir="make/test" |
jjg@579 | 479 | workDir="${build.jtreg.dir}/post-sanity/work" |
jjg@579 | 480 | reportDir="${build.jtreg.dir}/post-sanity/report" |
jjg@579 | 481 | jdk="${target.java.home}" |
jjg@579 | 482 | verbose="summary" |
jjg@579 | 483 | failonerror="false" resultproperty="jtreg.post-sanity.result"> |
jjg@579 | 484 | </jtreg> |
jjg@579 | 485 | </target> |
jjg@579 | 486 | |
jjg@579 | 487 | <!-- use vizant tool to generate graphical image of this Ant file.--> |
jjg@579 | 488 | <target name="vizant" depends="-def-vizant"> |
jjg@579 | 489 | <mkdir dir="${build.dir}"/> |
jjg@579 | 490 | <echo message="Generating ${build.dir}/build.dot"/> |
jjg@579 | 491 | <vizant antfile="${make.dir}/build.xml" outfile="${build.dir}/build.dot"/> |
jjg@579 | 492 | <echo message="Generating ${build.dir}/build.png"/> |
jjg@579 | 493 | <exec executable="${dot}" > |
jjg@579 | 494 | <arg value="-Tpng"/> |
jjg@579 | 495 | <arg value="-o"/> |
jjg@579 | 496 | <arg file="${build.dir}/build.png"/> |
jjg@579 | 497 | <arg file="${build.dir}/build.dot"/> |
jjg@579 | 498 | </exec> |
jjg@579 | 499 | </target> |
jjg@579 | 500 | |
jjg@579 | 501 | <target name="check-import.jdk"> |
jjg@579 | 502 | <echo message="import.jdk: ${import.jdk}"/> |
jjg@579 | 503 | <echo message="import.jdk.jar: ${import.jdk.jar}"/> |
jjg@579 | 504 | <echo message="import.jdk.src.dir: ${import.jdk.src.dir}"/> |
jjg@579 | 505 | </target> |
jjg@579 | 506 | |
jjg@579 | 507 | <target name="diagnostics"> |
jjg@579 | 508 | <diagnostics/> |
jjg@579 | 509 | </target> |
jjg@579 | 510 | |
jjg@579 | 511 | |
jjg@579 | 512 | <!-- |
jjg@579 | 513 | **** javac targets. |
jjg@579 | 514 | --> |
duke@1 | 515 | |
jjg@436 | 516 | <target name="build-bootstrap-javac" |
jjg@436 | 517 | depends="-def-build-bootstrap-classes,-def-build-bootstrap-jar,-def-build-bootstrap-tool"> |
jjg@436 | 518 | <build-bootstrap-classes includes="${javac.includes}"/> |
jjg@436 | 519 | <build-bootstrap-jar name="javac" includes="${javac.includes}"/> |
jjg@436 | 520 | <build-bootstrap-tool name="javac"/> |
duke@1 | 521 | </target> |
jjg@371 | 522 | |
jjg@441 | 523 | <target name="build-classes-javac" depends="build-bootstrap-javac,-create-import-jdk-stubs"> |
jjg@436 | 524 | <build-classes includes="${javac.includes}"/> |
duke@1 | 525 | </target> |
jjg@371 | 526 | |
jjg@436 | 527 | <target name="build-javac" depends="build-classes-javac"> |
jjg@436 | 528 | <build-jar name="javac" includes="${javac.includes}"/> |
jjg@436 | 529 | <build-tool name="javac"/> |
duke@1 | 530 | </target> |
jjg@371 | 531 | |
duke@1 | 532 | <target name="javadoc-javac" depends="build-javac,-def-javadoc-tool"> |
jjh@972 | 533 | <javadoc-tool name="javac" includes="${javac.includes}" options="${javadoc.jls.option}"/> |
duke@1 | 534 | </target> |
jjg@371 | 535 | |
jjg@436 | 536 | <target name="jtreg-javac" depends="build-javac,build-javap,-def-jtreg"> |
jjg@371 | 537 | <jtreg-tool name="javac" tests="${javac.tests}"/> |
duke@1 | 538 | </target> |
jjg@371 | 539 | |
duke@1 | 540 | <target name="findbugs-javac" depends="build-javac,-def-findbugs"> |
duke@1 | 541 | <findbugs-tool name="javac"/> |
duke@1 | 542 | </target> |
jjg@371 | 543 | |
duke@1 | 544 | <target name="javac" depends="build-javac,jtreg-javac,findbugs-javac"/> |
jjg@371 | 545 | |
jjg@579 | 546 | |
jjg@579 | 547 | <!-- |
jjg@579 | 548 | **** javadoc targets. |
jjg@579 | 549 | --> |
duke@1 | 550 | |
duke@1 | 551 | <target name="build-bootstrap-javadoc" depends="build-bootstrap-javac"> |
jjg@436 | 552 | <build-bootstrap-classes includes="${javadoc.includes}"/> |
jjg@436 | 553 | <build-bootstrap-jar name="javadoc" includes="${javadoc.includes}" |
jjg@436 | 554 | jarclasspath="javac.jar doclets.jar"/> |
jjg@436 | 555 | <build-bootstrap-tool name="javadoc"/> |
duke@1 | 556 | </target> |
jjg@371 | 557 | |
duke@1 | 558 | <target name="build-classes-javadoc" depends="build-classes-javac"> |
jjg@436 | 559 | <build-classes includes="${javadoc.includes}"/> |
duke@1 | 560 | </target> |
jjg@371 | 561 | |
jjg@436 | 562 | <target name="build-javadoc" depends="build-javac,build-classes-javadoc"> |
jjg@436 | 563 | <build-jar name="javadoc" includes="${javadoc.includes}" |
duke@1 | 564 | jarclasspath="javac.jar doclets.jar"/> |
jjg@436 | 565 | <build-tool name="javadoc"/> |
duke@1 | 566 | </target> |
jjg@371 | 567 | |
duke@1 | 568 | <target name="javadoc-javadoc" depends="build-javadoc,-def-javadoc-tool"> |
duke@1 | 569 | <javadoc-tool name="javadoc" includes="${javadoc.includes}"/> |
duke@1 | 570 | </target> |
jjg@371 | 571 | |
duke@1 | 572 | <target name="jtreg-javadoc" depends="build-javadoc,-def-jtreg"> |
jjg@371 | 573 | <jtreg-tool name="javadoc" tests="${javadoc.tests}"/> |
duke@1 | 574 | </target> |
jjg@371 | 575 | |
duke@1 | 576 | <target name="findbugs-javadoc" depends="build-javadoc,-def-findbugs"> |
duke@1 | 577 | <findbugs-tool name="javadoc"/> |
duke@1 | 578 | </target> |
jjg@371 | 579 | |
duke@1 | 580 | <target name="javadoc" depends="build-javadoc,jtreg-javadoc,findbugs-javadoc"/> |
jjg@371 | 581 | |
jjg@579 | 582 | |
jjg@579 | 583 | <!-- |
jjg@579 | 584 | **** doclets targets. |
jjg@579 | 585 | --> |
duke@1 | 586 | |
duke@1 | 587 | <target name="build-bootstrap-doclets" depends="build-bootstrap-javadoc,-def-build-bootstrap-jar"> |
jjg@436 | 588 | <build-bootstrap-classes includes="${doclets.includes}"/> |
jjg@436 | 589 | <build-bootstrap-jar name="doclets" includes="${doclets.includes}" |
jjg@436 | 590 | jarmainclass="com.sun.tools.javadoc.Main" |
jjg@436 | 591 | jarclasspath="javadoc.jar"/> |
duke@1 | 592 | </target> |
jjg@371 | 593 | |
duke@1 | 594 | <target name="build-classes-doclets" depends="build-classes-javadoc"> |
jjg@436 | 595 | <build-classes includes="${doclets.includes}"/> |
duke@1 | 596 | </target> |
jjg@371 | 597 | |
jjg@436 | 598 | <target name="build-doclets" depends="build-javadoc,build-classes-doclets"> |
duke@1 | 599 | <!-- just jar, no bin for doclets --> |
jjg@436 | 600 | <build-jar name="doclets" includes="${doclets.includes}" jarclasspath="javadoc.jar"/> |
duke@1 | 601 | </target> |
duke@1 | 602 | |
duke@1 | 603 | <!-- (no javadoc for doclets) --> |
jjg@371 | 604 | |
duke@1 | 605 | <target name="jtreg-doclets" depends="build-doclets,-def-jtreg"> |
jjg@371 | 606 | <jtreg-tool name="doclets" tests="${doclets.tests}"/> |
duke@1 | 607 | </target> |
jjg@371 | 608 | |
duke@1 | 609 | <target name="findbugs-doclets" depends="build-doclets,-def-findbugs"> |
duke@1 | 610 | <findbugs-tool name="doclets"/> |
duke@1 | 611 | </target> |
jjg@371 | 612 | |
duke@1 | 613 | <target name="doclets" depends="build-doclets,jtreg-doclets,findbugs-doclets"/> |
jjg@371 | 614 | |
jjg@579 | 615 | |
jjg@579 | 616 | <!-- |
jjg@579 | 617 | **** javah targets. |
jjg@579 | 618 | --> |
duke@1 | 619 | |
duke@1 | 620 | <target name="build-bootstrap-javah" depends="build-bootstrap-javadoc"> |
jjg@436 | 621 | <build-bootstrap-classes includes="${javah.includes}"/> |
jjg@436 | 622 | <build-bootstrap-jar name="javah" includes="${javah.includes}" |
jjg@436 | 623 | jarclasspath="javadoc.jar doclets.jar javac.jar"/> |
jjg@436 | 624 | <build-bootstrap-tool name="javah"/> |
duke@1 | 625 | </target> |
jjg@371 | 626 | |
jjg@436 | 627 | <target name="build-javah" depends="build-javac,build-classes-javah"> |
jjg@436 | 628 | <build-jar name="javah" includes="${javah.includes}" jarclasspath="javac.jar"/> |
jjg@436 | 629 | <build-tool name="javah"/> |
duke@1 | 630 | </target> |
jjg@371 | 631 | |
duke@1 | 632 | <target name="build-classes-javah" depends="build-classes-javadoc"> |
jjg@436 | 633 | <build-classes includes="${javah.includes}"/> |
duke@1 | 634 | </target> |
jjg@371 | 635 | |
duke@1 | 636 | <!-- (no javadoc for javah) --> |
duke@1 | 637 | |
duke@1 | 638 | <target name="jtreg-javah" depends="build-javah,-def-jtreg"> |
jjg@371 | 639 | <jtreg-tool name="javah" tests="${javah.tests}"/> |
duke@1 | 640 | </target> |
jjg@371 | 641 | |
duke@1 | 642 | <target name="findbugs-javah" depends="build-javah,-def-findbugs"> |
duke@1 | 643 | <findbugs-tool name="javah"/> |
duke@1 | 644 | </target> |
jjg@371 | 645 | |
duke@1 | 646 | <target name="javah" depends="build-javah,jtreg-javah,findbugs-javah"/> |
jjg@371 | 647 | |
jjg@579 | 648 | |
jjg@579 | 649 | <!-- |
jjg@579 | 650 | **** javap targets. |
jjg@579 | 651 | --> |
duke@1 | 652 | |
jjg@436 | 653 | <target name="build-bootstrap-javap" |
jjg@436 | 654 | depends="-def-build-bootstrap-classes,-def-build-bootstrap-jar,-def-build-bootstrap-tool"> |
jjg@436 | 655 | <build-bootstrap-classes includes="${javap.includes}"/> |
jjg@436 | 656 | <build-bootstrap-jar name="javap" includes="${javap.includes}" |
jjg@436 | 657 | jarmainclass="sun.tools.javap.Main"/> |
jjg@436 | 658 | <build-bootstrap-tool name="javap"/> |
duke@1 | 659 | </target> |
jjg@371 | 660 | |
jjg@46 | 661 | <target name="build-classes-javap" depends="build-classes-javac"> |
jjg@436 | 662 | <build-classes includes="${javap.includes}"/> |
duke@1 | 663 | </target> |
jjg@371 | 664 | |
jjg@436 | 665 | <target name="build-javap" depends="build-javac,build-classes-javap"> |
jjg@436 | 666 | <build-jar name="javap" includes="${javap.includes}" |
jjg@291 | 667 | jarmainclass="com.sun.tools.javap.Main" |
jjg@46 | 668 | jarclasspath="javac.jar"/> |
jjg@436 | 669 | <build-tool name="javap"/> |
duke@1 | 670 | </target> |
jjg@371 | 671 | |
duke@1 | 672 | <!-- (no javadoc for javap) --> |
duke@1 | 673 | |
duke@1 | 674 | <target name="jtreg-javap" depends="build-javap,-def-jtreg"> |
jjg@371 | 675 | <jtreg-tool name="javap" tests="${javap.tests}"/> |
duke@1 | 676 | </target> |
jjg@371 | 677 | |
duke@1 | 678 | <target name="findbugs-javap" depends="build-javap,-def-findbugs"> |
duke@1 | 679 | <findbugs-tool name="javap"/> |
duke@1 | 680 | </target> |
jjg@371 | 681 | |
duke@1 | 682 | <target name="javap" depends="build-javap,jtreg-javap,findbugs-javap"/> |
jjg@371 | 683 | |
ohrstrom@1504 | 684 | <!-- |
ohrstrom@1504 | 685 | **** sjavac targets. |
ohrstrom@1504 | 686 | --> |
ohrstrom@1504 | 687 | |
ohrstrom@1504 | 688 | <target name="build-bootstrap-sjavac" |
ohrstrom@1504 | 689 | depends="-def-build-bootstrap-classes,-def-build-bootstrap-jar,-def-build-bootstrap-tool"> |
ohrstrom@1504 | 690 | <build-bootstrap-classes includes="${sjavac.includes}"/> |
ohrstrom@1504 | 691 | <build-bootstrap-jar name="sjavac" includes="${sjavac.includes}" |
ohrstrom@1504 | 692 | jarmainclass="com.sun.tools.sjavac.Main"/> |
ohrstrom@1504 | 693 | <build-bootstrap-tool name="sjavac"/> |
ohrstrom@1504 | 694 | </target> |
ohrstrom@1504 | 695 | |
ohrstrom@1504 | 696 | <target name="build-classes-sjavac" depends="build-classes-javac"> |
ohrstrom@1504 | 697 | <build-classes includes="${sjavac.includes}"/> |
ohrstrom@1504 | 698 | </target> |
ohrstrom@1504 | 699 | |
ohrstrom@1504 | 700 | <target name="build-sjavac" depends="build-classes-sjavac"> |
ohrstrom@1504 | 701 | <build-jar name="sjavac" includes="${sjavac.includes}" |
ohrstrom@1504 | 702 | jarmainclass="com.sun.tools.sjavac.Main" |
ohrstrom@1504 | 703 | jarclasspath="sjavac.jar"/> |
ohrstrom@1504 | 704 | <build-tool name="sjavac"/> |
ohrstrom@1504 | 705 | </target> |
jjg@1647 | 706 | |
ohrstrom@1504 | 707 | <!-- (no javadoc for javap) --> |
ohrstrom@1504 | 708 | |
ohrstrom@1504 | 709 | <target name="jtreg-sjavac" depends="build-sjavac,-def-jtreg"> |
ohrstrom@1504 | 710 | <jtreg-tool name="sjavac" tests="${sjavac.tests}"/> |
ohrstrom@1504 | 711 | </target> |
ohrstrom@1504 | 712 | |
ohrstrom@1504 | 713 | <target name="findbugs-sjavac" depends="build-sjavac,-def-findbugs"> |
ohrstrom@1504 | 714 | <findbugs-tool name="sjavac"/> |
ohrstrom@1504 | 715 | </target> |
ohrstrom@1504 | 716 | |
ohrstrom@1504 | 717 | <target name="sjavac" depends="build-sjavac,jtreg-sjavac,findbugs-sjavac"/> |
jjg@579 | 718 | |
jjg@579 | 719 | <!-- |
vromero@1714 | 720 | **** crules targets. |
vromero@1714 | 721 | --> |
vromero@1714 | 722 | |
vromero@1714 | 723 | <target name="build-crules" depends="-def-compilecrules,-def-build-jar-with-services"> |
vromero@1714 | 724 | <compilecrules/> |
vromero@1714 | 725 | <build-jar-with-services |
vromero@1714 | 726 | name="crules" |
vromero@1714 | 727 | includes="crules/* crules/resources/*" |
vromero@1714 | 728 | classes.dir="${build.toolclasses.dir}" |
vromero@1714 | 729 | lib.dir="${build.toolclasses.dir}" |
vromero@1714 | 730 | jarmainclass="" |
vromero@1714 | 731 | jarclasspath="crules.jar" |
vromero@1714 | 732 | service.type="com.sun.source.util.Plugin" |
vromero@1714 | 733 | service.provider="crules.MutableFieldsAnalyzer"/> |
vromero@1714 | 734 | <build-tool name="crules"/> |
vromero@1714 | 735 | </target> |
vromero@1714 | 736 | |
vromero@1714 | 737 | <target name="check-coding-rules" depends="build-bootstrap-javac,-create-import-jdk-stubs,build-crules"> |
vromero@1714 | 738 | <build-classes includes="${javac.includes}" |
vromero@1714 | 739 | plugin.options="-J-Xbootclasspath/a:${build.toolclasses.dir}/crules.jar -Xplugin:mutable_fields_analyzer" /> |
vromero@1714 | 740 | </target> |
vromero@1714 | 741 | |
vromero@1714 | 742 | <!-- |
jjg@579 | 743 | **** Create import JDK stubs. |
jjg@579 | 744 | --> |
jjg@579 | 745 | |
jjg@579 | 746 | <target name="-create-import-jdk-stubs" depends="-def-genstubs" if="require.import.jdk.stubs"> |
jjg@441 | 747 | <mkdir dir="${build.genstubs.dir}"/> |
jjg@441 | 748 | <genstubs |
jjg@441 | 749 | srcdir="${import.jdk.src.dir}" destdir="${build.genstubs.dir}" |
jjg@441 | 750 | includes="${import.jdk.stub.files}" |
jjg@680 | 751 | fork="true" classpath="${build.toolclasses.dir}:${build.bootstrap.dir}/classes:${ant.core.lib}" |
jjg@441 | 752 | /> |
jjg@441 | 753 | </target> |
jjg@441 | 754 | |
jjg@579 | 755 | |
jjg@579 | 756 | <!-- |
jjg@579 | 757 | **** Check targets. |
jjg@579 | 758 | **** "-check-*" targets check that a required property is set, and set to a reasonable value. |
jjg@579 | 759 | **** A user friendly message is generated if not, and the build exits. |
jjg@579 | 760 | --> |
jjg@371 | 761 | |
duke@1 | 762 | <target name="-check-boot.java.home" depends="-def-check"> |
duke@1 | 763 | <check name="bootstrap java" property="boot.java.home" marker="${java.marker}"/> |
duke@1 | 764 | </target> |
jjg@371 | 765 | |
duke@1 | 766 | <target name="-check-target.java.home" depends="-def-check"> |
duke@1 | 767 | <check name="target java" property="target.java.home" marker="${java.marker}"/> |
duke@1 | 768 | </target> |
jjg@371 | 769 | |
duke@1 | 770 | <target name="-check-cobertura.home" depends="-def-check"> |
duke@1 | 771 | <check name="cobertura" property="cobertura.home" marker="cobertura.jar"/> |
duke@1 | 772 | </target> |
jjg@371 | 773 | |
duke@1 | 774 | <target name="-check-findbugs.home" depends="-def-check"> |
duke@1 | 775 | <check name="findbugs" property="findbugs.home" marker="lib/findbugs.jar"/> |
duke@1 | 776 | </target> |
jjg@371 | 777 | |
ksrini@1137 | 778 | <target name="-check-checkstyle.home" depends="-def-check"> |
ksrini@1137 | 779 | <check name="checkstyle" property="checkstyle.home" marker="${checkstyle.name.version}.jar"/> |
ksrini@1137 | 780 | </target> |
jjg@1409 | 781 | |
duke@1 | 782 | <target name="-check-jtreg.home" depends="-def-check"> |
duke@1 | 783 | <check name="jtreg" property="jtreg.home" marker="lib/jtreg.jar"/> |
duke@1 | 784 | </target> |
jjg@371 | 785 | |
jjg@578 | 786 | <target name="-check-vizant" depends="-def-check"> |
jjg@578 | 787 | <check name="vizant" property="vizant.jar"/> |
jjg@578 | 788 | <check name="dot" property="dot"/> |
jjg@578 | 789 | </target> |
jjg@578 | 790 | |
jjg@579 | 791 | |
jjg@579 | 792 | <!-- |
jjg@579 | 793 | **** Targets for Ant macro and task definitions. |
jjg@579 | 794 | --> |
duke@1 | 795 | |
jjg@436 | 796 | <target name="-def-build-tool"> |
duke@1 | 797 | <macrodef name="build-tool"> |
duke@1 | 798 | <attribute name="name"/> |
duke@1 | 799 | <attribute name="bin.dir" default="${dist.bin.dir}"/> |
jjg@370 | 800 | <attribute name="java" default="${launcher.java}"/> |
duke@1 | 801 | <sequential> |
duke@1 | 802 | <mkdir dir="@{bin.dir}"/> |
duke@1 | 803 | <copy file="${src.bin.dir}/launcher.sh-template" tofile="@{bin.dir}/@{name}"> |
duke@1 | 804 | <filterset begintoken="#" endtoken="#"> |
jjg@371 | 805 | <filter token="PROGRAM" value="@{name}"/> |
jjg@371 | 806 | <filter token="TARGET_JAVA" value="@{java}"/> |
jjg@656 | 807 | <filter token="PS" value="${path.separator}"/> |
duke@1 | 808 | </filterset> |
duke@1 | 809 | </copy> |
duke@1 | 810 | <chmod file="@{bin.dir}/@{name}" perm="ugo+rx"/> |
duke@1 | 811 | </sequential> |
duke@1 | 812 | </macrodef> |
duke@1 | 813 | </target> |
duke@1 | 814 | |
jjg@436 | 815 | <target name="-def-build-jar"> |
duke@1 | 816 | <macrodef name="build-jar"> |
duke@1 | 817 | <attribute name="name"/> |
duke@1 | 818 | <attribute name="includes"/> |
duke@1 | 819 | <attribute name="classes.dir" default="${build.classes.dir}"/> |
duke@1 | 820 | <attribute name="lib.dir" default="${dist.lib.dir}"/> |
duke@1 | 821 | <attribute name="jarmainclass" default="com.sun.tools.@{name}.Main"/> |
duke@1 | 822 | <attribute name="jarclasspath" default=""/> |
duke@1 | 823 | <sequential> |
duke@1 | 824 | <mkdir dir="@{lib.dir}"/> |
duke@1 | 825 | <jar destfile="@{lib.dir}/@{name}.jar" |
duke@1 | 826 | basedir="@{classes.dir}" |
duke@1 | 827 | includes="@{includes}"> |
jjg@371 | 828 | <manifest> |
duke@1 | 829 | <attribute name="Main-Class" value="@{jarmainclass}"/> |
duke@1 | 830 | <attribute name="Class-Path" value="@{jarclasspath}"/> |
duke@1 | 831 | </manifest> |
duke@1 | 832 | </jar> |
duke@1 | 833 | </sequential> |
duke@1 | 834 | </macrodef> |
duke@1 | 835 | </target> |
duke@1 | 836 | |
vromero@1714 | 837 | <target name="-def-build-jar-with-services"> |
vromero@1714 | 838 | <macrodef name="build-jar-with-services"> |
vromero@1714 | 839 | <attribute name="name"/> |
vromero@1714 | 840 | <attribute name="includes"/> |
vromero@1714 | 841 | <attribute name="classes.dir" default="${build.classes.dir}"/> |
vromero@1714 | 842 | <attribute name="lib.dir" default="${dist.lib.dir}"/> |
vromero@1714 | 843 | <attribute name="jarmainclass" default="com.sun.tools.@{name}.Main"/> |
vromero@1714 | 844 | <attribute name="jarclasspath" default=""/> |
vromero@1714 | 845 | <attribute name="service.type" default=""/> |
vromero@1714 | 846 | <attribute name="service.provider" default=""/> |
vromero@1714 | 847 | <sequential> |
vromero@1714 | 848 | <mkdir dir="${build.toolclasses.dir}"/> |
vromero@1714 | 849 | <jar destfile="@{lib.dir}/@{name}.jar" |
vromero@1714 | 850 | basedir="@{classes.dir}" |
vromero@1714 | 851 | includes="@{includes}"> |
vromero@1714 | 852 | <service type="@{service.type}" provider="@{service.provider}"/> |
vromero@1714 | 853 | <manifest> |
vromero@1714 | 854 | <attribute name="Main-Class" value="@{jarmainclass}"/> |
vromero@1714 | 855 | <attribute name="Class-Path" value="@{jarclasspath}"/> |
vromero@1714 | 856 | </manifest> |
vromero@1714 | 857 | </jar> |
vromero@1714 | 858 | </sequential> |
vromero@1714 | 859 | </macrodef> |
vromero@1714 | 860 | </target> |
vromero@1714 | 861 | |
duke@1 | 862 | <target name="-def-build-classes" depends="-def-pcompile"> |
duke@1 | 863 | <macrodef name="build-classes"> |
duke@1 | 864 | <attribute name="includes"/> |
jjg@441 | 865 | <attribute name="excludes" default="${exclude.files} **/package-info.java"/> |
duke@1 | 866 | <attribute name="classes.dir" default="${build.classes.dir}"/> |
duke@1 | 867 | <attribute name="gensrc.dir" default="${build.gensrc.dir}"/> |
jjg@441 | 868 | <attribute name="javac.bootclasspath" default="${build.bootstrap.dir}/classes"/> |
jjg@441 | 869 | <attribute name="bootclasspath.opt" default="${javac.bootclasspath.opt}"/> |
jjg@441 | 870 | <attribute name="classpath" default="${javac.classpath}"/> |
jjg@441 | 871 | <attribute name="sourcepath" default="${javac.sourcepath}"/> |
jjg@436 | 872 | <attribute name="java.home" default="${boot.java.home}"/> |
jjg@436 | 873 | <attribute name="source" default="${javac.source}"/> |
jjg@436 | 874 | <attribute name="target" default="${javac.target}"/> |
duke@1 | 875 | <attribute name="release" default="${release}"/> |
duke@1 | 876 | <attribute name="full.version" default="${full.version}"/> |
vromero@1714 | 877 | <attribute name="plugin.options" default=""/> |
duke@1 | 878 | <sequential> |
jjg@441 | 879 | <echo level="verbose" message="build-classes: excludes=@{excludes}"/> |
jjg@441 | 880 | <echo level="verbose" message="build-classes: bootclasspath.opt=@{bootclasspath.opt}"/> |
jjg@441 | 881 | <echo level="verbose" message="build-classes: classpath=@{classpath}"/> |
jjg@441 | 882 | <echo level="verbose" message="build-classes: sourcepath=@{sourcepath}"/> |
duke@1 | 883 | <mkdir dir="@{gensrc.dir}"/> |
duke@1 | 884 | <mkdir dir="@{classes.dir}"/> |
duke@1 | 885 | <pcompile srcdir="${src.classes.dir}" |
duke@1 | 886 | destdir="@{gensrc.dir}" |
duke@1 | 887 | includes="@{includes}"/> |
duke@1 | 888 | <copy todir="@{gensrc.dir}"> |
jjg@46 | 889 | <fileset dir="${src.classes.dir}" includes="@{includes}"/> |
duke@1 | 890 | <globmapper from="*.properties-template" to="*.properties"/> |
duke@1 | 891 | <filterset begintoken="$(" endtoken=")"> |
duke@1 | 892 | <filter token="JDK_VERSION" value="${jdk.version}"/> |
duke@1 | 893 | <filter token="RELEASE" value="@{release}"/> |
duke@1 | 894 | <filter token="FULL_VERSION" value="@{full.version}"/> |
duke@1 | 895 | </filterset> |
duke@1 | 896 | </copy> |
duke@1 | 897 | <pcompile srcdir="@{gensrc.dir}" |
duke@1 | 898 | destdir="@{gensrc.dir}" |
duke@1 | 899 | includes="**/*.properties"/> |
duke@1 | 900 | <javac fork="true" |
jjg@436 | 901 | executable="@{java.home}/bin/javac" |
jjg@436 | 902 | srcdir="${src.classes.dir}:@{gensrc.dir}" |
duke@1 | 903 | destdir="@{classes.dir}" |
duke@1 | 904 | includes="@{includes}" |
duke@1 | 905 | excludes="@{excludes}" |
jjg@441 | 906 | sourcepath="@{sourcepath}" |
jjg@441 | 907 | classpath="@{classpath}" |
duke@1 | 908 | includeAntRuntime="no" |
jjg@436 | 909 | source="@{source}" |
jjg@436 | 910 | target="@{target}" |
jjg@371 | 911 | debug="${javac.debug}" |
duke@1 | 912 | debuglevel="${javac.debuglevel}"> |
jjg@441 | 913 | <compilerarg value="-implicit:none"/> |
jjg@441 | 914 | <compilerarg value="-Xprefer:source"/> |
jjg@441 | 915 | <compilerarg value="-J-Xbootclasspath/p:@{javac.bootclasspath}"/> |
jjg@441 | 916 | <compilerarg line="@{bootclasspath.opt}"/> |
duke@1 | 917 | <compilerarg line="${javac.no.jdk.warnings}"/> |
duke@1 | 918 | <compilerarg line="${javac.version.opt}"/> |
duke@1 | 919 | <compilerarg line="${javac.lint.opts}"/> |
vromero@1714 | 920 | <compilerarg line="@{plugin.options}"/> |
duke@1 | 921 | </javac> |
jjg@450 | 922 | <copy todir="@{classes.dir}" includeemptydirs="false"> |
jjg@450 | 923 | <fileset dir="${src.classes.dir}" includes="@{includes}" excludes="@{excludes}"> |
duke@1 | 924 | <exclude name="**/*.java"/> |
duke@1 | 925 | <exclude name="**/*.properties"/> |
duke@1 | 926 | <exclude name="**/*-template"/> |
jjg@945 | 927 | <exclude name="**/*.rej"/> |
jjg@945 | 928 | <exclude name="**/*.orig"/> |
jjg@945 | 929 | <exclude name="**/overview.html"/> |
duke@1 | 930 | <exclude name="**/package.html"/> |
duke@1 | 931 | </fileset> |
duke@1 | 932 | </copy> |
duke@1 | 933 | </sequential> |
duke@1 | 934 | </macrodef> |
duke@1 | 935 | </target> |
jjg@371 | 936 | |
duke@1 | 937 | <target name="-def-build-bootstrap-tool" depends="-check-boot.java.home,-def-build-tool"> |
duke@1 | 938 | <presetdef name="build-bootstrap-tool"> |
duke@1 | 939 | <build-tool |
duke@1 | 940 | bin.dir="${build.bootstrap.dir}/bin" |
jjg@436 | 941 | java="${boot.java}"/> |
duke@1 | 942 | </presetdef> |
duke@1 | 943 | </target> |
jjg@371 | 944 | |
duke@1 | 945 | <target name="-def-build-bootstrap-jar" depends="-def-build-jar"> |
duke@1 | 946 | <presetdef name="build-bootstrap-jar"> |
duke@1 | 947 | <build-jar |
jjg@436 | 948 | classes.dir="${build.bootstrap.dir}/classes" |
jjg@436 | 949 | lib.dir="${build.bootstrap.dir}/lib"/> |
jjg@436 | 950 | </presetdef> |
jjg@436 | 951 | </target> |
jjg@436 | 952 | |
jjg@436 | 953 | <target name="-def-build-bootstrap-classes" depends="-def-build-classes"> |
jjg@436 | 954 | <presetdef name="build-bootstrap-classes"> |
jjg@436 | 955 | <build-classes |
jjg@436 | 956 | source="${boot.javac.source}" |
jjg@436 | 957 | target="${boot.javac.target}" |
duke@1 | 958 | gensrc.dir="${build.bootstrap.dir}/gensrc" |
duke@1 | 959 | classes.dir="${build.bootstrap.dir}/classes" |
jjg@441 | 960 | javac.bootclasspath="" |
jjg@441 | 961 | bootclasspath.opt="-Xbootclasspath/p:${build.bootstrap.dir}/classes" |
jjg@441 | 962 | sourcepath="" |
duke@1 | 963 | release="${bootstrap.release}" |
jjg@441 | 964 | full.version="${bootstrap.full.version}" |
jjg@579 | 965 | excludes="${bootstrap.exclude.files} **/package-info.java"/> |
duke@1 | 966 | </presetdef> |
duke@1 | 967 | </target> |
jjg@371 | 968 | |
duke@1 | 969 | <target name="-def-pcompile"> |
duke@1 | 970 | <mkdir dir="${build.toolclasses.dir}"/> |
jjg@199 | 971 | <javac fork="true" |
andrew@374 | 972 | source="${boot.javac.source}" |
andrew@374 | 973 | target="${boot.javac.target}" |
jjg@199 | 974 | executable="${boot.java.home}/bin/javac" |
ohrstrom@1224 | 975 | srcdir="${make.tools.dir}" |
ohrstrom@1224 | 976 | includes="compileproperties/* anttasks/CompileProperties*" |
duke@1 | 977 | destdir="${build.toolclasses.dir}/" |
jjg@680 | 978 | classpath="${ant.core.lib}" |
jjg@1045 | 979 | bootclasspath="${boot.java.home}/jre/lib/rt.jar" |
jjg@1045 | 980 | includeantruntime="false"> |
jjg@1045 | 981 | <compilerarg line="${javac.lint.opts}"/> |
jjg@1045 | 982 | </javac> |
duke@1 | 983 | <taskdef name="pcompile" |
ohrstrom@1224 | 984 | classname="anttasks.CompilePropertiesTask" |
duke@1 | 985 | classpath="${build.toolclasses.dir}/"/> |
duke@1 | 986 | </target> |
jjg@371 | 987 | |
vromero@1714 | 988 | <target name="-def-compilecrules"> |
vromero@1714 | 989 | <macrodef name="compilecrules"> |
vromero@1714 | 990 | <sequential> |
vromero@1714 | 991 | <mkdir dir="${build.toolclasses.dir}"/> |
vromero@1714 | 992 | <javac fork="true" |
vromero@1714 | 993 | source="${boot.javac.source}" |
vromero@1714 | 994 | target="${boot.javac.target}" |
vromero@1714 | 995 | executable="${boot.java.home}/bin/javac" |
vromero@1714 | 996 | srcdir="${make.tools.dir}" |
vromero@1714 | 997 | includes="crules/*" |
vromero@1714 | 998 | destdir="${build.toolclasses.dir}/" |
vromero@1714 | 999 | classpath="${ant.core.lib}" |
vromero@1714 | 1000 | bootclasspath="${boot.java.home}/jre/lib/rt.jar" |
vromero@1714 | 1001 | includeantruntime="false"> |
vromero@1714 | 1002 | <compilerarg value="-Xbootclasspath/p:${build.bootstrap.dir}/classes"/> |
vromero@1714 | 1003 | <compilerarg line="${javac.lint.opts}"/> |
vromero@1714 | 1004 | </javac> |
vromero@1714 | 1005 | <copy todir="${build.toolclasses.dir}/" includeemptydirs="false"> |
vromero@1714 | 1006 | <fileset dir="${make.tools.dir}"> |
vromero@1714 | 1007 | <include name="**/*.properties"/> |
vromero@1714 | 1008 | </fileset> |
vromero@1714 | 1009 | </copy> |
vromero@1714 | 1010 | </sequential> |
vromero@1714 | 1011 | </macrodef> |
vromero@1714 | 1012 | </target> |
vromero@1714 | 1013 | |
jjg@579 | 1014 | <target name="-def-genstubs" depends="build-bootstrap-javac" if="require.import.jdk.stubs"> |
jjg@441 | 1015 | <mkdir dir="${build.toolclasses.dir}"/> |
jjg@441 | 1016 | <javac fork="true" |
jjg@441 | 1017 | source="${boot.javac.source}" |
jjg@441 | 1018 | target="${boot.javac.target}" |
jjg@441 | 1019 | executable="${boot.java.home}/bin/javac" |
ohrstrom@1224 | 1020 | srcdir="${make.tools.dir}" |
ohrstrom@1224 | 1021 | includes="genstubs/* anttasks/GenStubs*" |
jjg@441 | 1022 | destdir="${build.toolclasses.dir}/" |
jjg@873 | 1023 | classpath="${ant.core.lib}" |
jjg@873 | 1024 | includeantruntime="false"> |
jjg@873 | 1025 | <compilerarg value="-Xbootclasspath/p:${build.bootstrap.dir}/classes"/> |
jjg@1045 | 1026 | <compilerarg line="${javac.lint.opts}"/> |
jjg@873 | 1027 | </javac> |
jjg@441 | 1028 | <taskdef name="genstubs" |
ohrstrom@1224 | 1029 | classname="anttasks.GenStubsTask" |
jjg@441 | 1030 | classpath="${build.toolclasses.dir}/"/> |
jjg@441 | 1031 | </target> |
jjg@441 | 1032 | |
duke@1 | 1033 | <target name="-def-javadoc-tool" depends="-check-target.java.home"> |
duke@1 | 1034 | <macrodef name="javadoc-tool"> |
duke@1 | 1035 | <attribute name="name"/> |
duke@1 | 1036 | <attribute name="includes"/> |
duke@1 | 1037 | <attribute name="options" default=""/> |
duke@1 | 1038 | <attribute name="source" default="1.5"/> <!-- FIXME --> |
duke@1 | 1039 | <sequential> |
duke@1 | 1040 | <property name="javadoc.options" value=""/> <!-- default, can be overridden per user or per project --> |
duke@1 | 1041 | <!-- Note: even with this default value, includes |
jjg@579 | 1042 | from src.classes.dir get javadoc'd; see packageset below --> |
duke@1 | 1043 | <property name="javadoc.packagenames" value="none"/> <!-- default, can be overridden per user or per project --> |
jjg@371 | 1044 | <javadoc |
duke@1 | 1045 | executable="${target.java.home}/bin/javadoc" |
jjg@371 | 1046 | destdir="${build.javadoc.dir}/@{name}" |
duke@1 | 1047 | source="@{source}" |
jjg@371 | 1048 | windowtitle="UNOFFICIAL" |
jjg@371 | 1049 | failonerror="true" |
duke@1 | 1050 | use="true" |
jjg@371 | 1051 | author="false" |
duke@1 | 1052 | version="false" |
duke@1 | 1053 | packagenames="${javadoc.packagenames}" > |
duke@1 | 1054 | <header><![CDATA[<strong>Unofficial Javadoc</strong> generated from developer sources for preview purposes only]]></header> |
duke@1 | 1055 | <arg line="@{options}"/> |
duke@1 | 1056 | <bootclasspath> |
duke@1 | 1057 | <path location="${build.classes.dir}"/> |
duke@1 | 1058 | <path location="${target.java.home}/jre/lib/rt.jar"/> |
duke@1 | 1059 | </bootclasspath> |
duke@1 | 1060 | <sourcepath> |
duke@1 | 1061 | <pathelement location="${src.classes.dir}"/> |
duke@1 | 1062 | </sourcepath> |
duke@1 | 1063 | <!-- XXX just <fileset> (restricted further to **/*.java) and no <packageset> --> |
duke@1 | 1064 | <!-- means that {@link some.package} will not work, which is no good. --> |
duke@1 | 1065 | <!-- (It correctly skips excluded single classes, but not if packageset is also included, --> |
duke@1 | 1066 | <!-- which also causes duplicates in the class index for included files.) --> |
duke@1 | 1067 | <packageset dir="${src.classes.dir}" includes="@{includes}"> |
duke@1 | 1068 | <or> |
duke@1 | 1069 | <filename name="java/"/> |
duke@1 | 1070 | <filename name="javax/"/> |
duke@1 | 1071 | <filename name="com/sun/javadoc/"/> |
duke@1 | 1072 | <filename name="com/sun/source/"/> |
duke@1 | 1073 | </or> |
duke@1 | 1074 | </packageset> |
duke@1 | 1075 | </javadoc> |
duke@1 | 1076 | </sequential> |
duke@1 | 1077 | </macrodef> |
duke@1 | 1078 | </target> |
jjg@371 | 1079 | |
jjg@371 | 1080 | <target name="-def-jtreg" unless="jtreg.defined" depends="-check-jtreg.home,-check-target.java.home"> |
duke@1 | 1081 | <taskdef name="jtreg" classname="com.sun.javatest.regtest.Main$$Ant"> |
duke@1 | 1082 | <classpath> |
duke@1 | 1083 | <pathelement location="${jtreg.home}/lib/jtreg.jar"/> |
duke@1 | 1084 | <pathelement location="${jtreg.home}/lib/javatest.jar"/> |
duke@1 | 1085 | </classpath> |
duke@1 | 1086 | </taskdef> |
duke@1 | 1087 | <macrodef name="jtreg-tool"> |
duke@1 | 1088 | <attribute name="name"/> |
duke@1 | 1089 | <attribute name="tests"/> |
duke@1 | 1090 | <attribute name="jdk" default="${target.java.home}"/> |
jjg@371 | 1091 | <attribute name="samevm" default="true"/> |
jjg@583 | 1092 | <attribute name="verbose" default="${default.jtreg.verbose}"/> |
jjg@583 | 1093 | <attribute name="options" default="${other.jtreg.options}"/> |
duke@1 | 1094 | <attribute name="keywords" default="-keywords:!ignore"/> |
duke@1 | 1095 | <attribute name="jpda.jvmargs" default=""/> |
duke@1 | 1096 | <sequential> |
jjg@583 | 1097 | <property name="coverage.options" value=""/> <!-- default --> |
jjg@583 | 1098 | <property name="coverage.classpath" value=""/> <!-- default --> |
jjg@583 | 1099 | <property name="default.jtreg.verbose" value="summary"/> <!-- default --> |
jjg@583 | 1100 | <property name="other.jtreg.options" value=""/> <!-- default --> |
jjg@371 | 1101 | <jtreg |
duke@1 | 1102 | dir="${test.dir}" |
jjg@371 | 1103 | workDir="${build.jtreg.dir}/@{name}/work" |
duke@1 | 1104 | reportDir="${build.jtreg.dir}/@{name}/report" |
duke@1 | 1105 | jdk="@{jdk}" |
duke@1 | 1106 | samevm="@{samevm}" verbose="@{verbose}" |
duke@1 | 1107 | failonerror="false" resultproperty="jtreg.@{name}.result" |
duke@1 | 1108 | javacoptions="-g" |
jjg@1196 | 1109 | vmoptions="${coverage.options} -Xbootclasspath/p:${coverage.classpath}${path.separator}${build.classes.dir} @{jpda.jvmargs}"> |
duke@1 | 1110 | <arg line="@{keywords}"/> |
duke@1 | 1111 | <arg line="@{options}"/> |
duke@1 | 1112 | <arg line="@{tests}"/> |
duke@1 | 1113 | </jtreg> |
jjg@371 | 1114 | <!-- the next two properties are for convenience, when only |
duke@1 | 1115 | a single instance of jtreg will be invoked. --> |
duke@1 | 1116 | <condition property="jtreg.passed"> |
jjg@201 | 1117 | <equals arg1="${jtreg.@{name}.result}" arg2="0"/> |
duke@1 | 1118 | </condition> |
duke@1 | 1119 | <property name="jtreg.report" value="${build.jtreg.dir}/@{name}/report"/> |
duke@1 | 1120 | </sequential> |
duke@1 | 1121 | </macrodef> |
duke@1 | 1122 | <property name="jtreg.defined" value="true"/> |
duke@1 | 1123 | </target> |
duke@1 | 1124 | |
duke@1 | 1125 | <target name="-def-cobertura" depends="-check-cobertura.home"> |
duke@1 | 1126 | <path id="cobertura.classpath"> |
duke@1 | 1127 | <fileset dir="${cobertura.home}"> |
duke@1 | 1128 | <include name="cobertura.jar"/> |
duke@1 | 1129 | <include name="lib/**/*.jar"/> |
duke@1 | 1130 | </fileset> |
duke@1 | 1131 | </path> |
jjg@371 | 1132 | <taskdef classpathref="cobertura.classpath" resource="tasks.properties"/> |
duke@1 | 1133 | </target> |
jjg@371 | 1134 | |
ksrini@1137 | 1135 | <target name="-def-checkstyle" unless="checkstyle.defined" |
ksrini@1137 | 1136 | depends="-check-checkstyle.home"> |
ksrini@1137 | 1137 | <taskdef resource="checkstyletask.properties"> |
ksrini@1137 | 1138 | <classpath> |
ksrini@1137 | 1139 | <pathelement location="${checkstyle.home}/${checkstyle.name.version}-all.jar"/> |
ksrini@1137 | 1140 | </classpath> |
ksrini@1137 | 1141 | </taskdef> |
ksrini@1137 | 1142 | <property name="checkstyle.defined" value="true"/> |
ksrini@1137 | 1143 | </target> |
jjg@1409 | 1144 | |
jjg@681 | 1145 | <target name="-def-findbugs" unless="findbugs.defined" |
jjg@681 | 1146 | depends="-check-findbugs.home,-check-target.java.home"> |
duke@1 | 1147 | <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"> |
duke@1 | 1148 | <classpath> |
duke@1 | 1149 | <pathelement location="${findbugs.home}/lib/findbugs.jar"/> |
duke@1 | 1150 | </classpath> |
duke@1 | 1151 | </taskdef> |
duke@1 | 1152 | <macrodef name="findbugs-tool"> |
duke@1 | 1153 | <attribute name="name"/> |
duke@1 | 1154 | <attribute name="output" default="emacs"/> |
duke@1 | 1155 | <attribute name="outputFile" default=""/> |
duke@1 | 1156 | <attribute name="reportLevel" default="high"/> |
duke@1 | 1157 | <sequential> |
jjg@371 | 1158 | <findbugs |
duke@1 | 1159 | home="${findbugs.home}" |
duke@1 | 1160 | output="@{output}" |
duke@1 | 1161 | outputFile="@{outputFile}" |
duke@1 | 1162 | reportLevel="@{reportLevel}" |
duke@1 | 1163 | failOnError="false" |
duke@1 | 1164 | errorProperty="findbugs.@{name}.errors" |
duke@1 | 1165 | warningsProperty="findbugs.@{name}.warnings" |
jjg@681 | 1166 | jvm="${target.java.home}/bin/java" |
duke@1 | 1167 | jvmargs="-Xmx512M" > |
duke@1 | 1168 | <class location="${dist.dir}/lib/@{name}.jar"/> |
duke@1 | 1169 | <auxClasspath> |
duke@1 | 1170 | <pathelement location="${build.classes.dir}"/> |
duke@1 | 1171 | </auxClasspath> |
duke@1 | 1172 | <sourcePath> |
duke@1 | 1173 | <pathelement location="${src.classes.dir}"/> |
duke@1 | 1174 | </sourcePath> |
duke@1 | 1175 | </findbugs> |
duke@1 | 1176 | </sequential> |
duke@1 | 1177 | </macrodef> |
duke@1 | 1178 | <property name="findbugs.defined" value="true"/> |
duke@1 | 1179 | </target> |
jjg@579 | 1180 | |
jjg@578 | 1181 | <target name="-def-vizant" unless="vizant.defined" depends="-check-vizant"> |
jjg@579 | 1182 | <taskdef name="vizant" classname="net.sourceforge.vizant.Vizant" classpath="${vizant.jar}"/> |
jjg@578 | 1183 | <property name="vizant.defined" value="true"/> |
jjg@578 | 1184 | </target> |
jjg@371 | 1185 | |
duke@1 | 1186 | <target name="-def-check"> |
duke@1 | 1187 | <macrodef name="check"> |
duke@1 | 1188 | <attribute name="name"/> |
duke@1 | 1189 | <attribute name="property"/> |
jjg@578 | 1190 | <attribute name="marker" default=""/> |
duke@1 | 1191 | <sequential> |
duke@1 | 1192 | <fail message="Cannot locate @{name}: please set @{property} to its location"> |
duke@1 | 1193 | <condition> |
duke@1 | 1194 | <not> |
duke@1 | 1195 | <isset property="@{property}"/> |
duke@1 | 1196 | </not> |
duke@1 | 1197 | </condition> |
duke@1 | 1198 | </fail> |
duke@1 | 1199 | <fail message="@{name} is not installed in ${@{property}}"> |
duke@1 | 1200 | <condition> |
jjg@579 | 1201 | <and> |
jjg@579 | 1202 | <not> |
jjg@579 | 1203 | <equals arg1="@{marker}" arg2=""/> |
jjg@579 | 1204 | </not> |
jjg@578 | 1205 | <not> |
jjg@578 | 1206 | <available file="${@{property}}/@{marker}"/> |
jjg@578 | 1207 | </not> |
jjg@579 | 1208 | </and> |
duke@1 | 1209 | </condition> |
duke@1 | 1210 | </fail> |
duke@1 | 1211 | </sequential> |
duke@1 | 1212 | </macrodef> |
duke@1 | 1213 | </target> |
duke@1 | 1214 | |
duke@1 | 1215 | </project> |
duke@1 | 1216 |