langtools/make/build.xml
author jjg
Thu, 22 Jan 2009 15:45:44 -0800
changeset 1872 9820a8bee1e5
parent 1871 9bb6518238ff
child 1873 658385834998
permissions -rw-r--r--
6796965: dev-time wrapper script for javac broken Reviewed-by: ksrini
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
<!--
735
372aa565a221 6719955: Update copyright year
xdono
parents: 727
diff changeset
     3
 Copyright 2007-2008 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}"/>
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   396
            <attribute name="javac.target" default="${javac.target}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   397
            <attribute name="jarmainclass" default="com.sun.tools.@{name}.Main"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   398
            <attribute name="jarclasspath" default=""/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   399
            <attribute name="release" default="${release}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   400
            <attribute name="full.version" default="${full.version}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   401
            <sequential>
06bc494ca11e Initial load
duke
parents:
diff changeset
   402
                <build-jar
06bc494ca11e Initial load
duke
parents:
diff changeset
   403
                    name="@{name}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   404
                    gensrc.dir="@{gensrc.dir}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   405
                    classes.dir="@{classes.dir}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   406
                    lib.dir="@{lib.dir}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   407
                    includes="@{includes}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   408
                    excludes="@{excludes}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   409
                    jarmainclass="@{jarmainclass}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   410
                    jarclasspath="@{jarclasspath}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   411
                    release="@{release}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   412
                    full.version="@{full.version}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   413
                    javac.bootclasspath="@{javac.bootclasspath}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   414
                    javac.target="@{javac.target}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   415
                />
06bc494ca11e Initial load
duke
parents:
diff changeset
   416
                <mkdir dir="@{bin.dir}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   417
                <copy file="${src.bin.dir}/launcher.sh-template" tofile="@{bin.dir}/@{name}">
06bc494ca11e Initial load
duke
parents:
diff changeset
   418
                    <filterset begintoken="#" endtoken="#">
06bc494ca11e Initial load
duke
parents:
diff changeset
   419
                        <filter token="PROGRAM" value="@{name}"/> 
06bc494ca11e Initial load
duke
parents:
diff changeset
   420
                        <filter token="TARGET_JAVA" value="@{java}"/> 
06bc494ca11e Initial load
duke
parents:
diff changeset
   421
                    </filterset>
06bc494ca11e Initial load
duke
parents:
diff changeset
   422
                </copy>
06bc494ca11e Initial load
duke
parents:
diff changeset
   423
                <chmod file="@{bin.dir}/@{name}" perm="ugo+rx"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   424
            </sequential>
06bc494ca11e Initial load
duke
parents:
diff changeset
   425
        </macrodef>
06bc494ca11e Initial load
duke
parents:
diff changeset
   426
    </target>
06bc494ca11e Initial load
duke
parents:
diff changeset
   427
06bc494ca11e Initial load
duke
parents:
diff changeset
   428
    <target name="-def-build-jar" depends="-def-build-classes">
06bc494ca11e Initial load
duke
parents:
diff changeset
   429
        <macrodef name="build-jar">
06bc494ca11e Initial load
duke
parents:
diff changeset
   430
            <attribute name="name"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   431
            <attribute name="includes"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   432
            <attribute name="excludes" default="**/package-info.java"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   433
            <attribute name="classes.dir" default="${build.classes.dir}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   434
            <attribute name="gensrc.dir" default="${build.gensrc.dir}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   435
            <attribute name="lib.dir" default="${dist.lib.dir}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   436
            <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
   437
            <attribute name="javac.java.home" default="${boot.java.home}"/>
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   438
            <attribute name="javac.target" default="${javac.target}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   439
            <attribute name="jarmainclass" default="com.sun.tools.@{name}.Main"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   440
            <attribute name="jarclasspath" default=""/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   441
            <attribute name="release" default="${release}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   442
            <attribute name="full.version" default="${full.version}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   443
            <sequential>
06bc494ca11e Initial load
duke
parents:
diff changeset
   444
                <build-classes
