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