make/build.xml

Mon, 15 Apr 2013 14:16:05 +0100

author
mcimadamore
date
Mon, 15 Apr 2013 14:16:05 +0100
changeset 1695
6dacab087652
parent 1647
578eb3dd111d
child 1714
f3f3ac1273e8
permissions
-rw-r--r--

8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
Summary: Fix bug in Types.removeWildcards
Reviewed-by: jjg

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

mercurial