06bc494ca11e Initial load
duke
parents:
diff changeset
   445
                    name="@{name}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   446
                    gensrc.dir="@{gensrc.dir}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   447
                    classes.dir="@{classes.dir}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   448
                    includes="@{includes}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   449
                    excludes="@{excludes}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   450
                    release="@{release}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   451
                    full.version="@{full.version}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   452
                    javac.bootclasspath="@{javac.bootclasspath}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   453
                    javac.target="@{javac.target}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   454
                />
06bc494ca11e Initial load
duke
parents:
diff changeset
   455
                <mkdir dir="@{lib.dir}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   456
                <jar destfile="@{lib.dir}/@{name}.jar"
06bc494ca11e Initial load
duke
parents:
diff changeset
   457
                     basedir="@{classes.dir}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   458
                     includes="@{includes}">
06bc494ca11e Initial load
duke
parents:
diff changeset
   459
                    <manifest>    
06bc494ca11e Initial load
duke
parents:
diff changeset
   460
                        <attribute name="Main-Class" value="@{jarmainclass}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   461
                        <attribute name="Class-Path" value="@{jarclasspath}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   462
                    </manifest>
06bc494ca11e Initial load
duke
parents:
diff changeset
   463
                </jar>
06bc494ca11e Initial load
duke
parents:
diff changeset
   464
            </sequential>
06bc494ca11e Initial load
duke
parents:
diff changeset
   465
        </macrodef>
06bc494ca11e Initial load
duke
parents:
diff changeset
   466
    </target>
06bc494ca11e Initial load
duke
parents:
diff changeset
   467
06bc494ca11e Initial load
duke
parents:
diff changeset
   468
    <target name="-def-build-classes" depends="-def-pcompile">
06bc494ca11e Initial load
duke
parents:
diff changeset
   469
        <macrodef name="build-classes">
06bc494ca11e Initial load
duke
parents:
diff changeset
   470
            <attribute name="name"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   471
            <attribute name="includes"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   472
            <attribute name="excludes" default="**/package-info.java"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   473
            <attribute name="classes.dir" default="${build.classes.dir}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   474
            <attribute name="gensrc.dir" default="${build.gensrc.dir}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   475
            <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
   476
            <attribute name="javac.java.home" default="${boot.java.home}"/>
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   477
            <attribute name="javac.target" default="${javac.target}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   478
            <attribute name="release" default="${release}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   479
            <attribute name="full.version" default="${full.version}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   480
            <sequential>
06bc494ca11e Initial load
duke
parents:
diff changeset
   481
                <mkdir dir="@{gensrc.dir}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   482
                <mkdir dir="@{classes.dir}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   483
                <pcompile srcdir="${src.classes.dir}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   484
                          destdir="@{gensrc.dir}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   485
                          includes="@{includes}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   486
                <copy todir="@{gensrc.dir}">
727
cb50c1ae7bab 4075303: Use javap to enquire aboput a specific inner class
jjg
parents: 10
diff changeset
   487
                    <fileset dir="${src.classes.dir}" includes="@{includes}"/>
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   488
                    <globmapper from="*.properties-template" to="*.properties"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   489
                    <filterset begintoken="$(" endtoken=")">
06bc494ca11e Initial load
duke
parents:
diff changeset
   490
                        <filter token="JDK_VERSION" value="${jdk.version}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   491
                        <filter token="RELEASE" value="@{release}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   492
                        <filter token="FULL_VERSION" value="@{full.version}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   493
                    </filterset>
06bc494ca11e Initial load
duke
parents:
diff changeset
   494
                </copy>
06bc494ca11e Initial load
duke
parents:
diff changeset
   495
                <pcompile srcdir="@{gensrc.dir}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   496
                          destdir="@{gensrc.dir}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   497
                          includes="**/*.properties"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   498
                <javac fork="true"
