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