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