1871
9bb6518238ff 6795030: Files in langtools build can be compiled ignoring java.home settings
jjg
parents: 735
diff changeset
   499
                       executable="@{javac.java.home}/bin/javac"
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   500
                       srcdir="@{gensrc.dir}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   501
                       destdir="@{classes.dir}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   502
                       includes="@{includes}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   503
                       sourcepath=""
06bc494ca11e Initial load
duke
parents:
diff changeset
   504
                       includeAntRuntime="no"
06bc494ca11e Initial load
duke
parents:
diff changeset
   505
                       target="@{javac.target}">
06bc494ca11e Initial load
duke
parents:
diff changeset
   506
                    <compilerarg value="-J-Xbootclasspath/p:@{javac.bootclasspath}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   507
                    <compilerarg line="${javac.version.opt}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   508
                    <compilerarg line="-Xlint"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   509
                </javac>
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="${src.classes.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
                       excludes="@{excludes}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   516
                       sourcepath=""
06bc494ca11e Initial load
duke
parents:
diff changeset
   517
                       includeAntRuntime="no"
06bc494ca11e Initial load
duke
parents:
diff changeset
   518
                       target="@{javac.target}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   519
                       debug="${javac.debug}" 
06bc494ca11e Initial load
duke
parents:
diff changeset
   520
                       debuglevel="${javac.debuglevel}">
06bc494ca11e Initial load
duke
parents:
diff changeset
   521
                    <compilerarg value="-J-Xbootclasspath/p:@{javac.bootclasspath}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   522
                    <compilerarg value="-Xbootclasspath/p:@{classes.dir}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   523
                    <compilerarg line="${javac.no.jdk.warnings}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   524
                    <compilerarg line="${javac.version.opt}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   525
                    <compilerarg line="${javac.lint.opts}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   526
                </javac>
06bc494ca11e Initial load
duke
parents:
diff changeset
   527
                <copy todir="@{classes.dir}">
06bc494ca11e Initial load
duke
parents:
diff changeset
   528
                    <fileset dir="${src.classes.dir}"> 
06bc494ca11e Initial load
duke
parents:
diff changeset
   529
                        <include name="@{includes}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   530
                        <exclude name="**/*.java"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   531
                        <exclude name="**/*.properties"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   532
                        <exclude name="**/*-template"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   533
                        <exclude name="**/package.html"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   534
                    </fileset>
06bc494ca11e Initial load
duke
parents:
diff changeset
   535
                </copy>
06bc494ca11e Initial load
duke
parents:
diff changeset
   536
            </sequential>
06bc494ca11e Initial load
duke
parents:
diff changeset
   537
        </macrodef>
06bc494ca11e Initial load
duke
parents:
diff changeset
   538
    </target>
06bc494ca11e Initial load
duke
parents:
diff changeset
   539
    
06bc494ca11e Initial load
duke
parents:
diff changeset
   540
    <target name="-def-build-bootstrap-tool" depends="-check-boot.java.home,-def-build-tool">
06bc494ca11e Initial load
duke
parents:
diff changeset
   541
        <presetdef name="build-bootstrap-tool">
06bc494ca11e Initial load
duke
parents:
diff changeset
   542
            <build-tool
06bc494ca11e Initial load
duke
parents:
diff changeset
   543
                javac.target="${boot.javac.target}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   544
                gensrc.dir="${build.bootstrap.dir}/gensrc"
06bc494ca11e Initial load
duke
parents:
diff changeset
   545
                classes.dir="${build.bootstrap.dir}/classes"
06bc494ca11e Initial load
duke
parents:
diff changeset
   546
                bin.dir="${build.bootstrap.dir}/bin"
06bc494ca11e Initial load
duke
parents:
diff changeset
   547
                lib.dir="${build.bootstrap.dir}/lib"
1872
9820a8bee1e5 6796965: dev-time wrapper script for javac broken
jjg
parents: 1871
diff changeset
   548
                java="${boot.java}"
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   549
                javac.bootclasspath=""
06bc494ca11e Initial load
duke
parents:
diff changeset
   550
                release="${bootstrap.release}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   551
                full.version="${bootstrap.full.version}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   552
        </presetdef>
