shared.xml revision 0
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
- Neither the name of Sun Microsystems nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<project name="shared" basedir="..">
<import file="make.xml"/>
<target name="-tstamp">
<tstamp>
</tstamp>
</target>
<target name="-first-init" depends="-tstamp">
<mkdir dir="${user.home}/.openjdk"/>
<property file="${workspace-user-build.properties}"/>
<property file="${user.home}/.openjdk/${ant.project.name}-build.properties"/>
<property file="${user-build.properties}"/>
<property file="${basedir}/build.properties"/>
<property environment="env."/>
</target>
<echo level="warning">Please define bootstrap.jdk=.../recent/jdk7/snapshot in ${user-build.properties} or ${workspace-user-build.properties}</echo>
</target>
<target name="-pre-init">
<!-- Invoked before -first-init. -->
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the /build.xml file. -->
</target>
<target name="-post-init">
<!-- Invoked after -project-init. -->
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the /build.xml file. -->
</target>
<target name="-init" description="Initial configuration used by everything else." depends="-pre-init,-first-init,-project-init,-post-init"/>
<property name="root" location="../../.."/>
<property file="/common/architectures/name-${os.name}.properties"/>
<property name="platform" value="windows"/>
<property file="/common/architectures/arch-${os.arch}.properties"/>
<echo level="verbose">System configuration claims architecture is ${platform}-${arch}</echo>
<property name="includes" value="(nothing)"/>
<property name="excludes" value=""/>
<condition property="os.linux">
<os name="linux"/>
</condition>
<condition property="os.solaris">
<os name="SunOS"/>
</condition>
<condition property="osfamily.unix">
<os family="unix"/>
</condition>
<condition property="os.windows">
<os family="windows"/>
</condition>
<os family="unix"/>
</condition>
<os family="windows"/>
</condition>
<!-- XXX ensure that bootstrap.jdk meets some minimum version requirements (TBD) -->
<available file="${bootstrap.jdk}/bin/javac"/>
</condition>
<available file="${bootstrap.jdk}\bin\javac.exe"/>
</condition>
<fail unless="bootstrap.javac">${bootstrap.jdk} does not appear to be a functional JDK; no javac found.</fail>
<property name="javac.options" value="-Xlint"/> <!-- default, can be overridden per user or per project -->
<property name="javac.debug" value="true"/> <!-- default, can be overridden per user or per project -->
<property name="javac.debuglevel" value="lines,vars,source"/> <!-- default, can be overridden per user or per project -->
<macrodef name="jdk-javac">
<attribute name="srcdir"/>
<attribute name="includes" default="${includes}"/>
<attribute name="excludes" default="${excludes}"/>
<sequential>
<mkdir dir="@{classesdir}"/>
<javac srcdir="@{srcdir}" includes="@{includes}" excludes="@{excludes}" sourcepath=""
debug="${javac.debug}" debuglevel="${javac.debuglevel}">
<compilerarg value="-source"/>
<compilerarg value="1.5"/>
<compilerarg value="-target"/>
<compilerarg value="1.6"/> <!-- for usability of JDK 6 as snapshot; change to 1.7 when JSR 294 put back -->
<!-- Mandatory for compiling partial JDK sources against a snapshot; should NEVER be used for any other purpose: -->
<compilerarg value="-XDignore.symbol.file=true"/>
<compilerarg line="${javac.options}"/>
</javac>
</sequential>
</macrodef>
</target>
<target name="-pre-compile">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the /build.xml file. -->
</target>
<target name="-post-compile">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the /build.xml file. -->
</target>
<target name="build" depends="-init,-pre-compile,-build-ant,-build-make,-post-compile" description="Build sources."/>
<target name="-do-build-ant">
<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}"/>
<mkdir dir="${gensrc.dir}"/>
<copy todir="${classes.dir}">
</copy>
<antcall target="-maybe-do-build-ant-closed"/>
</target>
<copy todir="${classes.dir}">
<fileset dir="${root}/src/closed/share/classes" includes="${includes}" excludes="${excludes},${copy.excludes}"/>
</copy>
</target>
<antcall target="-do-build-ant"/>
</target>
<echo level="info">No make target defined for this project; falling back to simple Java build</echo>
<antcall target="-do-build-ant"/>
</target>
<target name="clean" depends="-init,-clean-docs-tests,-clean-ant,-clean-make" description="Clean build products."/>
<target name="-do-clean-ant">
<delete dir="${classes.dir}" includes="${includes}" excludes="${excludes}" includeemptydirs="true"/>
<delete dir="${build.dir}/depcache"/>
</target>
<target name="-clean-docs-tests">
</target>
<antcall target="-do-clean-ant"/>
</target>
<echo level="info">No make clean target defined for this project; falling back to simple Java clean</echo>
<antcall target="-do-clean-ant"/>
</target>
<target name="compile-single" depends="-init">
<fail unless="srcdir">Must set property 'srcdir'</fail>
<fail unless="includes">Must set property 'includes'</fail>
<jdk-javac srcdir="${srcdir}" includes="${includes}" excludes=""/>
</target>
<fail unless="class">Must set property 'class'</fail>
<antcall target="compile-single">
<param name="includes" value="${class}.java"/>
</antcall>
<nbjpdareload>
<fileset dir="${classes.dir}">
<include name="${class}.class"/>
</fileset>
</nbjpdareload>
</target>
<fail message="Cannot locate jtreg: please set jtreg.home to its location">
<condition>
<not>
<isset property="jtreg.home"/>
</not>
</condition>
</fail>
<fail message="jtreg is not installed in ${jtreg.home}">
<condition>
<not>
<and>
<available file="${jtreg.home}/lib/jtreg.jar"/>
<available file="${jtreg.home}/lib/javatest.jar"/>
</and>
</not>
</condition>
</fail>
<classpath>
<pathelement location="${jtreg.home}/lib/jtreg.jar"/>
<pathelement location="${jtreg.home}/lib/javatest.jar"/>
</classpath>
</taskdef>
</target>
</target>
<target name="-jtreg-setup">
<property name="jtreg.vm.options" value=""/> <!-- default, can be overridden per user or per project -->
<property name="jtreg.options" value=""/> <!-- default, can be overridden per user or per project -->
<property name="jtreg.samevm" value="false"/> <!-- default, can be overridden per user or per project -->
</target>
jdk="${bootstrap.jdk}"
failonerror="false" resultproperty="jtreg.result"
javacoptions="-g"
vmoptions="-Xbootclasspath/p:${classes.dir} ${jtreg.vm.options}"
reportDir="${jtreg.dir}/JTreport"
workDir="${jtreg.dir}/JTwork"
includes="${jtreg.tests}">
<arg line="${jtreg.options}"/>
</jtreg>
</target>
failonerror="false" resultproperty="jtreg.result"
jdk="${build.dir}"
vmoptions="${jtreg.vm.options}"
javacoptions="-g"
reportDir="${jtreg.dir}/JTreport"
workDir="${jtreg.dir}/JTwork"
includes="${jtreg.tests}">
<arg line="${jtreg.options}"/>
</jtreg>
</target>
<target name="-pre-jtreg">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the /build.xml file. -->
</target>
<target name="-post-jtreg">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the /build.xml file. -->
</target>
<target name="-jtreg" depends="-init,-pre-jtreg,-taskdef-jtreg,-check-tests-defined,-jtreg-setup,-jtreg-make,-jtreg-ant,-post-jtreg">
<condition property="jtreg.passed">
</condition>
</target>
<target name="test" depends="jtreg"/> <!-- Allow use of existing finger muscle memory from command line. -->
</target>
<nbbrowse url="${jtreg.report.url}#Results"/>
<fail>Some tests failed; see report for details.</fail>
</target>
<!-- No package decls -> "source root" is immediately containing dir -->
<bootclasspath>
<pathelement location="${classes.dir}"/>
<pathelement location="${bootstrap.jdk}/jre/lib/rt.jar"/>
</bootclasspath>
<classpath>
</classpath>
<sourcepath>
<pathelement location="${share.src.dir}"/>
<pathelement location="${platform.src.dir}"/>
<pathelement location="${test.dir}"/>
</sourcepath>
</nbjpdastart>
<antcall target="-jtreg">
<param name="jtreg.vm.options" value="-Xdebug -Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
</antcall>
</target>
<!-- No package decls -> "source root" is immediately containing dir -->
<bootclasspath>
<pathelement location="${classes.dir}"/>
<pathelement location="${bootstrap.jdk}/jre/lib/rt.jar"/>
</bootclasspath>
<sourcepath>
<pathelement location="${share.src.dir}"/>
<pathelement location="${platform.src.dir}"/>
<pathelement location="${test.dir}"/>
</sourcepath>
</nbjpdastart>
<antcall target="run">
</antcall>
</target>
<target name="javadoc" depends="-init" description="Build basic Javadoc for public packages.">
<property name="javadoc.options" value=""/> <!-- default, can be overridden per user or per project -->
from share.src.dir get javadoc'd; see packageset below -->
<property name="javadoc.packagenames" value="none"/> <!-- default, can be overridden per user or per project -->
windowtitle="UNOFFICIAL" failonerror="true" use="true"
author="false" version="false"
packagenames="${javadoc.packagenames}">
<header><![CDATA[<strong>Unofficial Javadoc</strong> generated from developer sources for preview purposes only]]></header>
<arg line="${javadoc.options}"/>
<bootclasspath>
<path location="${bootstrap.jdk}/jre/lib/rt.jar"/>
<path location="${classes.dir}"/>
</bootclasspath>
<sourcepath>
<pathelement location="${share.src.dir}"/>
<pathelement location="${platform.src.dir}"/>
</sourcepath>
<!-- XXX just <fileset> (restricted further to **/*.java) and no <packageset> -->
<!-- means that {@link some.package} will not work, which is no good. -->
<!-- (It correctly skips excluded single classes, but not if packageset is also included, -->
<!-- which also causes duplicates in the class index for included files.) -->
<or>
<filename name="java/"/>
<filename name="javax/"/>
</or>
</packageset>
</javadoc>
</target>
<nbbrowse file="${javadoc.dir}/index.html"/>
</target>
</project>