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