06bc494ca11e Initial load
duke
parents:
diff changeset
   553
    </target>
06bc494ca11e Initial load
duke
parents:
diff changeset
   554
    
06bc494ca11e Initial load
duke
parents:
diff changeset
   555
    <target name="-def-build-bootstrap-jar" depends="-def-build-jar">
06bc494ca11e Initial load
duke
parents:
diff changeset
   556
        <presetdef name="build-bootstrap-jar">
06bc494ca11e Initial load
duke
parents:
diff changeset
   557
            <build-jar
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
                lib.dir="${build.bootstrap.dir}/lib"
06bc494ca11e Initial load
duke
parents:
diff changeset
   562
                javac.bootclasspath=""
06bc494ca11e Initial load
duke
parents:
diff changeset
   563
                release="${bootstrap.release}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   564
                full.version="${bootstrap.full.version}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   565
        </presetdef>
06bc494ca11e Initial load
duke
parents:
diff changeset
   566
    </target>
06bc494ca11e Initial load
duke
parents:
diff changeset
   567
    
06bc494ca11e Initial load
duke
parents:
diff changeset
   568
    <target name="-def-pcompile">
06bc494ca11e Initial load
duke
parents:
diff changeset
   569
        <mkdir dir="${build.toolclasses.dir}"/>
1871
9bb6518238ff 6795030: Files in langtools build can be compiled ignoring java.home settings
jjg
parents: 735
diff changeset
   570
        <javac fork="true"
9bb6518238ff 6795030: Files in langtools build can be compiled ignoring java.home settings
jjg
parents: 735
diff changeset
   571
               executable="${boot.java.home}/bin/javac"
9bb6518238ff 6795030: Files in langtools build can be compiled ignoring java.home settings
jjg
parents: 735
diff changeset
   572
               srcdir="${make.tools.dir}/CompileProperties"
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   573
               destdir="${build.toolclasses.dir}/"
06bc494ca11e Initial load
duke
parents:
diff changeset
   574
               classpath="${ant.home}/lib/ant.jar"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   575
        <taskdef name="pcompile"
06bc494ca11e Initial load
duke
parents:
diff changeset
   576
                 classname="CompilePropertiesTask" 
06bc494ca11e Initial load
duke
parents:
diff changeset
   577
                 classpath="${build.toolclasses.dir}/"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   578
    </target>
06bc494ca11e Initial load
duke
parents:
diff changeset
   579
    
06bc494ca11e Initial load
duke
parents:
diff changeset
   580
    <target name="-def-javadoc-tool" depends="-check-target.java.home">
06bc494ca11e Initial load
duke
parents:
diff changeset
   581
        <macrodef name="javadoc-tool">
06bc494ca11e Initial load
duke
parents:
diff changeset
   582
            <attribute name="name"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   583
            <attribute name="includes"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   584
            <attribute name="options" default=""/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   585
            <attribute name="source" default="1.5"/> <!-- FIXME -->
06bc494ca11e Initial load
duke
parents:
diff changeset
   586
            <sequential>
06bc494ca11e Initial load
duke
parents:
diff changeset
   587
                <property name="javadoc.options" value=""/> <!-- default, can be overridden per user or per project -->
06bc494ca11e Initial load
duke
parents:
diff changeset
   588
                <!-- Note: even with this default value, includes
06bc494ca11e Initial load
duke
parents:
diff changeset
   589
         from src.classes.dir get javadoc'd; see packageset below -->
06bc494ca11e Initial load
duke
parents:
diff changeset
   590
                <property name="javadoc.packagenames" value="none"/> <!-- default, can be overridden per user or per project -->
06bc494ca11e Initial load
duke
parents:
diff changeset
   591
                <javadoc 
06bc494ca11e Initial load
duke
parents:
diff changeset
   592
                    executable="${target.java.home}/bin/javadoc"
