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