build.xml revision 435
0N/A<?
xml version="1.0" encoding="UTF-8"?>
0N/A Copyright 2007-2009 Sun Microsystems, Inc. All Rights Reserved. 0N/A DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A This code is free software; you can redistribute it and/or modify it 0N/A under the terms of the GNU General Public License version 2 only, as 0N/A published by the Free Software Foundation. Sun designates this 0N/A particular file as subject to the "Classpath" exception as provided 0N/A by Sun in the LICENSE file that accompanied this code. 0N/A This code is distributed in the hope that it will be useful, but WITHOUT 0N/A ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A version 2 for more details (a copy is included in the LICENSE file that 0N/A accompanied this code). 0N/A You should have received a copy of the GNU General Public License version 0N/A 2 along with this work; if not, write to the Free Software Foundation, 0N/A Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A CA 95054 USA or visit www.sun.com if you need additional information or This is the main build file for the complete langtools workspace. It is used both when working on the tools in NetBeans, and when building JDK itself, in which case it is invoked from the wrapper Makefile. <
project name="langtools" default="build" basedir="..">
property is set. This must be BEFORE the include of <!-- The following locations can be used to override default property values. --> <!-- Use this location for customizations specific to this instance of this workspace --> <!-- Use this location for customizations common to all OpenJDK langtools workspaces --> <!-- Use this location for customizations common to all OpenJDK workspaces --> <!-- Convenient shorthands for standard locations within the workspace. --> <
property name="build.dir" location="build"/>
<
property name="dist.dir" location="dist"/>
<
property name="make.dir" location="make"/>
<
property name="src.dir" location="src"/>
<
property name="test.dir" location="test"/>
<!-- java.marker is set to a marker file to check for within a Java install dir. executables; regrettably, that is OS-specific. --> <!-- Standard property values, if not overriden by earlier settings. --> <!-- launcher.java is used in the launcher scripts provided to run the tools' jar files. If it has not already been set, then quietly default to simply use "java". --> <!-- Standard target to build deliverables for JDK build. --> <
target name="build" depends="build-bootstrap-tools,build-all-classes">
<
target name="build-bootstrap-tools" depends="build-bootstrap-javac,build-bootstrap-javadoc,build-bootstrap-doclets,build-bootstrap-javah"/>
<
target name="build-all-tools" depends="build-javac,build-javadoc,build-doclets,build-javah,build-javap,build-apt"/>
<
target name="build-all-classes" depends="build-bootstrap-javac">
<
target name="clean" description="Delete all generated files">
<!-- Additional targets for running tools on the build --> <
target name="jtreg" depends="build-all-tools,-def-jtreg">
<
target name="findbugs" depends="-def-findbugs,build-all-tools">
<
arg value="-longBugCodes"/>
<
target name="coverage" depends="-def-cobertura,build-all-classes,instrument-classes,jtreg,coverage-report"/>
<
target name="instrument-classes" depends="-def-cobertura">
<!-- only define the following property when we want coverage info --> includes="**/*.class" excludes="**/resources/*.class"/>
<
target name="coverage-report" depends="-def-cobertura">
<
target name="build-bootstrap-javac" depends="-def-build-bootstrap-classes,-def-build-bootstrap-jar,-def-build-bootstrap-tool">
<
build-
bootstrap-
tool name="javac"/>
<
target name="build-classes-javac" depends="build-bootstrap-javac">
<
target name="build-javac" depends="build-classes-javac">
<
build-
tool name="javac"/>
<
target name="javadoc-javac" depends="build-javac,-def-javadoc-tool">
<
target name="jtreg-javac" depends="build-javac,build-javap,-def-jtreg">
<
target name="findbugs-javac" depends="build-javac,-def-findbugs">
<
findbugs-
tool name="javac"/>
<
target name="javac" depends="build-javac,jtreg-javac,findbugs-javac"/>
<
target name="build-bootstrap-javadoc" depends="build-bootstrap-javac">
<
build-
bootstrap-
tool name="javadoc"/>
<
target name="build-classes-javadoc" depends="build-classes-javac">
<
target name="build-javadoc" depends="build-javac,build-classes-javadoc">
<
build-
tool name="javadoc"/>
<
target name="javadoc-javadoc" depends="build-javadoc,-def-javadoc-tool">
<
target name="jtreg-javadoc" depends="build-javadoc,-def-jtreg">
<
target name="findbugs-javadoc" depends="build-javadoc,-def-findbugs">
<
findbugs-
tool name="javadoc"/>
<
target name="javadoc" depends="build-javadoc,jtreg-javadoc,findbugs-javadoc"/>
<
target name="build-bootstrap-doclets" depends="build-bootstrap-javadoc,-def-build-bootstrap-jar">
<
target name="build-classes-doclets" depends="build-classes-javadoc">
<
target name="build-doclets" depends="build-javadoc,build-classes-doclets">
<!-- just jar, no bin for doclets --> <!-- (no javadoc for doclets) --> <
target name="jtreg-doclets" depends="build-doclets,-def-jtreg">
<
target name="findbugs-doclets" depends="build-doclets,-def-findbugs">
<
findbugs-
tool name="doclets"/>
<
target name="doclets" depends="build-doclets,jtreg-doclets,findbugs-doclets"/>
<
target name="build-bootstrap-javah" depends="build-bootstrap-javadoc">
<
build-
bootstrap-
tool name="javah"/>
<
target name="build-javah" depends="build-javac,build-classes-javah">
<
build-
tool name="javah"/>
<
target name="build-classes-javah" depends="build-classes-javadoc">
<!-- (no javadoc for javah) --> <
target name="jtreg-javah" depends="build-javah,-def-jtreg">
<
target name="findbugs-javah" depends="build-javah,-def-findbugs">
<
findbugs-
tool name="javah"/>
<
target name="javah" depends="build-javah,jtreg-javah,findbugs-javah"/>
<
target name="build-bootstrap-javap" depends="-def-build-bootstrap-classes,-def-build-bootstrap-jar,-def-build-bootstrap-tool">
<
build-
bootstrap-
tool name="javap"/>
<
target name="build-classes-javap" depends="build-classes-javac">
<
target name="build-javap" depends="build-javac,build-classes-javap">
<
build-
tool name="javap"/>
<!-- (no javadoc for javap) --> <
target name="jtreg-javap" depends="build-javap,-def-jtreg">
<
target name="findbugs-javap" depends="build-javap,-def-findbugs">
<
findbugs-
tool name="javap"/>
<
target name="javap" depends="build-javap,jtreg-javap,findbugs-javap"/>
<
target name="build-bootstrap-apt" depends="build-bootstrap-javac">
<
build-
bootstrap-
tool name="apt"/>
<
target name="build-apt" depends="build-javac,build-classes-apt">
<
target name="build-classes-apt" depends="build-classes-javac">
<
target name="javadoc-apt" depends="build-apt,-def-javadoc-tool">
<
target name="jtreg-apt" depends="build-apt,-def-jtreg">
<
jtreg-
tool name="apt" tests="${apt.tests}"/>
<
target name="findbugs-apt" depends="build-apt,-def-findbugs">
<
findbugs-
tool name="apt"/>
<
target name="apt" depends="build-apt,jtreg-apt,findbugs-apt"/>
<!-- Ant macro and preset defs --> <
target name="-def-build-tool">
<
macrodef name="build-tool">
<
filterset begintoken="#" endtoken="#">
<
filter token="PROGRAM" value="@{name}"/>
<
filter token="TARGET_JAVA" value="@{java}"/>
<
chmod file="@{bin.dir}/@{name}" perm="ugo+rx"/>
<
target name="-def-build-jar">
<
macrodef name="build-jar">
<
attribute name="includes"/>
<
attribute name="jarclasspath" default=""/>
<
jar destfile="@{lib.dir}/@{name}.jar" <
attribute name="Main-Class" value="@{jarmainclass}"/>
<
attribute name="Class-Path" value="@{jarclasspath}"/>
<
target name="-def-build-classes" depends="-def-pcompile">
<
macrodef name="build-classes">
<
attribute name="includes"/>
<
attribute name="release" default="${release}"/>
<
globmapper from="*.properties-template" to="*.properties"/>
<
filterset begintoken="$(" endtoken=")">
<
filter token="RELEASE" value="@{release}"/>
includes="**/*.properties"/>
<
compilerarg value="-J-Xbootclasspath/p:@{bootclasspath}"/>
<
compilerarg value="-Xbootclasspath/p:@{classes.dir}"/>
<
include name="@{includes}"/>
<
exclude name="**/*.java"/>
<
exclude name="**/*.properties"/>
<
exclude name="**/*-template"/>
<
presetdef name="build-bootstrap-tool">
<
target name="-def-build-bootstrap-jar" depends="-def-build-jar">
<
presetdef name="build-bootstrap-jar">
<
target name="-def-build-bootstrap-classes" depends="-def-build-classes">
<
presetdef name="build-bootstrap-classes">
<
target name="-def-pcompile">
classname="CompilePropertiesTask" <
macrodef name="javadoc-tool">
<
attribute name="includes"/>
<
attribute name="options" default=""/>
<
attribute name="source" default="1.5"/>
<!-- FIXME --> <
property name="javadoc.options" value=""/>
<!-- default, can be overridden per user or per project --> <!-- Note: even with this default value, includes <
property name="javadoc.packagenames" value="none"/>
<!-- default, can be overridden per user or per project --> <
header><
![CDATA[<strong>Unofficial Javadoc</strong> generated from developer sources for preview purposes only]]></
header>
<!-- 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.) --> <
filename name="javax/"/>
<
macrodef name="jtreg-tool">
<
attribute name="tests"/>
<
attribute name="samevm" default="true"/>
<
attribute name="verbose" default="summary"/>
<
attribute name="options" default=""/>
<
attribute name="keywords" default="-keywords:!ignore"/>
samevm="@{samevm}" verbose="@{verbose}" failonerror="false" resultproperty="jtreg.@{name}.result" <
arg line="@{keywords}"/>
<!-- the next two properties are for convenience, when only a single instance of jtreg will be invoked. --> <
equals arg1="${jtreg.@{name}.result}" arg2="0"/>
<
include name="lib/**/*.jar"/>
<
macrodef name="findbugs-tool">
<
attribute name="output" default="emacs"/>
<
attribute name="outputFile" default=""/>
<
attribute name="reportLevel" default="high"/>
outputFile="@{outputFile}" reportLevel="@{reportLevel}" errorProperty="findbugs.@{name}.errors" warningsProperty="findbugs.@{name}.warnings" <
class location="${dist.dir}/lib/@{name}.jar"/>
<
target name="-def-check">
<
attribute name="property"/>
<
attribute name="marker"/>
<
fail message="Cannot locate @{name}: please set @{property} to its location">
<
isset property="@{property}"/>
<
fail message="@{name} is not installed in ${@{property}}">
<
available file="${@{property}}/@{marker}"/>
<!-- standard JDK target --> description="display settings of congiguration values">
<!-- useful debugging targets --> <
target name="diagnostics">
<
target name="post-sanity" depends="-def-jtreg,sanity,build" description="perform basic validation after a standard build">