06bc494ca11e Initial load
duke
parents:
diff changeset
   593
                    destdir="${build.javadoc.dir}/@{name}" 
06bc494ca11e Initial load
duke
parents:
diff changeset
   594
                    source="@{source}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   595
                    windowtitle="UNOFFICIAL" 
06bc494ca11e Initial load
duke
parents:
diff changeset
   596
                    failonerror="true" 
06bc494ca11e Initial load
duke
parents:
diff changeset
   597
                    use="true"
06bc494ca11e Initial load
duke
parents:
diff changeset
   598
                    author="false" 
06bc494ca11e Initial load
duke
parents:
diff changeset
   599
                    version="false"
06bc494ca11e Initial load
duke
parents:
diff changeset
   600
                    packagenames="${javadoc.packagenames}" >
06bc494ca11e Initial load
duke
parents:
diff changeset
   601
                    <header><![CDATA[<strong>Unofficial Javadoc</strong> generated from developer sources for preview purposes only]]></header>
06bc494ca11e Initial load
duke
parents:
diff changeset
   602
                    <arg line="@{options}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   603
                    <bootclasspath>
06bc494ca11e Initial load
duke
parents:
diff changeset
   604
                        <path location="${build.classes.dir}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   605
                        <path location="${target.java.home}/jre/lib/rt.jar"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   606
                    </bootclasspath>
06bc494ca11e Initial load
duke
parents:
diff changeset
   607
                    <sourcepath>
06bc494ca11e Initial load
duke
parents:
diff changeset
   608
                        <pathelement location="${src.classes.dir}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   609
                    </sourcepath>
