jdk/make/netbeans/common/shared.xml
author lana
Wed, 11 Apr 2012 18:44:33 -0700
changeset 12408 8e95f7b85140
parent 5506 202f599c92aa
child 15517 588eec59872b
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
<!--
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     4
 Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 Redistribution and use in source and binary forms, with or without
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 modification, are permitted provided that the following conditions
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 are met:
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
   - Redistributions of source code must retain the above copyright
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
     notice, this list of conditions and the following disclaimer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
   - Redistributions in binary form must reproduce the above copyright
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
     notice, this list of conditions and the following disclaimer in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
     documentation and/or other materials provided with the distribution.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    17
   - Neither the name of Oracle nor the names of its
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
     contributors may be used to endorse or promote products derived
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
     from this software without specific prior written permission.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
-->
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
<project name="shared" basedir="..">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
    <import file="make.xml"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
    <target name="-tstamp">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
        <tstamp>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
            <format property="build.time" pattern="MM/dd/yyyy hh:mm aa"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
            <format property="build.fullversion.time" pattern="MM/dd/yyyy_HH_mm"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
        </tstamp>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    <target name="-first-init" depends="-tstamp">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
        <mkdir dir="${user.home}/.openjdk"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
        <property name="workspace-user-build.properties" location="nbproject/private/build.properties"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
        <property file="${workspace-user-build.properties}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
        <property file="${user.home}/.openjdk/${ant.project.name}-build.properties"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
        <property name="user-build.properties" location="${user.home}/.openjdk/build.properties"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
        <property file="${user-build.properties}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
        <property file="${basedir}/build.properties"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
        <property environment="env."/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    <target name="-warn-about-bootstrap.jdk" depends="-first-init" unless="bootstrap.jdk">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        <property name="fallback.jdk" location="${java.home}/.."/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
        <echo level="warning">Warning: falling back to building against ${fallback.jdk}</echo>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
        <echo level="warning">Please define bootstrap.jdk=.../recent/jdk7/snapshot in ${user-build.properties} or ${workspace-user-build.properties}</echo>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    <target name="-pre-init">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
        <!-- Invoked before -first-init. -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
        <!-- Empty placeholder for easier customization. -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
        <!-- You can override this target in the ../build.xml file. -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    <target name="-post-init">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        <!-- Invoked after -project-init. -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        <!-- Empty placeholder for easier customization. -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        <!-- You can override this target in the ../build.xml file. -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    <target name="-init" description="Initial configuration used by everything else." depends="-pre-init,-first-init,-project-init,-post-init"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    <target name="-project-init" depends="-warn-about-bootstrap.jdk">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
        <property name="root" location="../../.."/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
        <property file="../common/architectures/name-${os.name}.properties"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
        <property name="platform" value="windows"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
        <property file="../common/architectures/arch-${os.arch}.properties"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        <property name="arch" value="${os.arch}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
        <echo level="verbose">System configuration claims architecture is ${platform}-${arch}</echo>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        <property name="build.dir" location="${root}/build/${platform}-${arch}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        <property name="bin.dir" location="${build.dir}/bin"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
        <property name="make.dir" location="${root}/make"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
        <property name="gensrc.dir" location="${build.dir}/gensrc"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
        <property name="classes.dir" location="${build.dir}/classes"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
        <property name="jtreg.dir" location="${build.dir}/jtreg/${ant.project.name}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
        <property name="dist.dir" value="${root}/dist"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        <property name="includes" value="(nothing)"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
        <property name="excludes" value=""/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        <property name="javadoc.dir" location="${build.dir}/javadoc/${ant.project.name}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
        <condition property="os.linux">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
            <os name="linux"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        </condition>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
        <condition property="os.solaris">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
            <os name="SunOS"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        </condition>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        <condition property="osfamily.unix">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
            <os family="unix"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        </condition>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        <condition property="os.windows">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
            <os family="windows"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        </condition>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        <condition property="platform.src.dir" value="${root}/src/solaris/classes">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
            <os family="unix"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        </condition>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        <condition property="platform.src.dir" value="${root}/src/windows/classes">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
            <os family="windows"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        </condition>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        <property name="share.src.dir" value="${root}/src/share/classes"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        <property name="bootstrap.jdk" location="${fallback.jdk}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        <!-- XXX ensure that bootstrap.jdk meets some minimum version requirements (TBD) -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        <condition property="bootstrap.javac" value="${bootstrap.jdk}/bin/javac">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
            <available file="${bootstrap.jdk}/bin/javac"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        </condition>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        <condition property="bootstrap.javac" value="${bootstrap.jdk}\bin\javac.exe">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
            <available file="${bootstrap.jdk}\bin\javac.exe"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        </condition>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        <fail unless="bootstrap.javac">${bootstrap.jdk} does not appear to be a functional JDK; no javac found.</fail>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        <property name="javac.options" value="-Xlint"/> <!-- default, can be overridden per user or per project -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        <property name="javac.debug" value="true"/>  <!-- default, can be overridden per user or per project -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        <property name="javac.debuglevel" value="lines,vars,source"/>  <!-- default, can be overridden per user or per project -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        <macrodef name="jdk-javac">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
            <attribute name="srcdir"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
            <attribute name="includes" default="${includes}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
            <attribute name="excludes" default="${excludes}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
            <attribute name="classesdir" default="${classes.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
            <sequential>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
                <mkdir dir="@{classesdir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
                <javac srcdir="@{srcdir}" includes="@{includes}" excludes="@{excludes}" sourcepath="" 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
                    destdir="@{classesdir}" fork="true" executable="${bootstrap.javac}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                    debug="${javac.debug}" debuglevel="${javac.debuglevel}">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
                    <compilerarg value="-source"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
                    <compilerarg value="1.5"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
                    <compilerarg value="-target"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
                    <compilerarg value="1.6"/> <!-- for usability of JDK 6 as snapshot; change to 1.7 when JSR 294 put back -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
                    <!-- Mandatory for compiling partial JDK sources against a snapshot; should NEVER be used for any other purpose: -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
                    <compilerarg value="-XDignore.symbol.file=true"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
                    <compilerarg line="${javac.options}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
                </javac>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
            </sequential>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        </macrodef>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        <available property="have.closed.src" file="${root}/src/closed/share/classes" type="dir"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    <target name="-pre-compile">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        <!-- Empty placeholder for easier customization. -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        <!-- You can override this target in the ../build.xml file. -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    <target name="-post-compile">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        <!-- Empty placeholder for easier customization. -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        <!-- You can override this target in the ../build.xml file. -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    <target name="build" depends="-init,-pre-compile,-build-ant,-build-make,-post-compile" description="Build sources."/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    <target name="-do-build-ant">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        <depend srcdir="${share.src.dir}:${platform.src.dir}:${root}/src/closed/share/classes:${gensrc.dir}" destdir="${classes.dir}" cache="${build.dir}/depcache" includes="${includes}" excludes="${excludes}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        <mkdir dir="${gensrc.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        <jdk-javac srcdir="${share.src.dir}:${platform.src.dir}:${gensrc.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        <property name="copy.excludes" value="**/*.java,**/package.html,**/doc-files/"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        <copy todir="${classes.dir}">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
            <fileset dir="${share.src.dir}" includes="${includes}" excludes="${excludes},${copy.excludes}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
            <fileset dir="${platform.src.dir}" includes="${includes}" excludes="${excludes},${copy.excludes}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        </copy>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        <antcall target="-maybe-do-build-ant-closed"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    <target name="-maybe-do-build-ant-closed" if="have.closed.src">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        <jdk-javac srcdir="${root}/src/closed/share/classes"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        <copy todir="${classes.dir}">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
            <fileset dir="${root}/src/closed/share/classes" includes="${includes}" excludes="${excludes},${copy.excludes}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        </copy>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    <target name="-build-ant" depends="-init" unless="use.make">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        <antcall target="-do-build-ant"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    <target name="-build-make" depends="-init" if="use.make"> <!-- override me to call <make-run> -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        <echo level="info">No make target defined for this project; falling back to simple Java build</echo>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        <antcall target="-do-build-ant"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
    <target name="clean" depends="-init,-clean-docs-tests,-clean-ant,-clean-make" description="Clean build products."/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    <target name="-do-clean-ant">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        <!-- XXX first s/\.java/.class/g in includes and excludes! -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
        <delete dir="${classes.dir}" includes="${includes}" excludes="${excludes}" includeemptydirs="true"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        <delete dir="${gensrc.dir}" includes="${includes}" excludes="${excludes}" includeemptydirs="true"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        <delete dir="${build.dir}/depcache"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    <target name="-clean-docs-tests">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        <delete dir="${javadoc.dir}" includeemptydirs="true"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
        <delete dir="${jtreg.dir}" includeemptydirs="true"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    <target name="-clean-ant" depends="-init" unless="use.make">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
        <antcall target="-do-clean-ant"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    <target name="-clean-make" depends="-init" if="use.make"> <!-- override me to call <make-run> -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
        <echo level="info">No make clean target defined for this project; falling back to simple Java clean</echo>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
        <antcall target="-do-clean-ant"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    <target name="compile-single" depends="-init">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
        <fail unless="srcdir">Must set property 'srcdir'</fail>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        <fail unless="includes">Must set property 'includes'</fail>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
        <jdk-javac srcdir="${srcdir}" includes="${includes}" excludes=""/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    <target name="debug-fix" depends="-init" if="netbeans.home">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
        <fail unless="class">Must set property 'class'</fail>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        <antcall target="compile-single">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
            <param name="includes" value="${class}.java"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        </antcall>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        <nbjpdareload>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
            <fileset dir="${classes.dir}">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
                <include name="${class}.class"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
            </fileset>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        </nbjpdareload>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    <target name="-taskdef-jtreg" depends="-init" unless="jtreg.defined">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
        <fail message="Cannot locate jtreg: please set jtreg.home to its location">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
            <condition>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                <not>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
                    <isset property="jtreg.home"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
                </not>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
            </condition>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
        </fail>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        <fail message="jtreg is not installed in ${jtreg.home}">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
            <condition>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
                <not>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
                    <and>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
                        <available file="${jtreg.home}/lib/jtreg.jar"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
                        <available file="${jtreg.home}/lib/javatest.jar"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
                    </and>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
                </not>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
            </condition>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
        </fail>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
        <taskdef name="jtreg" classname="com.sun.javatest.regtest.Main$$Ant">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
            <classpath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
                <pathelement location="${jtreg.home}/lib/jtreg.jar"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
                <pathelement location="${jtreg.home}/lib/javatest.jar"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
            </classpath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
        </taskdef>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        <property name="jtreg.defined" value="true"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
    <target name="-check-tests-defined" unless="jtreg.tests">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
        <fail>You must define jtreg.tests to select some tests to run.</fail>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    <target name="-jtreg-setup">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
        <property name="jtreg.vm.options" value=""/> <!-- default, can be overridden per user or per project -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
        <property name="jtreg.options" value=""/> <!-- default, can be overridden per user or per project -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
        <property name="jtreg.samevm" value="false"/>  <!-- default, can be overridden per user or per project -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    <target name="-jtreg-ant" unless="use.make">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
        <jtreg dir="${root}/test" samevm="${jtreg.samevm}" verbose="summary"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
               jdk="${bootstrap.jdk}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
               failonerror="false" resultproperty="jtreg.result"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
               javacoptions="-g"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
               vmoptions="-Xbootclasspath/p:${classes.dir} ${jtreg.vm.options}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
               reportDir="${jtreg.dir}/JTreport"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
               workDir="${jtreg.dir}/JTwork"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
               includes="${jtreg.tests}">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
            <arg line="${jtreg.options}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
        </jtreg>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    <target name="-jtreg-make" if="use.make">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
        <jtreg dir="${root}/test" samevm="${jtreg.samevm}" verbose="summary"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
               failonerror="false" resultproperty="jtreg.result"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
               jdk="${build.dir}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
               vmoptions="${jtreg.vm.options}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
               javacoptions="-g"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
               reportDir="${jtreg.dir}/JTreport"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
               workDir="${jtreg.dir}/JTwork"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
               includes="${jtreg.tests}">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
            <arg line="${jtreg.options}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
        </jtreg>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
    <target name="-pre-jtreg">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
        <!-- Empty placeholder for easier customization. -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
        <!-- You can override this target in the ../build.xml file. -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
    <target name="-post-jtreg">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
        <!-- Empty placeholder for easier customization. -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
        <!-- You can override this target in the ../build.xml file. -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
    <target name="-jtreg" depends="-init,-pre-jtreg,-taskdef-jtreg,-check-tests-defined,-jtreg-setup,-jtreg-make,-jtreg-ant,-post-jtreg">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
        <property name="jtreg.report" location="${jtreg.dir}/JTreport/report.html"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
        <condition property="jtreg.passed">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
            <equals arg1="${jtreg.result}" arg2="0"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
        </condition>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
    <target name="test" depends="jtreg"/> <!-- Allow use of existing finger muscle memory from command line. -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
    <target name="jtreg" depends="-jtreg" description="Run jtreg-based tests." unless="jtreg.passed">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
        <fail>${jtreg.report}: some tests failed.</fail>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
    <target name="jtreg-nb" depends="-jtreg" if="netbeans.home" unless="jtreg.passed">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
        <makeurl file="${jtreg.report}" property="jtreg.report.url"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
        <nbbrowse url="${jtreg.report.url}#Results"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
        <fail>Some tests failed; see report for details.</fail>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
    <target name="jtreg-debug-nb" depends="-init" if="netbeans.home">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
        <!-- No package decls -> "source root" is immediately containing dir -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
        <dirname file="${root}/test/${jtreg.tests}" property="test.dir"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
        <nbjpdastart addressproperty="jpda.address" name="${ant.project.name}" transport="dt_socket">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
            <bootclasspath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
                <pathelement location="${classes.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
                <pathelement location="${bootstrap.jdk}/jre/lib/rt.jar"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
            </bootclasspath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
            <classpath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
                <pathelement location="${jtreg.dir}/JTwork/classes"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
            </classpath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
            <sourcepath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
                <pathelement location="${share.src.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
                <pathelement location="${platform.src.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
                <pathelement location="${root}/src/closed/share/classes"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
                <pathelement location="${test.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
            </sourcepath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
        </nbjpdastart>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
        <antcall target="-jtreg">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
            <param name="jtreg.vm.options" value="-Xdebug -Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
        </antcall>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
    
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
    <target name="debug" depends="-init" if="netbeans.home">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
        <!-- No package decls -> "source root" is immediately containing dir -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
        <dirname file="${root}/test/${jtreg.tests}" property="test.dir"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
        <nbjpdastart addressproperty="jpda.address" name="${ant.project.name}" transport="dt_socket">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
            <bootclasspath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
                <pathelement location="${classes.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
                <pathelement location="${bootstrap.jdk}/jre/lib/rt.jar"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
            </bootclasspath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
            <sourcepath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
                <pathelement location="${share.src.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
                <pathelement location="${platform.src.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
                <pathelement location="${root}/src/closed/share/classes"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
                <pathelement location="${test.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
            </sourcepath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
        </nbjpdastart>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
        <antcall target="run">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
            <param name="jvm.args" value="-Xdebug -Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
        </antcall>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
    <target name="javadoc" depends="-init" description="Build basic Javadoc for public packages.">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
        <property name="javadoc.options" value=""/> <!-- default, can be overridden per user or per project -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
        <!-- Note: even with this default value, includes/excludes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
         from share.src.dir get javadoc'd; see packageset below -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
        <property name="javadoc.packagenames" value="none"/> <!-- default, can be overridden per user or per project -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
        <javadoc destdir="${javadoc.dir}" source="1.5"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
            windowtitle="UNOFFICIAL" failonerror="true" use="true"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
            author="false" version="false"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
            packagenames="${javadoc.packagenames}">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
            <header><![CDATA[<strong>Unofficial Javadoc</strong> generated from developer sources for preview purposes only]]></header>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
            <arg line="${javadoc.options}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
            <bootclasspath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
                <path location="${bootstrap.jdk}/jre/lib/rt.jar"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
                <path location="${classes.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
            </bootclasspath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
            <sourcepath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
                <pathelement location="${share.src.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
                <pathelement location="${platform.src.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
                <pathelement location="${root}/src/closed/share/classes"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
                <pathelement location="${root}/src/share/doc/stub"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
            </sourcepath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
            <!-- XXX just <fileset> (restricted further to **/*.java) and no <packageset> -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
            <!-- means that {@link some.package} will not work, which is no good. -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
            <!-- (It correctly skips excluded single classes, but not if packageset is also included, -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
            <!-- which also causes duplicates in the class index for included files.) -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
            <packageset dir="${share.src.dir}" includes="${includes}" excludes="${excludes}">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
                <or>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
                    <filename name="java/"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
                    <filename name="javax/"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
                    <filename name="org/ietf/jgss/"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
                    <filename name="org/omg/"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
                    <filename name="org/w3c/"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
                    <filename name="org/xml/sax/"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
                </or>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
            </packageset>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
        </javadoc>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
    <target name="javadoc-nb" depends="javadoc" if="netbeans.home">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
        <nbbrowse file="${javadoc.dir}/index.html"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
</project>