06bc494ca11e Initial load
duke
parents:
diff changeset
   610
                    <!-- XXX just <fileset> (restricted further to **/*.java) and no <packageset> -->
06bc494ca11e Initial load
duke
parents:
diff changeset
   611
                    <!-- means that {@link some.package} will not work, which is no good. -->
06bc494ca11e Initial load
duke
parents:
diff changeset
   612
                    <!-- (It correctly skips excluded single classes, but not if packageset is also included, -->
06bc494ca11e Initial load
duke
parents:
diff changeset
   613
                    <!-- which also causes duplicates in the class index for included files.) -->
06bc494ca11e Initial load
duke
parents:
diff changeset
   614
                    <packageset dir="${src.classes.dir}" includes="@{includes}">
06bc494ca11e Initial load
duke
parents:
diff changeset
   615
                        <or>
06bc494ca11e Initial load
duke
parents:
diff changeset
   616
                            <filename name="java/"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   617
                            <filename name="javax/"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   618
                            <filename name="com/sun/javadoc/"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   619
                            <filename name="com/sun/mirror/"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   620
                            <filename name="com/sun/source/"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   621
                        </or>
06bc494ca11e Initial load
duke
parents:
diff changeset
   622
                    </packageset>
06bc494ca11e Initial load
duke
parents:
diff changeset
   623
                </javadoc>
06bc494ca11e Initial load
duke
parents:
diff changeset
   624
            </sequential>
06bc494ca11e Initial load
duke
parents:
diff changeset
   625
        </macrodef>
06bc494ca11e Initial load
duke
parents:
diff changeset
   626
    </target>
06bc494ca11e Initial load
duke
parents:
diff changeset
   627
    
06bc494ca11e Initial load
duke
parents:
diff changeset
   628
    <target name="-def-jtreg" unless="jtreg.defined" depends="-check-jtreg.home">
06bc494ca11e Initial load
duke
parents:
diff changeset
   629
        <taskdef name="jtreg" classname="com.sun.javatest.regtest.Main$$Ant">
06bc494ca11e Initial load
duke
parents:
diff changeset
   630
            <classpath>
06bc494ca11e Initial load
duke
parents:
diff changeset
   631
                <pathelement location="${jtreg.home}/lib/jtreg.jar"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   632
                <pathelement location="${jtreg.home}/lib/javatest.jar"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   633
            </classpath>
06bc494ca11e Initial load
duke
parents:
diff changeset
   634
        </taskdef>
06bc494ca11e Initial load
duke
parents:
diff changeset
   635
        <macrodef name="jtreg-tool">
06bc494ca11e Initial load
duke
parents:
diff changeset
   636
            <attribute name="name"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   637
            <attribute name="tests"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   638
            <attribute name="jdk" default="${target.java.home}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   639
            <attribute name="samevm" default="false"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   640
            <attribute name="verbose" default="summary"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   641
            <attribute name="options" default=""/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   642
            <attribute name="keywords" default="-keywords:!ignore"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   643
            <attribute name="jpda.jvmargs" default=""/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   644
            <sequential>
06bc494ca11e Initial load
duke
parents:
diff changeset
   645
                <property name="coverage.options" value=""/>    <!-- default -->
06bc494ca11e Initial load
duke
parents:
diff changeset
   646
                <property name="coverage.classpath" value=""/>    <!-- default -->
06bc494ca11e Initial load
duke
parents:
diff changeset
   647
                <jtreg 
06bc494ca11e Initial load
duke
parents:
diff changeset
   648
                    dir="${test.dir}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   649
                    workDir="${build.jtreg.dir}/@{name}/work" 
06bc494ca11e Initial load
duke
parents:
diff changeset
   650
                    reportDir="${build.jtreg.dir}/@{name}/report"
06bc494ca11e Initial load
duke
parents:
diff changeset
   651
                    jdk="@{jdk}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   652
                    samevm="@{samevm}" verbose="@{verbose}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   653
                    failonerror="false" resultproperty="jtreg.@{name}.result"
06bc494ca11e Initial load
duke
parents:
diff changeset
   654
                    javacoptions="-g"
06bc494ca11e Initial load
duke
parents:
diff changeset
   655
                    vmoptions="${coverage.options} -Xbootclasspath/p:${coverage.classpath}:${build.classes.dir} @{jpda.jvmargs}">
06bc494ca11e Initial load
duke
parents:
diff changeset
   656
                    <arg line="@{keywords}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   657
                    <arg line="@{options}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   658
                    <arg line="@{tests}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   659
                </jtreg>
06bc494ca11e Initial load
duke
parents:
diff changeset
   660
                <!-- the next two properties are for convenience, when only 
06bc494ca11e Initial load
duke
parents:
diff changeset
   661
                     a single instance of jtreg will be invoked. -->
06bc494ca11e Initial load
duke
parents:
diff changeset
   662
                <condition property="jtreg.passed">
06bc494ca11e Initial load
duke
parents:
diff changeset
   663
                    <equals arg1="${jtreg.javac.result}" arg2="0"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   664
                </condition>
06bc494ca11e Initial load
duke
parents:
diff changeset
   665
                <property name="jtreg.report" value="${build.jtreg.dir}/@{name}/report"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   666
            </sequential>
06bc494ca11e Initial load
duke
parents:
diff changeset
   667
        </macrodef>
06bc494ca11e Initial load
duke
parents:
diff changeset
   668
        <property name="jtreg.defined" value="true"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   669
    </target>
06bc494ca11e Initial load
duke
parents:
diff changeset
   670
06bc494ca11e Initial load
duke
parents:
diff changeset
   671
    <target name="-def-cobertura" depends="-check-cobertura.home">
06bc494ca11e Initial load
duke
parents:
diff changeset
   672
        <path id="cobertura.classpath">
06bc494ca11e Initial load
duke
parents:
diff changeset
   673
            <fileset dir="${cobertura.home}">
06bc494ca11e Initial load
duke
parents:
diff changeset
   674
                <include name="cobertura.jar"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   675
                <include name="lib/**/*.jar"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   676
            </fileset>
06bc494ca11e Initial load
duke
parents:
diff changeset
   677
        </path>
06bc494ca11e Initial load
duke
parents:
diff changeset
   678
	<taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   679
    </target>
06bc494ca11e Initial load
duke
parents:
diff changeset
   680
    
06bc494ca11e Initial load
duke
parents:
diff changeset
   681
    <target name="-def-findbugs" unless="findbugs.defined" depends="-check-findbugs.home">
06bc494ca11e Initial load
duke
parents:
diff changeset
   682
        <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask">
06bc494ca11e Initial load
duke
parents:
diff changeset
   683
            <classpath>
06bc494ca11e Initial load
duke
parents:
diff changeset
   684
                <pathelement location="${findbugs.home}/lib/findbugs.jar"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   685
            </classpath>
06bc494ca11e Initial load
duke
parents:
diff changeset
   686
        </taskdef>
06bc494ca11e Initial load
duke
parents:
diff changeset
   687
        <macrodef name="findbugs-tool">
06bc494ca11e Initial load
duke
parents:
diff changeset
   688
            <attribute name="name"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   689
            <attribute name="output" default="emacs"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   690
            <attribute name="outputFile" default=""/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   691
            <attribute name="reportLevel" default="high"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   692
            <sequential>
06bc494ca11e Initial load
duke
parents:
diff changeset
   693
                <findbugs 
06bc494ca11e Initial load
duke
parents:
diff changeset
   694
                    home="${findbugs.home}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   695
                    output="@{output}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   696
                    outputFile="@{outputFile}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   697
                    reportLevel="@{reportLevel}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   698
                    failOnError="false"
06bc494ca11e Initial load
duke
parents:
diff changeset
   699
                    errorProperty="findbugs.@{name}.errors"
06bc494ca11e Initial load
duke
parents:
diff changeset
   700
                    warningsProperty="findbugs.@{name}.warnings"
06bc494ca11e Initial load
duke
parents:
diff changeset
   701
                    jvmargs="-Xmx512M" >
06bc494ca11e Initial load
duke
parents:
diff changeset
   702
                    <class location="${dist.dir}/lib/@{name}.jar"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   703
                    <auxClasspath>
06bc494ca11e Initial load
duke
parents:
diff changeset
   704
                        <pathelement location="${build.classes.dir}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   705
                    </auxClasspath>
06bc494ca11e Initial load
duke
parents:
diff changeset
   706
                    <sourcePath>
06bc494ca11e Initial load
duke
parents:
diff changeset
   707
                        <pathelement location="${src.classes.dir}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   708
                    </sourcePath>
06bc494ca11e Initial load
duke
parents:
diff changeset
   709
                </findbugs>
06bc494ca11e Initial load
duke
parents:
diff changeset
   710
            </sequential>
06bc494ca11e Initial load
duke
parents:
diff changeset
   711
        </macrodef>
06bc494ca11e Initial load
duke
parents:
diff changeset
   712
        <property name="findbugs.defined" value="true"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   713
    </target>
06bc494ca11e Initial load
duke
parents:
diff changeset
   714
    
06bc494ca11e Initial load
duke
parents:
diff changeset
   715
    <target name="-def-check">
06bc494ca11e Initial load
duke
parents:
diff changeset
   716
        <macrodef name="check">
06bc494ca11e Initial load
duke
parents:
diff changeset
   717
            <attribute name="name"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   718
            <attribute name="property"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   719
            <attribute name="marker"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   720
            <sequential>
06bc494ca11e Initial load
duke
parents:
diff changeset
   721
                <fail message="Cannot locate @{name}: please set @{property} to its location">
06bc494ca11e Initial load
duke
parents:
diff changeset
   722
                    <condition>
06bc494ca11e Initial load
duke
parents:
diff changeset
   723
                        <not>
06bc494ca11e Initial load
duke
parents:
diff changeset
   724
                            <isset property="@{property}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   725
                        </not>
06bc494ca11e Initial load
duke
parents:
diff changeset
   726
                    </condition>
06bc494ca11e Initial load
duke
parents:
diff changeset
   727
                </fail>
06bc494ca11e Initial load
duke
parents:
diff changeset
   728
                <fail message="@{name} is not installed in ${@{property}}">
06bc494ca11e Initial load
duke
parents:
diff changeset
   729
                    <condition>
06bc494ca11e Initial load
duke
parents:
diff changeset
   730
                        <not>
06bc494ca11e Initial load
duke
parents:
diff changeset
   731
                            <available file="${@{property}}/@{marker}"/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   732
                        </not>
06bc494ca11e Initial load
duke
parents:
diff changeset
   733
                    </condition>
06bc494ca11e Initial load
duke
parents:
diff changeset
   734
                </fail>
06bc494ca11e Initial load
duke
parents:
diff changeset
   735
            </sequential>
06bc494ca11e Initial load
duke
parents:
diff changeset
   736
        </macrodef>
06bc494ca11e Initial load
duke
parents:
diff changeset
   737
    </target>
06bc494ca11e Initial load
duke
parents:
diff changeset
   738
06bc494ca11e Initial load
duke
parents:
diff changeset
   739
    <!-- standard JDK target -->
06bc494ca11e Initial load
duke
parents:
diff changeset
   740
    <target name="sanity" 
06bc494ca11e Initial load
duke
parents:
diff changeset
   741
        description="display settings of congiguration values">
06bc494ca11e Initial load
duke
parents:
diff changeset
   742
        <echo level="info">ant.home = ${ant.home}</echo>
06bc494ca11e Initial load
duke
parents:
diff changeset
   743
        <echo level="info">boot.java.home = ${boot.java.home}</echo>
06bc494ca11e Initial load
duke
parents:
diff changeset
   744
        <echo level="info">target.java.home = ${target.java.home}</echo>
06bc494ca11e Initial load
duke
parents:
diff changeset
   745
        <echo level="info">jtreg.home = ${jtreg.home}</echo>
06bc494ca11e Initial load
duke
parents:
diff changeset
   746
        <echo level="info">findbugs.home = ${findbugs.home}</echo>
06bc494ca11e Initial load
duke
parents:
diff changeset
   747
    </target>
06bc494ca11e Initial load
duke
parents:
diff changeset
   748
06bc494ca11e Initial load
duke
parents:
diff changeset
   749
    <!-- useful debugging targets -->
06bc494ca11e Initial load
duke
parents:
diff changeset
   750
    <target name="diagnostics">
06bc494ca11e Initial load
duke
parents:
diff changeset
   751
        <diagnostics/>
06bc494ca11e Initial load
duke
parents:
diff changeset
   752
    </target>
06bc494ca11e Initial load
duke
parents:
diff changeset
   753
06bc494ca11e Initial load
duke
parents:
diff changeset
   754
    <target name="post-sanity" depends="-def-jtreg,sanity,build"
06bc494ca11e Initial load
duke
parents:
diff changeset
   755
        description="perform basic validation after a standard build">
06bc494ca11e Initial load
duke
parents:
diff changeset
   756
        <jtreg 
06bc494ca11e Initial load
duke
parents:
diff changeset
   757
            dir="make/test"
06bc494ca11e Initial load
duke
parents:
diff changeset
   758
            workDir="${build.jtreg.dir}/post-sanity/work" 
06bc494ca11e Initial load
duke
parents:
diff changeset
   759
            reportDir="${build.jtreg.dir}/post-sanity/report"
06bc494ca11e Initial load
duke
parents:
diff changeset
   760
            jdk="${target.java.home}"
06bc494ca11e Initial load
duke
parents:
diff changeset
   761
            verbose="summary"
06bc494ca11e Initial load
duke
parents:
diff changeset
   762
            failonerror="false" resultproperty="jtreg.post-sanity.result">
06bc494ca11e Initial load
duke
parents:
diff changeset
   763
        </jtreg>
06bc494ca11e Initial load
duke
parents:
diff changeset
   764
        
06bc494ca11e Initial load
duke
parents:
diff changeset
   765
    </target>
06bc494ca11e Initial load
duke
parents:
diff changeset
   766
</project>
06bc494ca11e Initial load
duke
parents:
diff changeset
   767