8058489: More adjustments of langtools/make/build.xml to modularized layout
authorjlahoda
Fri, 07 Nov 2014 18:22:36 +0100
changeset 27546 79b6b60ff60a
parent 27545 9b19c6e31489
child 27547 d07b3dcbc707
8058489: More adjustments of langtools/make/build.xml to modularized layout Summary: Re-structuring the langtools/make/build.xml to reflect the modular layout, cleanup of the build script Reviewed-by: jjg, mcimadamore, ksrini
langtools/make/build.properties
langtools/make/build.xml
langtools/make/launcher.sh-template
langtools/make/netbeans/langtools/build.xml
langtools/make/netbeans/langtools/nbproject/project.xml
langtools/make/tools/anttasks/SelectToolTask.java
--- a/langtools/make/build.properties	Fri Nov 07 07:54:35 2014 -0500
+++ b/langtools/make/build.properties	Fri Nov 07 18:22:36 2014 +0100
@@ -23,25 +23,46 @@
 # questions.
 #
 
-# This is the JDK used to build and run the bootstrap version of javac.
-# The bootstrap javac is used to compile both boostrap versions of the
-# other tools, and product versions of all the tools.
-# Override this path as needed, either on the command line or in
-# one of the standard user build.properties files (see build.xml)
+#javac configuration for "normal build" (these will be passed to the bootstrap compiler):
+javac.debug = true
+javac.debuglevel = source,lines,vars
+javac.extra.opts=-XDignore.symbol.file=true
+javac.includes=
+javac.lint.opts = -Xlint:all,-deprecation -Werror
+javac.source = 8
+javac.target = 8
 
-# boot.java.home = /opt/jdk/1.7.0
-boot.java = ${boot.java.home}/bin/java
-boot.javac = ${boot.java.home}/bin/javac
+#javac configuration for bootstrap build (these will be passed to the compiler from the given boot JDK):
+boot.javac.extra.opts=-XDignore.symbol.file=true
+boot.javac.includes = \
+        javax/annotation/processing/ \
+        javax/lang/model/ \
+        javax/tools/ \
+        jdk/ \
+        com/sun/source/ \
+        com/sun/tools/javac/ \
+        com/sun/tools/doclint/
+boot.javac.lint.opts=
 boot.javac.source = 8
 boot.javac.target = 8
 
-# This is the JDK used to run the product version of the tools,
-# for example, for testing. If you're building a complete JDK, specify that.
-# Override this path as needed, either on the command line or in
-# one of the standard user build.properties files (see build.xml)
+#configuration of submodules (share by both the bootstrap and normal compilation):
+langtools.modules=java.base:java.compiler:jdk.compiler:jdk.dev:jdk.javadoc
+java.base.dependencies=
+java.compiler.dependencies=java.base
+jdk.compiler.dependencies=java.base:java.compiler
+jdk.javadoc.dependencies=java.base:java.compiler:jdk.compiler
+jdk.dev.dependencies=java.base:java.compiler:jdk.compiler
 
-# target.java.home = /opt/jdk/1.8.0
-target.java = ${target.java.home}/bin/java
+#test configuration:
+jtreg.tests=
+boot.javac.tests = tools/javac
+crules.tests = ../make/test/crules
+
+#javadoc configuration
+javadoc.jls.cite=The Java™ Language Specification
+javadoc.jls.option=-tag "jls:a:See <cite>${javadoc.jls.cite}</cite>:" \
+    -tag "implNote:a:Implementation Note:"
 
 # Version info -- override as needed
 jdk.version = 1.9.0
@@ -55,146 +76,4 @@
 # timestamps
 # FIXME -- need to include openjdk as needed
 release = ${jdk.version}-${milestone}
-bootstrap.release = ${release}_bootstrap
 full.version = ${release}-${build.number}
-bootstrap.full.version = ${bootstrap.release}-${build.number}
-
-# options for the <javac> tasks used to compile the tools
-javac.source = 8
-javac.target = 8
-javac.debug = true
-javac.debuglevel = source,lines
-javac.no.jdk.warnings = -XDignore.symbol.file=true
-# set the following to -version to verify the versions of javac being used
-javac.version.opt =
-# in time, there should be no exceptions to -Xlint:all
-javac.lint.opts = -Xlint:all,-deprecation -Werror
-
-# options for the <javadoc> task for javac
-#javadoc.jls3.url=http://java.sun.com/docs/books/jls/
-#javadoc.jls3.cite=&lt;a href=&quot;${javadoc.jls3.url}&quot;&gt;The Java Language Specification, Third Edition&lt;/a&gt;
-#javadoc.jls3.option=-tag "jls3:a:See &lt;cite&gt;${javadoc.jls3.cite}&lt;/cite&gt;:"
-
-
-javadoc.jls.cite=The Java&trade; Language Specification
-
-javadoc.jls.option=-tag "jls:a:See &lt;cite&gt;${javadoc.jls.cite}&lt;/cite&gt;:"
-
-
-
-
-
-# jtreg, used to run the JDK regression tests
-# See http://openjdk.java.net/jtreg/
-# Override this path as needed, either on the command line or in
-# one of the standard user build.properties files (see build.xml)
-
-# jtreg.home = /opt/jtreg/4.1
-
-# findbugs
-# See http://findbugs.sourceforge.net/
-# Override this path as needed, either on the command line or in
-# one of the standard user build.properties files (see build.xml)
-
-# findbugs.home = /opt/findbugs/1.2.1
-
-# vizant (graph visualization tool for Ant)
-# See http://vizant.sourceforge.net/
-# Override this path as needed, either on the command line or in
-# one of the standard user build.properties files (see build.xml)
-
-# vizant.jar = /opt/vizant/0.1.2/vizant-0.1.2.jar
-# dot = dot
-
-#------------------------------------------------------------
-
-# The following properties define the packages for each of the tools.
-# Syntactically, they should be suitable as arguments for the "includes"
-# parameter of Ant filesets. In particular, note the trailing '/'.
-
-javac.includes = \
-        javax/annotation/processing/ \
-        javax/lang/model/ \
-        javax/tools/ \
-        jdk/ \
-        com/sun/source/ \
-        com/sun/tools/javac/ \
-        com/sun/tools/doclint/
-
-javac.tests = \
-        tools/javac
-
-#
-
-javadoc.includes = \
-        com/sun/javadoc/ \
-        com/sun/tools/javadoc/ \
-        com/sun/tools/doclets/
-
-javadoc.tests = \
-        tools/javadoc/ \
-        com/sun/javadoc/
-
-#
-
-javah.includes = \
-        com/sun/tools/javah/
-
-javah.tests = \
-        tools/javah/
-
-#
-
-javap.includes = \
-        com/sun/tools/classfile/ \
-        com/sun/tools/javap/ \
-        com/sun/tools/jdeps/ \
-        sun/tools/javap/
-
-javap.tests = \
-        tools/javap/
-
-#
-
-sjavac.includes = \
-        com/sun/tools/sjavac/
-
-sjavac.tests = \
-        tools/sjavac
-
-crules.tests = ../make/test/crules
-
-#
-
-# The following files require the latest JDK to be available.
-# The API can be provided by using a suitable boot.java.home
-# or by setting import.jdk
-require.latest.jdk.files = \
-    com/sun/tools/javac/nio/*.java
-
-# The following files in the import jdk source directory are required
-# in order to compile the files defined in ${require.latest.jdk.files}
-#
-# For NIO, the list of stub files is defined by the contents of the primary
-# API packages, together with such types that may be required in order to
-# compile the stubs. Some of these dependencies would go away if the stub
-# generator were to be improved -- e.g. by removing unnecessary imports.
-#
-import.jdk.stub.files = \
-    java/io/File.java \
-    java/nio/file/**.java \
-    java/nio/file/attribute/**.java \
-    java/nio/file/spi/**.java \
-    java/nio/channels/AsynchronousChannel.java \
-    java/nio/channels/AsynchronousFileChannel.java \
-    java/nio/channels/CompletionHandler.java \
-    java/nio/channels/SeekableByteChannel.java
-
-# The following value is used by the main jtreg target.
-# An empty value means all tests
-# Override as desired to run a specific set of tests
-jtreg.tests =
-
-# Check style configuration
-# overridable name and version
-checkstyle.name.version = checkstyle-5.4
--- a/langtools/make/build.xml	Fri Nov 07 07:54:35 2014 -0500
+++ b/langtools/make/build.xml	Fri Nov 07 18:22:36 2014 +0100
@@ -25,10 +25,10 @@
 -->
 
 <!--
- This is the main build file for the complete langtools repository.
- It is used when building JDK (in which case it is invoked from the
- Makefile), and it can be used when working on the tools themselves,
- in an IDE such as NetBeans.
+ This is a convenience build file supporting development in the langtools
+ repository. It can be run either standalone, or from IDEs. This build script
+ is for a developer use only, it is not used to build the production version
+ of javac or other langtools tools.
 
  External dependencies are specified via properties. These can be given
  on the command line, or by providing a local build.properties file.
@@ -39,58 +39,27 @@
  For example, to run any of the jtreg tests you must set jtreg.home,
  to run findbugs on the code you must set findbugs.home, and so on.
 
- For the most part, javac can be built using the previous version of JDK.
- However, a small number of javac files require access to the latest JDK,
- which may not yet have been compiled. To compile these files, you can do
- one of the following:
- - Set boot.java.home to a recent build of the latest version of JDK.
- - Set import.jdk to either a recent build (containing jre/lib/rt.jar)
-   or to jdk source repository.  In the latter case, stub files will
-   automatically be generated and used for the required API, to avoid
-   unnecessary compilation of the source repository.
- If you do neither, the relevant files will not be built.
-
  The main build happens in two phases:
- - First, javac and other tools as needed are built using ${boot.java.home}.
-   (This implies a constraint on the source code that they can be compiled
-   with the previous version of JDK.
+ - First, javac is built using ${boot.java.home}. (This implies a constraint
+   on the source code that they can be compiled with the previous version of JDK.
  - Second, all required classes are compiled with the latest javac, created
    in the previous step.
- The first phase is called the bootstrap phase. All targets, properties and
- tasks that are specific to that phase have "bootstrap" in their name.
+ The build generally builds one module at time.
 
- For more details on the JDK build, see
-    http://blogs.sun.com/kto/entry/anatomy_of_the_jdk_build
-    http://openjdk.java.net/groups/build/
  For more details on the stub generator, see
     http://blogs.sun.com/jjg/entry/building_javac_for_jdk7
 
  Internal details ...
 
- Interim build products are created in the build/ directory.
- Final build products are created in the dist/ directory.
- When building JDK, the dist/directory will contain:
- - A bootstrap compiler suitable for running with ${boot.java.home}
-   suitable for compiling downstream parts of JDK
- - Source files and class files for inclusion in the JDK being built
- When building standalone, the dist/directory will contain:
- - Separate jar files for each of the separate langtools components
- - Simple scripts to invoke the tools by executing the corresponding
-   jar files.
- These jar files and scripts are "for developer use only".
+ Bootstrap classes are built into the build/bootstrap/<module-name>/classes directory.
+ Final classes are built into the build/<module-name>/classes directory.
+ Final runnable javac is in dist/bin and dist/lib. Bootstrap javac (if requested by
+ using the build-bootstrap-javac target) is built into dist/bootstrap.
 
  This file is organized into sections as follows:
  - global property definitions
- - general top level targets
- - general diagnostic/debugging targets
- - groups of targets for each tool: javac, javadoc, javah, javap
-    Within each group, the following targets are provided, where applicable
-      build-bootstrap-TOOL      build the bootstrap version of the tool
-      build-classes-TOOL        build the classes for the tool
-      build-TOOL                build the jar file and script for the tool
-      jtreg-TOOL                build the tool and run the appropriate tests
-      findbugs-TOOL             run findbugs on the tool's source code
-      TOOL                      build the tool, run the tests, and run findbugs
+ - primary top level targets (cleaning, building, testing, producing javac)
+ - secondary top level targets (code analysis, diagnostics, extra documentation, etc.)
  - utility definitions
  -->
 
@@ -99,13 +68,6 @@
     **** Global property definitions.
     -->
 
-    <!-- Force full debuginfo for javac if the debug.classfiles
-    property is set.  This must be BEFORE the include of
-    build.properties because it sets javac.debuglevel.  -->
-    <condition property="javac.debuglevel" value="source,lines,vars">
-        <equals arg1="${debug.classfiles}" arg2="true"/>
-    </condition>
-
     <!-- The following locations can be used to override default property values. -->
 
     <!-- Use this location for customizations specific to this instance of this workspace -->
@@ -119,36 +81,24 @@
 
     <!-- Convenient shorthands for standard locations within the workspace. -->
     <property name="build.dir" location="build"/>
-    <property name="build.bootstrap.dir" location="${build.dir}/bootstrap"/>
-    <property name="build.coverage.dir" location="${build.dir}/coverage"/>
-    <property name="build.classes.dir" location="${build.dir}/classes"/>
-    <property name="build.gensrc.dir" location="${build.dir}/gensrc"/>
-    <property name="build.genstubs.dir" location="${build.dir}/genstubs"/>
-    <property name="build.javadoc.dir" location="${build.dir}/javadoc"/>
+    <property name="build.crules.dir" location="${build.dir}/crules"/>
     <property name="build.jtreg.dir" location="${build.dir}/jtreg"/>
     <property name="build.toolclasses.dir" location="${build.dir}/toolclasses"/>
+    <property name="build.javadoc.dir" location="${build.dir}/javadoc"/>
     <property name="dist.dir" location="dist"/>
     <property name="dist.bin.dir" location="${dist.dir}/bin"/>
-    <property name="dist.coverage.dir" location="${dist.dir}/coverage"/>
+    <property name="dist.lib.dir" location="${dist.dir}/lib"/>
     <property name="dist.findbugs.dir" location="${dist.dir}/findbugs"/>
     <property name="dist.checkstyle.dir" location="${dist.dir}/checkstyle"/>
-    <property name="dist.lib.dir" location="${dist.dir}/lib"/>
     <property name="make.dir" location="make"/>
     <property name="make.conf.dir" location="${make.dir}/conf"/>
     <property name="make.tools.dir" location="${make.dir}/tools"/>
-    <property name="src.dir" location="src"/>
-    <property name="src.bin.dir" location="${src.dir}/share/bin"/>
     <property name="test.dir" location="test"/>
 
-    <path id="src.dirs">
-      <pathelement path="${src.dir}/java.base/share/classes"/>
-      <pathelement path="${src.dir}/java.compiler/share/classes"/>
-      <pathelement path="${src.dir}/jdk.compiler/share/classes"/>
-      <pathelement path="${src.dir}/jdk.dev/share/classes"/>
-      <pathelement path="${src.dir}/jdk.javadoc/share/classes"/>
-    </path>
-
-    <pathconvert pathsep="," property="src.dirs.property" refid="src.dirs" />
+    <property name="boot.build.dir" location="${build.dir}/bootstrap"/>
+    <property name="boot.dist.dir" location="${dist.dir}/bootstrap"/>
+    <property name="boot.dist.bin.dir" location="${boot.dist.dir}/bin"/>
+    <property name="boot.dist.lib.dir" location="${boot.dist.dir}/lib"/>
 
     <!-- java.marker is set to a marker file to check for within a Java install dir.
          The best file to check for across Solaris/Linux/Windows/MacOS is one of the
@@ -172,110 +122,89 @@
         <isset property="target.java.home"/>
     </condition>
 
-    <!-- Logic for handling access import jdk classes, if available.
-        import.jdk should be unset, or set to jdk home (to use rt.jar)
-        or to jdk repo (to use src/share/classes).
-        Based on the value, if any, set up default values for javac's sourcepath,
-        classpath and bootclasspath. Note: the default values are overridden
-        in the build-bootstrap-classes macro. -->
-
-    <available property="import.jdk.src.dir" value="${import.jdk}/src/share/classes"
-        filepath="${import.jdk}/src/share/classes" file="java/nio/file/Path.java"/>
-    <available property="import.jdk.jar" value="${import.jdk}/jre/lib/rt.jar"
-        ignoresystemclasses="true"
-        classpath="${import.jdk}/jre/lib/rt.jar" classname="java.nio.file.Path"/>
-
-    <!-- Set the default bootclasspath option used for javac.
-        Note that different variants of the option are used, meaning we can't just
-        define the value for the option.
-        Note the explicit use of the standard property ${path.separator} in the following.
-        This is because Ant is not clever enough to handle direct use of : or ; -->
-    <condition property="javac.bootclasspath.opt"
-            value="-Xbootclasspath:${build.classes.dir}${path.separator}${import.jdk.jar}"
-            else="-Xbootclasspath/p:${build.classes.dir}">
-        <isset property="import.jdk.jar"/>
-    </condition>
-
-    <condition property="boot.java.provides.latest.jdk">
-        <available
-            ignoresystemclasses="true"
-            classpath="${boot.java.home}/jre/lib/rt.jar" classname="java.nio.file.Path"/>
-    </condition>
-
-    <condition property="bootstrap.exclude.files" value="" else="${require.latest.jdk.files}">
-        <isset property="boot.java.provides.latest.jdk"/>
-    </condition>
-
-    <condition property="exclude.files" value="" else="${require.latest.jdk.files}">
-        <or>
-            <isset property="boot.java.provides.latest.jdk"/>
-            <isset property="import.jdk"/>
-        </or>
-    </condition>
-
-    <condition property="require.import.jdk.stubs">
-        <and>
-            <not>
-                <isset property="boot.java.provides.latest.jdk"/>
-            </not>
-            <isset property="import.jdk.src.dir"/>
-        </and>
-    </condition>
-
-    <!-- Set the default value of the sourcepath used for javac. -->
-    <condition property="javac.sourcepath" value="${build.genstubs.dir}" else="">
-        <isset property="require.import.jdk.stubs"/>
-    </condition>
-
-    <!-- Set the default value of the classpath used for javac. -->
-    <property name="javac.classpath" value=""/>
-
+    <!-- setup basic properties holding paths to all sources, generated source and class directories
+         (both boot and non-boot) -->
+    <pathconvert property="langtools.sources">
+        <path>
+            <pathelement path="${langtools.modules}" />
+        </path>
+        <map from="${basedir}/" to="${basedir}/src/" />
+        <mapper type="glob" from="*" to="*/share/classes"/>
+    </pathconvert>
+    <pathconvert property="langtools.gensrc">
+        <path>
+            <pathelement path="${langtools.modules}" />
+        </path>
+        <map from="${basedir}/" to="${build.dir}/" />
+        <mapper type="glob" from="*" to="*/gensrc"/>
+    </pathconvert>
+    <pathconvert property="langtools.boot.classes">
+        <path>
+            <pathelement path="${langtools.modules}" />
+        </path>
+        <map from="${basedir}/" to="${boot.build.dir}/" />
+        <mapper type="glob" from="*" to="*/classes"/>
+    </pathconvert>
+    <pathconvert property="langtools.classes">
+        <path>
+            <pathelement path="${langtools.modules}" />
+        </path>
+        <map from="${basedir}/" to="${build.dir}/" />
+        <mapper type="glob" from="*" to="*/classes"/>
+    </pathconvert>
 
     <!--
-    **** General top level targets.
+        **** Primary targets
     -->
 
-    <!-- Standard target to build deliverables for JDK build. -->
-
-    <target name="build" depends="build-bootstrap-tools,build-all-classes">
-        <copy todir="${dist.dir}/bootstrap">
-            <fileset dir="${build.bootstrap.dir}" includes="bin/,lib/"/>
-        </copy>
-        <chmod dir="${dist.dir}/bootstrap/bin" perm="ugo+rx">
-            <include name="*"/>
-        </chmod>
-        <mkdir dir="${dist.lib.dir}"/>
-        <jar file="${dist.lib.dir}/classes.jar" basedir="${build.classes.dir}"/>
-        <zip file="${dist.lib.dir}/src.zip">
-            <multirootfileset basedirs="${src.dirs.property}" />
-        </zip>
-    </target>
-
-    <target name="build-bootstrap-tools"
-        depends="build-bootstrap-javac,build-bootstrap-javadoc,build-bootstrap-javah,build-bootstrap-sjavac"
-    />
-
-    <target name="build-all-tools"
-        depends="build-javac,build-javadoc,build-javah,build-javap,build-sjavac"
-    />
-
-    <target name="build-all-classes" depends="build-bootstrap-javac,-create-import-jdk-stubs">
-        <build-classes includes="${javac.includes} ${javadoc.includes} ${javah.includes} ${javap.includes} ${sjavac.includes}"/>
-    </target>
-
-    <!-- clean -->
-
     <target name="clean" description="Delete all generated files">
         <delete dir="${build.dir}"/>
         <delete dir="${dist.dir}"/>
     </target>
 
-    <!-- Additional targets for running tools on the build -->
+    <target name="build" depends="build-all-tools">
+    </target>
+
+    <target name="build-all-tools" depends="build-all-classes,-def-build-all-module-jars,-def-build-tool">
+        <build-all-module-jars />
+        <build-tool name="javac"/>
+        <build-tool name="javadoc"/>
+        <build-tool name="javap"/>
+        <build-tool name="javah"/>
+        <build-tool name="sjavac"/>
+    </target>
+
+    <target name="build-all-classes" depends="-def-build-all-module-classes,build-bootstrap-javac-classes">
+        <build-all-module-classes />
+    </target>
 
     <target name="jtreg" depends="build-all-tools,-def-jtreg">
         <jtreg-tool name="all" tests="${jtreg.tests}"/>
     </target>
 
+    <target name="javadoc" depends="build-all-classes,-def-javadoc-tool">
+        <javadoc-tool options="${javadoc.jls.option}"/>
+    </target>
+
+    <target name="build-bootstrap-javac-classes" depends="-check-boot.java.home,-def-build-all-module-classes">
+        <build-all-module-classes compilation.kind="boot." />
+    </target>
+
+    <!--
+        **** Extra targets
+    -->
+
+    <target name="build-bootstrap-javac" depends="build-bootstrap-javac-classes,-def-build-all-module-jars,-def-build-tool">
+        <build-all-module-jars compilation.kind="boot." />
+        <build-tool name="javac" compilation.kind="boot." />
+    </target>
+
+    <target name="jtreg-bootstrap-javac" depends="build-bootstrap-javac,-def-jtreg">
+        <jtreg-tool name="bootstrap-javac"
+                    tests="${boot.javac.tests}"
+                    langtools.classes="${langtools.boot.classes}"/>
+    </target>
+
     <target name="checkstyle" depends="-def-checkstyle"
         description="Generates reports for code convention violations.">
         <mkdir dir="${dist.checkstyle.dir}"/>
@@ -325,9 +254,13 @@
             warningsProperty="findbugs.all.warnings"
             jvm="${target.java.home}/bin/java"
             jvmargs="-Xmx512M">
-            <class location="${build.classes.dir}"/>
+            <class location="${build.dir}/java.base/classes"/>
+            <class location="${build.dir}/java.compiler/classes"/>
+            <class location="${build.dir}/jdk.compiler/classes"/>
+            <class location="${build.dir}/jdk.javadoc/classes"/>
+            <class location="${build.dir}/jdk.dev/classes"/>
             <sourcePath>
-                <path refid="src.dirs"/>
+                <pathelement path="${langtools.sources}"/>
             </sourcePath>
         </findbugs>
         <exec executable="sh">
@@ -339,49 +272,7 @@
         </exec>
     </target>
 
-    <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 -->
-        <path id="coverage.classpath">
-            <pathelement location="${build.coverage.dir}/classes"/>
-            <path refid="cobertura.classpath"/>
-        </path>
-        <property name="coverage.options" value="-Dnet.sourceforge.cobertura.datafile=${build.coverage.dir}/cobertura.ser"/>
-        <property name="coverage.classpath" refid="coverage.classpath"/>
-        <mkdir dir="${build.coverage.dir}/classes"/>
-        <delete file="${build.coverage.dir}/cobertura.ser"/>
-        <cobertura-instrument todir="${build.coverage.dir}/classes"
-            datafile="${build.coverage.dir}/cobertura.ser">
-            <fileset dir="${build.classes.dir}"
-               includes="**/*.class" excludes="**/resources/*.class"/>
-        </cobertura-instrument>
-    </target>
-
-    <target name="coverage-report" depends="-def-cobertura">
-        <mkdir dir="${dist.coverage.dir}"/>
-        <cobertura-report
-            destdir="${dist.coverage.dir}"
-            datafile="${build.coverage.dir}/cobertura.ser">
-            <fileset dir="${src.dir}/java.base/share/classes"/>
-            <fileset dir="${src.dir}/java.compiler/share/classes"/>
-            <fileset dir="${src.dir}/jdk.compiler/share/classes"/>
-            <fileset dir="${src.dir}/jdk.dev/share/classes"/>
-            <fileset dir="${src.dir}/jdk.javadoc/share/classes"/>
-        </cobertura-report>
-        <cobertura-report
-            format="xml"
-            destdir="${dist.coverage.dir}"
-            datafile="${build.coverage.dir}/cobertura.ser">
-            <fileset dir="${src.dir}/java.base/share/classes"/>
-            <fileset dir="${src.dir}/java.compiler/share/classes"/>
-            <fileset dir="${src.dir}/jdk.compiler/share/classes"/>
-            <fileset dir="${src.dir}/jdk.dev/share/classes"/>
-            <fileset dir="${src.dir}/jdk.javadoc/share/classes"/>
-        </cobertura-report>
-    </target>
-
-    <target name="diags-examples" depends="build-javac,build-javap">
+    <target name="diags-examples" depends="build-all-tools">
         <!-- can override the following on the command line if desired. -->
         <property name="diags.examples.out" location="${build.dir}/diag-examples/diags-examples.html"/>
         <mkdir dir="${build.dir}/diag-examples/classes"/>
@@ -391,7 +282,7 @@
             destdir="${build.dir}/diag-examples/classes"
             includes="ArgTypeCompilerFactory.java,Example.java,FileManager.java,HTMLWriter.java,RunExamples.java,DocCommentProcessor.java"
             sourcepath=""
-            classpath="${dist.lib.dir}/javac.jar;${dist.lib.dir}/javap.jar"
+            classpath="${langtools.classes}"
             includeAntRuntime="no"
             debug="${javac.debug}"
             debuglevel="${javac.debuglevel}">
@@ -400,7 +291,7 @@
         <java fork="true"
             jvm="${target.java.home}/bin/java"
             dir="test/tools/javac/diags"
-            classpath="${build.dir}/diag-examples/classes;${dist.lib.dir}/javac.jar;${dist.lib.dir}/javap.jar"
+            classpath="${build.dir}/diag-examples/classes;${langtools.classes}"
             classname="RunExamples">
             <jvmarg value="-Dtest.classes=${build.dir}/diag-examples/classes"/>
             <arg value="-examples"/>
@@ -413,56 +304,16 @@
         </java>
     </target>
 
-    <!-- a patching facility to speed up incorporating the langtools' classfiles
-         into a jdk of your choice. Either target.java.home or patch.jdk can be
-         set on the command line; setting target.java.home has the advantage of
-         patching the jdk used for jtreg and other tests.
-    -->
-    <target name="patch" depends="build-all-classes">
-        <condition property="patch.jdk" value="${target.java.home}">
-            <available file="${target.java.home}" type="dir"/>
-        </condition>
-        <fail message="patch.jdk or target.java.home is not set, please set target.java.home, or patch.jdk for an alternate jdk image to patch">
-            <condition>
-                <not>
-                    <isset property="patch.jdk"/>
-                </not>
-            </condition>
-        </fail>
-        <property name="patch.tools.jar" location="${patch.jdk}/lib/tools.jar"/>
-        <property name="patch.rt.jar" location="${patch.jdk}/jre/lib/rt.jar"/>
-        <fail message="patch.jdk or target.java.home must point to a valid jdk image: missing tools.jar">
-            <condition>
-                <not>
-                    <available file="${patch.tools.jar}" type="file"/>
-                </not>
-            </condition>
-        </fail>
-        <fail message="patch.jdk or target.java.home must point to a valid jdk image: missing rt.jar">
-            <condition>
-                <not>
-                    <available file="${patch.rt.jar}" type="file"/>
-                </not>
-            </condition>
-        </fail>
-        <zip zipfile="${patch.tools.jar}" update="true">
-            <zipfileset dir="${build.classes.dir}" includes="com/**"/>
-        </zip>
-        <zip zipfile="${patch.rt.jar}" update="true">
-            <zipfileset dir="${build.classes.dir}" includes="javax/**"/>
-        </zip>
-    </target>
-
     <target name="doclint-api" depends="build-all-classes">
         <delete dir="${build.dir}/doclint/classes"/>
         <mkdir dir="${build.dir}/doclint/classes"/>
         <javac fork="true"
-               executable="${boot.javac}"
+               executable="${boot.java.home}/bin/javac"
                destdir="${build.dir}/doclint/classes"
                includes="javax/lang/model/** com/sun/javadoc/** com/sun/source/**"
                excludes=""
-               sourcepath="${javac.sourcepath}"
-               classpath="${javac.classpath}"
+               sourcepath=""
+               classpath="${langtools.classes}"
                includeAntRuntime="no"
                source="${javac.source}"
                target="${javac.target}"
@@ -471,12 +322,11 @@
             <compilerarg value="-implicit:none"/>
             <compilerarg value="-Xprefer:source"/>
             <compilerarg value="-J-Xbootclasspath/p:${build.bootstrap.dir}/classes"/>
-            <compilerarg line="${javac.no.jdk.warnings}"/>
-            <compilerarg line="${javac.version.opt}"/>
+            <compilerarg line="${javac.extra.opts}"/>
             <compilerarg line="-Xdoclint:all/protected,-missing"/>
             <src>
-                <path refid="src.dirs"/>
-                <path location="${build.gensrc.dir}"/>
+                <pathelement path="${langtools.sources}"/>
+                <pathelement path="${langtools.gensrc}"/>
             </src>
         </javac>
     </target>
@@ -515,17 +365,12 @@
             </classpath>
             <!-- platform classes used for documentation -->
             <bootclasspath>
-                <pathelement path="${build.dir}/classes"/>
+                <pathelement path="${langtools.classes}"/>
                 <pathelement path="${target.java.home}/jre/lib/rt.jar"/>
             </bootclasspath>
         </javadoc>
     </target>
 
-    <!--
-    **** Debugging/diagnostic targets.
-    -->
-
-    <!-- standard JDK target -->
     <target name="sanity"
         description="display settings of configuration values">
         <echo level="info">ant.home = ${ant.home}</echo>
@@ -536,257 +381,32 @@
         <echo level="info">checkstyle.home = ${checkstyle.home}</echo>
     </target>
 
-    <target name="post-sanity" depends="-def-jtreg,sanity,build"
-        description="perform basic validation after a standard build">
-        <jtreg
-            dir="make/test"
-            workDir="${build.jtreg.dir}/post-sanity/work"
-            reportDir="${build.jtreg.dir}/post-sanity/report"
-            jdk="${target.java.home}"
-            verbose="summary"
-            failonerror="false" resultproperty="jtreg.post-sanity.result">
-        </jtreg>
-    </target>
-
-    <!-- use vizant tool to generate graphical image of this Ant file.-->
-    <target name="vizant" depends="-def-vizant">
-        <mkdir dir="${build.dir}"/>
-        <echo message="Generating ${build.dir}/build.dot"/>
-        <vizant antfile="${make.dir}/build.xml" outfile="${build.dir}/build.dot"/>
-        <echo message="Generating ${build.dir}/build.png"/>
-        <exec executable="${dot}" >
-            <arg value="-Tpng"/>
-            <arg value="-o"/>
-            <arg file="${build.dir}/build.png"/>
-            <arg file="${build.dir}/build.dot"/>
-        </exec>
-    </target>
-
-    <target name="check-import.jdk">
-        <echo message="import.jdk: ${import.jdk}"/>
-        <echo message="import.jdk.jar: ${import.jdk.jar}"/>
-        <echo message="import.jdk.src.dir: ${import.jdk.src.dir}"/>
-    </target>
-
     <target name="diagnostics">
         <diagnostics/>
     </target>
 
-
-    <!--
-    **** javac targets.
-    -->
-
-    <target name="build-bootstrap-javac"
-            depends="-def-build-bootstrap-classes,-def-build-bootstrap-jar,-def-build-bootstrap-tool">
-        <build-bootstrap-classes includes="${javac.includes}"/>
-        <build-bootstrap-jar     name="javac" includes="${javac.includes}"/>
-        <build-bootstrap-tool    name="javac"/>
-    </target>
-
-    <target name="build-classes-javac" depends="build-bootstrap-javac,-create-import-jdk-stubs">
-        <build-classes includes="${javac.includes}"/>
-    </target>
-
-    <target name="build-javac" depends="build-classes-javac">
-        <build-jar  name="javac" includes="${javac.includes}"/>
-        <build-tool name="javac"/>
-    </target>
-
-    <target name="javadoc-javac" depends="build-javac,-def-javadoc-tool">
-        <javadoc-tool name="javac" includes="${javac.includes}" options="${javadoc.jls.option}"/>
-    </target>
-
-    <target name="jtreg-javac" depends="build-javac,build-javap,-def-jtreg">
-        <jtreg-tool name="javac" tests="${javac.tests}"/>
-    </target>
-
-    <target name="findbugs-javac" depends="build-javac,-def-findbugs">
-        <findbugs-tool name="javac"/>
-    </target>
-
-    <target name="javac" depends="build-javac,jtreg-javac,findbugs-javac"/>
-
-
-    <!--
-    **** javadoc targets.
-    -->
-
-    <target name="build-bootstrap-javadoc" depends="build-bootstrap-javac">
-        <build-bootstrap-classes includes="${javadoc.includes}"/>
-        <build-bootstrap-jar     name="javadoc" includes="${javadoc.includes}"
-                                 jarclasspath="javac.jar"/>
-        <build-bootstrap-tool    name="javadoc"/>
-    </target>
-
-    <target name="build-classes-javadoc" depends="build-classes-javac">
-        <build-classes includes="${javadoc.includes}"/>
-    </target>
-
-    <target name="build-javadoc" depends="build-javac,build-classes-javadoc">
-        <build-jar  name="javadoc" includes="${javadoc.includes}"
-                    jarclasspath="javac.jar"/>
-        <build-tool name="javadoc"/>
-    </target>
-
-    <target name="javadoc-javadoc" depends="build-javadoc,-def-javadoc-tool">
-        <javadoc-tool name="javadoc" includes="${javadoc.includes}"/>
-    </target>
-
-    <target name="jtreg-javadoc" depends="build-javadoc,-def-jtreg">
-        <jtreg-tool name="javadoc" tests="${javadoc.tests}"/>
-    </target>
-
-    <target name="findbugs-javadoc" depends="build-javadoc,-def-findbugs">
-        <findbugs-tool name="javadoc"/>
-    </target>
-
-    <target name="javadoc" depends="build-javadoc,jtreg-javadoc,findbugs-javadoc"/>
-
-    <!--
-    **** javah targets.
-    -->
-
-    <target name="build-bootstrap-javah" depends="build-bootstrap-javadoc">
-        <build-bootstrap-classes includes="${javah.includes}"/>
-        <build-bootstrap-jar     name="javah" includes="${javah.includes}"
-                                 jarclasspath="javadoc.jar javac.jar"/>
-        <build-bootstrap-tool    name="javah"/>
-    </target>
-
-    <target name="build-javah" depends="build-javac,build-classes-javah">
-        <build-jar  name="javah" includes="${javah.includes}" jarclasspath="javac.jar"/>
-        <build-tool name="javah"/>
-    </target>
-
-    <target name="build-classes-javah" depends="build-classes-javadoc">
-        <build-classes includes="${javah.includes}"/>
-    </target>
-
-    <!-- (no javadoc for javah) -->
-
-    <target name="jtreg-javah" depends="build-javah,-def-jtreg">
-        <jtreg-tool name="javah" tests="${javah.tests}"/>
-    </target>
-
-    <target name="findbugs-javah" depends="build-javah,-def-findbugs">
-        <findbugs-tool name="javah"/>
-    </target>
-
-    <target name="javah" depends="build-javah,jtreg-javah,findbugs-javah"/>
-
-
-    <!--
-    **** javap targets.
-    -->
-
-    <target name="build-bootstrap-javap"
-            depends="-def-build-bootstrap-classes,-def-build-bootstrap-jar,-def-build-bootstrap-tool">
-        <build-bootstrap-classes includes="${javap.includes}"/>
-        <build-bootstrap-jar     name="javap" includes="${javap.includes}"
-                                 jarmainclass="sun.tools.javap.Main"/>
-        <build-bootstrap-tool    name="javap"/>
-    </target>
-
-    <target name="build-classes-javap" depends="build-classes-javac">
-        <build-classes includes="${javap.includes}"/>
-    </target>
-
-    <target name="build-javap" depends="build-javac,build-classes-javap">
-        <build-jar  name="javap" includes="${javap.includes}"
-                    jarmainclass="com.sun.tools.javap.Main"
-                    jarclasspath="javac.jar"/>
-        <build-tool name="javap"/>
-    </target>
-
-    <!-- (no javadoc for javap) -->
-
-    <target name="jtreg-javap" depends="build-javap,-def-jtreg">
-        <jtreg-tool name="javap" tests="${javap.tests}"/>
-    </target>
-
-    <target name="findbugs-javap" depends="build-javap,-def-findbugs">
-        <findbugs-tool name="javap"/>
-    </target>
-
-    <target name="javap" depends="build-javap,jtreg-javap,findbugs-javap"/>
-
-    <!--
-    **** sjavac targets.
-    -->
-
-    <target name="build-bootstrap-sjavac"
-            depends="-def-build-bootstrap-classes,-def-build-bootstrap-jar,-def-build-bootstrap-tool">
-        <build-bootstrap-classes includes="${sjavac.includes}"/>
-        <build-bootstrap-jar     name="sjavac" includes="${sjavac.includes}"
-                                 jarmainclass="com.sun.tools.sjavac.Main"/>
-        <build-bootstrap-tool    name="sjavac"/>
-    </target>
-
-    <target name="build-classes-sjavac" depends="build-classes-javac">
-        <build-classes includes="${sjavac.includes}"/>
-    </target>
-
-    <target name="build-sjavac" depends="build-classes-sjavac">
-        <build-jar  name="sjavac" includes="${sjavac.includes}"
-                    jarmainclass="com.sun.tools.sjavac.Main"
-                    jarclasspath="sjavac.jar"/>
-        <build-tool name="sjavac"/>
-    </target>
-
-    <!-- (no javadoc for javap) -->
-
-    <target name="jtreg-sjavac" depends="build-sjavac,-def-jtreg">
-        <jtreg-tool name="sjavac" tests="${sjavac.tests}"/>
-    </target>
-
-    <target name="findbugs-sjavac" depends="build-sjavac,-def-findbugs">
-        <findbugs-tool name="sjavac"/>
-    </target>
-
-    <target name="sjavac" depends="build-sjavac,jtreg-sjavac,findbugs-sjavac"/>
-
-    <!--
-    **** crules targets.
-    -->
-
-    <target name="build-crules"
-            depends="-def-compilecrules,-def-build-jar-with-services,build-bootstrap-javac,-create-import-jdk-stubs">
-        <compilecrules/>
-        <build-jar-with-services
-                    name="crules"
-                    includes="crules/* crules/resources/*"
-                    classes.dir="${build.toolclasses.dir}"
-                    lib.dir="${build.toolclasses.dir}"
-                    jarmainclass=""
-                    jarclasspath="crules.jar"
-                    service.type="com.sun.source.util.Plugin"
-                    service.provider="crules.CodingRulesAnalyzerPlugin"/>
-        <build-tool name="crules"/>
-    </target>
-
-    <target name="jtreg-crules" depends="build-javac,build-crules,-def-jtreg">
+    <target name="jtreg-crules" depends="build-all-classes,-def-jtreg">
+        <mkdir dir="${build.crules.dir}/classes"/>
+        <javac fork="true"
+               source="${boot.javac.source}"
+               target="${boot.javac.target}"
+               executable="${boot.java.home}/bin/javac"
+               srcdir="${make.tools.dir}"
+               includes="crules/*"
+               destdir="${build.crules.dir}/classes"
+               includeantruntime="false">
+            <compilerarg value="-Xbootclasspath/p:${langtools.classes}"/>
+            <compilerarg line="${javac.lint.opts}"/>
+        </javac>
+        <copy todir="${build.crules.dir}/classes" includeemptydirs="false">
+            <fileset dir="${make.tools.dir}">
+                <include name="**/*.properties"/>
+            </fileset>
+        </copy>
+        <echo file="${build.crules.dir}/classes/META-INF/services/com.sun.source.util.Plugin">crules.CodingRulesAnalyzerPlugin</echo>
         <jtreg-tool name="crules"
                     tests="${crules.tests}"
-                    extra.jvmargs="-Xbootclasspath/a:${build.toolclasses.dir}/crules.jar" />
-    </target>
-
-    <target name="check-coding-rules" depends="build-bootstrap-javac,-create-import-jdk-stubs,build-crules">
-        <build-classes includes="${javac.includes}"
-            plugin.options="-J-Xbootclasspath/a:${build.toolclasses.dir}/crules.jar -Xplugin:coding_rules" />
-    </target>
-
-    <!--
-    **** Create import JDK stubs.
-    -->
-
-    <target name="-create-import-jdk-stubs" depends="-def-genstubs" if="require.import.jdk.stubs">
-        <mkdir dir="${build.genstubs.dir}"/>
-        <genstubs
-            srcdir="${import.jdk.src.dir}" destdir="${build.genstubs.dir}"
-            includes="${import.jdk.stub.files}"
-            fork="true" classpath="${build.toolclasses.dir}:${build.bootstrap.dir}/classes:${ant.core.lib}"
-        />
+                    extra.jvmargs="-Xbootclasspath/a:${build.crules.dir}/classes" />
     </target>
 
     <!--
@@ -821,8 +441,8 @@
         <check name="target java" property="target.java.home" marker="${java.marker}"/>
     </target>
 
-    <target name="-check-cobertura.home" depends="-def-check">
-        <check name="cobertura" property="cobertura.home" marker="cobertura.jar"/>
+    <target name="-check-jtreg.home" depends="-def-check">
+        <check name="jtreg" property="jtreg.home" marker="lib/jtreg.jar"/>
     </target>
 
     <target name="-check-findbugs.home" depends="-def-check">
@@ -830,27 +450,57 @@
     </target>
 
     <target name="-check-checkstyle.home" depends="-def-check">
-        <check name="checkstyle" property="checkstyle.home" marker="${checkstyle.name.version}.jar"/>
+        <check name="checkstyle" property="checkstyle.home" marker=""/> <!--TODO: better checkstyle verification-->
     </target>
 
-    <target name="-check-jtreg.home" depends="-def-check">
-        <check name="jtreg" property="jtreg.home" marker="lib/jtreg.jar"/>
+    <!-- Definitions -->
+
+    <target name="-def-build-all-module-jars" depends="-def-build-module-jar">
+        <macrodef name="build-all-module-jars">
+            <attribute name="compilation.kind" default=""/>
+            <sequential>
+                <build-module-jar module.name="java.base" compilation.kind="@{compilation.kind}" />
+                <build-module-jar module.name="java.compiler" compilation.kind="@{compilation.kind}" />
+                <build-module-jar module.name="jdk.compiler" compilation.kind="@{compilation.kind}" />
+                <build-module-jar module.name="jdk.javadoc" compilation.kind="@{compilation.kind}" />
+                <build-module-jar module.name="jdk.dev" compilation.kind="@{compilation.kind}" />
+            </sequential>
+        </macrodef>
     </target>
 
-    <target name="-check-vizant" depends="-def-check">
-        <check name="vizant" property="vizant.jar"/>
-        <check name="dot" property="dot"/>
+    <target name="-def-build-module-jar">
+        <macrodef name="build-module-jar">
+            <attribute name="module.name"/>
+            <attribute name="compilation.kind"/>
+            <attribute name="dependencies" default="${@{compilation.kind}@{module.name}.dependencies}"/>
+            <attribute name="build.dir" default="${@{compilation.kind}build.dir}"/>
+            <attribute name="lib.dir" default="${@{compilation.kind}dist.lib.dir}"/>
+            <attribute name="classes.dir" default="@{build.dir}/@{module.name}/classes"/>
+            <sequential>
+                <mkdir dir="@{lib.dir}"/>
+                <local name="jarclasspath" />
+                <pathconvert property="jarclasspath">
+                    <path>
+                        <pathelement path="@{dependencies}" />
+                    </path>
+                    <map from="${basedir}/" to="" />
+                    <mapper type="glob" from="*" to="*.jar"/>
+                </pathconvert>
+                <jar destfile="@{lib.dir}/@{module.name}.jar"
+                     basedir="@{classes.dir}">
+                    <manifest>
+                        <attribute name="Class-Path" value="@{jarclasspath}"/>
+                    </manifest>
+                </jar>
+            </sequential>
+        </macrodef>
     </target>
 
-
-    <!--
-    **** Targets for Ant macro and task definitions.
-    -->
-
     <target name="-def-build-tool">
         <macrodef name="build-tool">
             <attribute name="name"/>
-            <attribute name="bin.dir" default="${dist.bin.dir}"/>
+            <attribute name="compilation.kind" default=""/>
+            <attribute name="bin.dir" default="${@{compilation.kind}dist.bin.dir}"/>
             <attribute name="java" default="${launcher.java}"/>
             <sequential>
                 <mkdir dir="@{bin.dir}"/>
@@ -866,84 +516,73 @@
         </macrodef>
     </target>
 
-    <target name="-def-build-jar">
-        <macrodef name="build-jar">
-            <attribute name="name"/>
-            <attribute name="includes"/>
-            <attribute name="classes.dir" default="${build.classes.dir}"/>
-            <attribute name="lib.dir" default="${dist.lib.dir}"/>
-            <attribute name="jarmainclass" default="com.sun.tools.@{name}.Main"/>
-            <attribute name="jarclasspath" default=""/>
+    <target name="-def-build-all-module-classes" depends="-def-build-module-classes">
+        <macrodef name="build-all-module-classes">
+            <attribute name="compilation.kind" default=""/>
             <sequential>
-                <mkdir dir="@{lib.dir}"/>
-                <jar destfile="@{lib.dir}/@{name}.jar"
-                     basedir="@{classes.dir}"
-                     includes="@{includes}">
-                    <manifest>
-                        <attribute name="Main-Class" value="@{jarmainclass}"/>
-                        <attribute name="Class-Path" value="@{jarclasspath}"/>
-                    </manifest>
-                </jar>
+                <build-module-classes module.name="java.base"
+                                      compilation.kind="@{compilation.kind}" />
+                <build-module-classes module.name="java.compiler"
+                                      compilation.kind="@{compilation.kind}" />
+                <build-module-classes module.name="jdk.compiler"
+                                      compilation.kind="@{compilation.kind}" />
+                <build-module-classes module.name="jdk.javadoc"
+                                      compilation.kind="@{compilation.kind}" />
+                <build-module-classes module.name="jdk.dev"
+                                      compilation.kind="@{compilation.kind}" />
             </sequential>
         </macrodef>
     </target>
 
-    <target name="-def-build-jar-with-services">
-        <macrodef name="build-jar-with-services">
-            <attribute name="name"/>
-            <attribute name="includes"/>
-            <attribute name="classes.dir" default="${build.classes.dir}"/>
-            <attribute name="lib.dir" default="${dist.lib.dir}"/>
-            <attribute name="jarmainclass" default="com.sun.tools.@{name}.Main"/>
-            <attribute name="jarclasspath" default=""/>
-            <attribute name="service.type" default=""/>
-            <attribute name="service.provider" default=""/>
-            <sequential>
-                <mkdir dir="${build.toolclasses.dir}"/>
-                <jar destfile="@{lib.dir}/@{name}.jar"
-                     basedir="@{classes.dir}"
-                     includes="@{includes}">
-                    <service type="@{service.type}" provider="@{service.provider}"/>
-                    <manifest>
-                        <attribute name="Main-Class" value="@{jarmainclass}"/>
-                        <attribute name="Class-Path" value="@{jarclasspath}"/>
-                    </manifest>
-                </jar>
-            </sequential>
-        </macrodef>
-    </target>
-
-    <target name="-def-build-classes" depends="-def-pcompile">
-        <macrodef name="build-classes">
-            <attribute name="includes"/>
+    <target name="-def-build-module-classes" depends="-def-pcompile">
+        <macrodef name="build-module-classes">
+            <attribute name="module.name"/>
+            <attribute name="compilation.kind" default=""/>
+            <attribute name="dependencies" default="${@{module.name}.dependencies}"/>
+            <attribute name="includes" default="${@{compilation.kind}javac.includes}"/>
+            <attribute name="javac.lint.opts" default="${@{compilation.kind}javac.lint.opts}"/>
+            <attribute name="javac.extra.opts" default="${@{compilation.kind}javac.extra.opts}"/>
+            <attribute name="build.dir" default="${@{compilation.kind}build.dir}"/>
             <attribute name="excludes" default="${exclude.files} **/package-info.java"/>
-            <attribute name="classes.dir" default="${build.classes.dir}"/>
-            <attribute name="gensrc.dir" default="${build.gensrc.dir}"/>
-            <attribute name="javac.bootclasspath" default="${build.bootstrap.dir}/classes"/>
-            <attribute name="bootclasspath.opt" default="${javac.bootclasspath.opt}"/>
-            <attribute name="classpath" default="${javac.classpath}"/>
-            <attribute name="sourcepath" default="${javac.sourcepath}"/>
+            <attribute name="classes.dir" default="@{build.dir}/@{module.name}/classes"/>
+            <attribute name="gensrc.dir" default="@{build.dir}/@{module.name}/gensrc"/>
+            <attribute name="depcache.dir" default="@{build.dir}/@{module.name}/depcache"/>
             <attribute name="java.home" default="${boot.java.home}"/>
-            <attribute name="source" default="${javac.source}"/>
-            <attribute name="target" default="${javac.target}"/>
+            <attribute name="source" default="${@{compilation.kind}javac.source}"/>
+            <attribute name="target" default="${@{compilation.kind}javac.target}"/>
             <attribute name="release" default="${release}"/>
             <attribute name="full.version" default="${full.version}"/>
             <attribute name="plugin.options" default=""/>
             <sequential>
                 <echo level="verbose" message="build-classes: excludes=@{excludes}"/>
-                <echo level="verbose" message="build-classes: bootclasspath.opt=@{bootclasspath.opt}"/>
                 <echo level="verbose" message="build-classes: classpath=@{classpath}"/>
                 <echo level="verbose" message="build-classes: sourcepath=@{sourcepath}"/>
+                <echo level="verbose" message="build-classes: dependencies=@{dependencies}"/>
+                <local name="src.dir" />
+                <property name="src.dir" location="${basedir}/src/@{module.name}/share/classes"/>
+                <local name="classpath" />
+                <pathconvert property="classpath">
+                    <path>
+                        <pathelement path="@{dependencies}" />
+                    </path>
+                    <map from="${basedir}/" to="@{build.dir}/" />
+                    <mapper type="glob" from="*" to="*/classes"/>
+                </pathconvert>
+                <local name="bootclasspath.prepend"/>
+                <condition property="bootclasspath.prepend" value="" else="${langtools.boot.classes}">
+                    <equals arg1="@{compilation.kind}" arg2="boot."/>
+                </condition>
+                <mkdir dir="@{classes.dir}"/>
                 <mkdir dir="@{gensrc.dir}"/>
-                <mkdir dir="@{classes.dir}"/>
+                <mkdir dir="@{depcache.dir}"/>
                 <pcompile destdir="@{gensrc.dir}"
                           includes="@{includes}">
                     <src>
-                        <path refid="src.dirs"/>
+                        <path location="${src.dir}"/>
                     </src>
                 </pcompile>
                 <copy todir="@{gensrc.dir}">
-                    <multirootfileset basedirs="${src.dirs.property}" includes="@{includes}" />
+                    <fileset dir="${src.dir}" includes="@{includes}" />
                     <globmapper from="*.properties-template" to="*.properties"/>
                     <filterset begintoken="$(" endtoken=")">
                         <filter token="JDK_VERSION" value="${jdk.version}"/>
@@ -957,13 +596,20 @@
                         <pathelement location="@{gensrc.dir}"/>
                     </src>
                 </pcompile>
+                <antcall target="-do-depend">
+                    <param name="src.dir" value="${src.dir}" />
+                    <param name="classes.dir" value="@{classes.dir}" />
+                    <param name="gensrc.dir" value="@{gensrc.dir}" />
+                    <param name="depcache.dir" value="@{depcache.dir}" />
+                    <param name="classpath" value="${classpath}" />
+                </antcall>
                 <javac fork="true"
                        executable="@{java.home}/bin/javac"
                        destdir="@{classes.dir}"
                        includes="@{includes}"
                        excludes="@{excludes}"
-                       sourcepath="@{sourcepath}"
-                       classpath="@{classpath}"
+                       sourcepath="${src.dir}:@{gensrc.dir}"
+                       classpath="${classpath}"
                        includeAntRuntime="no"
                        source="@{source}"
                        target="@{target}"
@@ -971,19 +617,18 @@
                        debuglevel="${javac.debuglevel}">
                     <compilerarg value="-implicit:none"/>
                     <compilerarg value="-Xprefer:source"/>
-                    <compilerarg value="-J-Xbootclasspath/p:@{javac.bootclasspath}"/>
-                    <compilerarg line="@{bootclasspath.opt}"/>
-                    <compilerarg line="${javac.no.jdk.warnings}"/>
-                    <compilerarg line="${javac.version.opt}"/>
-                    <compilerarg line="${javac.lint.opts}"/>
+                    <compilerarg value="-J-Xbootclasspath/p:${bootclasspath.prepend}"/>
+                    <compilerarg value="-Xbootclasspath/p:${classpath}"/>
+                    <compilerarg line="@{javac.extra.opts}"/>
+                    <compilerarg line="@{javac.lint.opts}"/>
                     <compilerarg line="@{plugin.options}"/>
                     <src>
-                        <path refid="src.dirs"/>
+                        <path location="${src.dir}"/>
                         <path location="@{gensrc.dir}"/>
                     </src>
                 </javac>
                 <copy todir="@{classes.dir}" includeemptydirs="false">
-                    <multirootfileset basedirs="${src.dirs.property}" includes="@{includes}" excludes="@{excludes}">
+                    <fileset dir="${src.dir}" includes="@{includes}" excludes="@{excludes}">
                         <exclude name="**/*.java"/>
                         <exclude name="**/*.properties"/>
                         <exclude name="**/*-template"/>
@@ -991,42 +636,15 @@
                         <exclude name="**/*.orig"/>
                         <exclude name="**/overview.html"/>
                         <exclude name="**/package.html"/>
-                    </multirootfileset>
+                    </fileset>
                 </copy>
             </sequential>
         </macrodef>
     </target>
 
-    <target name="-def-build-bootstrap-tool" depends="-check-boot.java.home,-def-build-tool">
-        <presetdef name="build-bootstrap-tool">
-            <build-tool
-                bin.dir="${build.bootstrap.dir}/bin"
-                java="${boot.java}"/>
-        </presetdef>
-    </target>
-
-    <target name="-def-build-bootstrap-jar" depends="-def-build-jar">
-        <presetdef name="build-bootstrap-jar">
-            <build-jar
-                classes.dir="${build.bootstrap.dir}/classes"
-                lib.dir="${build.bootstrap.dir}/lib"/>
-        </presetdef>
-    </target>
-
-    <target name="-def-build-bootstrap-classes" depends="-def-build-classes">
-        <presetdef name="build-bootstrap-classes">
-            <build-classes
-                source="${boot.javac.source}"
-                target="${boot.javac.target}"
-                gensrc.dir="${build.bootstrap.dir}/gensrc"
-                classes.dir="${build.bootstrap.dir}/classes"
-                javac.bootclasspath=""
-                bootclasspath.opt="-Xbootclasspath/p:${build.bootstrap.dir}/classes"
-                sourcepath=""
-                release="${bootstrap.release}"
-                full.version="${bootstrap.full.version}"
-                excludes="${bootstrap.exclude.files} **/package-info.java"/>
-        </presetdef>
+    <target name="-do-depend" if="do.depend">
+        <depend srcdir="${src.dir}:${gensrc.dir}" destdir="${classes.dir}" classpath="${classpath}"
+                cache="${depcache.dir}"/>
     </target>
 
     <target name="-def-pcompile">
@@ -1048,55 +666,9 @@
                  classpath="${build.toolclasses.dir}/"/>
     </target>
 
-    <target name="-def-compilecrules">
-        <macrodef name="compilecrules">
-            <sequential>
-                <mkdir dir="${build.toolclasses.dir}"/>
-                <javac fork="true"
-                       source="${boot.javac.source}"
-                       target="${boot.javac.target}"
-                       executable="${boot.java.home}/bin/javac"
-                       srcdir="${make.tools.dir}"
-                       includes="crules/*"
-                       destdir="${build.toolclasses.dir}/"
-                       classpath="${ant.core.lib}"
-                       bootclasspath="${boot.java.home}/jre/lib/rt.jar"
-                       includeantruntime="false">
-                    <compilerarg value="-Xbootclasspath/p:${build.bootstrap.dir}/classes"/>
-                    <compilerarg line="${javac.lint.opts}"/>
-                </javac>
-                <copy todir="${build.toolclasses.dir}/" includeemptydirs="false">
-                    <fileset dir="${make.tools.dir}">
-                        <include name="**/*.properties"/>
-                    </fileset>
-                </copy>
-            </sequential>
-        </macrodef>
-    </target>
-
-    <target name="-def-genstubs" depends="build-bootstrap-javac" if="require.import.jdk.stubs">
-        <mkdir dir="${build.toolclasses.dir}"/>
-        <javac fork="true"
-               source="${boot.javac.source}"
-               target="${boot.javac.target}"
-               executable="${boot.java.home}/bin/javac"
-               srcdir="${make.tools.dir}"
-               includes="genstubs/* anttasks/GenStubs*"
-               destdir="${build.toolclasses.dir}/"
-               classpath="${ant.core.lib}"
-               includeantruntime="false">
-            <compilerarg value="-Xbootclasspath/p:${build.bootstrap.dir}/classes"/>
-            <compilerarg line="${javac.lint.opts}"/>
-        </javac>
-        <taskdef name="genstubs"
-                 classname="anttasks.GenStubsTask"
-                 classpath="${build.toolclasses.dir}/"/>
-    </target>
-
     <target name="-def-javadoc-tool" depends="-check-target.java.home">
         <macrodef name="javadoc-tool">
-            <attribute name="name"/>
-            <attribute name="includes"/>
+            <attribute name="includes" default="${javac.includes}"/>
             <attribute name="options" default=""/>
             <attribute name="source" default="${javac.source}"/>
             <sequential>
@@ -1106,7 +678,7 @@
                 <property name="javadoc.packagenames" value="none"/> <!-- default, can be overridden per user or per project -->
                 <javadoc
                     executable="${target.java.home}/bin/javadoc"
-                    destdir="${build.javadoc.dir}/@{name}"
+                    destdir="${build.javadoc.dir}"
                     source="@{source}"
                     windowtitle="UNOFFICIAL"
                     failonerror="true"
@@ -1116,57 +688,30 @@
                     packagenames="${javadoc.packagenames}" >
                     <header><![CDATA[<strong>Unofficial Javadoc</strong> generated from developer sources for preview purposes only]]></header>
                     <arg line="@{options}"/>
-                    <arg value="-tag" />
-                    <arg value="implNote:a:Implementation Note:"/>
                     <bootclasspath>
-                        <path location="${build.classes.dir}"/>
+                        <pathelement path="${langtools.classes}"/>
                         <path location="${target.java.home}/jre/lib/rt.jar"/>
                     </bootclasspath>
                     <sourcepath>
-                        <path refid="src.dirs"/>
+                        <pathelement path="${langtools.sources}"/>
                     </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.) -->
-                    <packageset dir="${src.dir}/java.base/share/classes" includes="@{includes}">
+                    <packageset dir="${basedir}/src/java.compiler/share/classes" includes="@{includes}">
                         <or>
-                            <filename name="java/"/>
                             <filename name="javax/"/>
-                            <filename name="com/sun/javadoc/"/>
-                            <filename name="com/sun/source/"/>
                         </or>
                     </packageset>
-                    <packageset dir="${src.dir}/java.compiler/share/classes" includes="@{includes}">
+                    <packageset dir="${basedir}/src/jdk.compiler/share/classes" includes="@{includes}">
                         <or>
-                            <filename name="java/"/>
-                            <filename name="javax/"/>
-                            <filename name="com/sun/javadoc/"/>
                             <filename name="com/sun/source/"/>
                         </or>
                     </packageset>
-                    <packageset dir="${src.dir}/jdk.compiler/share/classes" includes="@{includes}">
-                        <or>
-                            <filename name="java/"/>
-                            <filename name="javax/"/>
-                            <filename name="com/sun/javadoc/"/>
-                            <filename name="com/sun/source/"/>
-                        </or>
-                    </packageset>
-                    <packageset dir="${src.dir}/jdk.dev/share/classes" includes="@{includes}">
+                    <packageset dir="${basedir}/src/jdk.javadoc/share/classes" includes="@{includes}">
                         <or>
-                            <filename name="java/"/>
-                            <filename name="javax/"/>
                             <filename name="com/sun/javadoc/"/>
-                            <filename name="com/sun/source/"/>
-                        </or>
-                    </packageset>
-                    <packageset dir="${src.dir}/jdk.javadoc/share/classes" includes="@{includes}">
-                        <or>
-                            <filename name="java/"/>
-                            <filename name="javax/"/>
-                            <filename name="com/sun/javadoc/"/>
-                            <filename name="com/sun/source/"/>
                         </or>
                     </packageset>
                 </javadoc>
@@ -1184,6 +729,7 @@
         <macrodef name="jtreg-tool">
             <attribute name="name"/>
             <attribute name="tests"/>
+            <attribute name="langtools.classes" default="${langtools.classes}"/>
             <attribute name="jdk" default="${target.java.home}"/>
             <attribute name="samevm" default="true"/>
             <attribute name="verbose" default="${default.jtreg.verbose}"/>
@@ -1191,6 +737,7 @@
             <attribute name="keywords" default="-keywords:!ignore"/>
             <attribute name="jpda.jvmargs" default=""/>
             <attribute name="extra.jvmargs" default=""/>
+            <attribute name="build.dir" default="${build.dir}"/>
             <sequential>
                 <property name="coverage.options" value=""/>              <!-- default -->
                 <property name="coverage.classpath" value=""/>            <!-- default -->
@@ -1204,7 +751,7 @@
                     samevm="@{samevm}" verbose="@{verbose}"
                     failonerror="false" resultproperty="jtreg.@{name}.result"
                     javacoptions="-g"
-                    vmoptions="${coverage.options} -Xbootclasspath/p:${coverage.classpath}${path.separator}${build.classes.dir} @{jpda.jvmargs} @{extra.jvmargs}">
+                    vmoptions="${coverage.options} -Xbootclasspath/p:${coverage.classpath}${path.separator}@{langtools.classes} @{jpda.jvmargs} @{extra.jvmargs}">
                     <arg line="@{keywords}"/>
                     <arg line="@{options}"/>
                     <arg line="@{tests}"/>
@@ -1220,21 +767,12 @@
         <property name="jtreg.defined" value="true"/>
     </target>
 
-    <target name="-def-cobertura" depends="-check-cobertura.home">
-        <path id="cobertura.classpath">
-            <fileset dir="${cobertura.home}">
-                <include name="cobertura.jar"/>
-                <include name="lib/**/*.jar"/>
-            </fileset>
-        </path>
-        <taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>
-    </target>
-
-    <target name="-def-checkstyle" unless="checkstyle.defined"
-        depends="-check-checkstyle.home">
+    <target name="-def-checkstyle" unless="checkstyle.defined" depends="-check-checkstyle.home">
         <taskdef resource="checkstyletask.properties">
             <classpath>
-                <pathelement location="${checkstyle.home}/${checkstyle.name.version}-all.jar"/>
+              <fileset dir="${checkstyle.home}">
+                <include name="checkstyle-*-all.jar"/>
+              </fileset>
             </classpath>
         </taskdef>
         <property name="checkstyle.defined" value="true"/>
@@ -1265,7 +803,7 @@
                     jvmargs="-Xmx512M" >
                     <class location="${dist.dir}/lib/@{name}.jar"/>
                     <auxClasspath>
-                        <pathelement location="${build.classes.dir}"/>
+                        <pathelement location="${langtools.classes}"/>
                     </auxClasspath>
                     <sourcePath>
                         <path refid="src.dirs"/>
@@ -1276,11 +814,6 @@
         <property name="findbugs.defined" value="true"/>
     </target>
 
-    <target name="-def-vizant" unless="vizant.defined" depends="-check-vizant">
-        <taskdef name="vizant" classname="net.sourceforge.vizant.Vizant" classpath="${vizant.jar}"/>
-        <property name="vizant.defined" value="true"/>
-    </target>
-
     <target name="-def-check">
         <macrodef name="check">
             <attribute name="name"/>
--- a/langtools/make/launcher.sh-template	Fri Nov 07 07:54:35 2014 -0500
+++ b/langtools/make/launcher.sh-template	Fri Nov 07 18:22:36 2014 +0100
@@ -43,10 +43,9 @@
 # dependent jar files for additional dependencies.
 
 if [ "$LANGTOOLS_USE_BOOTCLASSPATH" != "no" ]; then
-   cp=`unzip -c "$mylib/#PROGRAM#.jar" META-INF/MANIFEST.MF |
-       grep "Class-Path:" |
-       sed -e 's|Class-Path: *||' -e 's|\([a-z]*\.jar\) *|'"$mylib"'/\1#PS#|g'`
-   bcp="$mylib/#PROGRAM#.jar#PS#$cp"
+   cp=`echo "$mylib"/*.jar |
+       sed -e 's|\([a-z.]*\.jar\) *|\1#PS#|g'`
+   bcp=$cp
 fi
 
 # tools currently assumes that assertions are enabled in the launcher
@@ -72,4 +71,4 @@
 unset DUALCASE
 
 IFS=$nl
-"#TARGET_JAVA#" "${bcp:+-Xbootclasspath/p:"$bcp"}" ${ea} ${javaOpts} -jar "${mylib}/#PROGRAM#.jar" ${toolOpts}
+"#TARGET_JAVA#" "${bcp:+-Xbootclasspath/p:"$bcp"}" ${ea} ${javaOpts} com.sun.tools.#PROGRAM#.Main ${toolOpts}
--- a/langtools/make/netbeans/langtools/build.xml	Fri Nov 07 07:54:35 2014 -0500
+++ b/langtools/make/netbeans/langtools/build.xml	Fri Nov 07 18:22:36 2014 +0100
@@ -46,48 +46,34 @@
      -->
     <import file="../../build.xml"/>
 
-    <!-- Build project. (action: build; F11)
-        If langtools.tool.name is set, then just build that tool; otherwise
-        build all tools.
-    -->
-
-    <target name="build" depends="-get-tool-if-set,-build-tool,-build-all"
-        description="Build one or all langtools tools"
-        />
+    <!-- Build project. (action: build; F11) -->
 
-    <condition property="use_bootstrap" value="bootstrap-" else="">
-        <isset property="langtools.tool.bootstrap"/>
-    </condition>
-    <condition property="with_bootclasspath" value="${build.bootstrap.dir}/classes" else="${build.classes.dir}">
-        <isset property="langtools.tool.bootstrap"/>
-    </condition>
-
-    <target name="-build-tool" if="langtools.tool.name">
-        <echo level="info" message="Building ${use_bootstrap}${langtools.tool.name}"/>
-        <echo level="verbose" message="(Unset langtools.tool.name to build all tools)"/>
-        <antcall target="build-${use_bootstrap}${langtools.tool.name}"/>
+    <target name="build" depends="-get-tool-if-set,-build-bootstrap-javac,-build-all" />
+    <target name="-build-bootstrap-javac" if="langtools.tool.bootstrap">
+        <antcall target="build-bootstrap-javac"/>
     </target>
-
-    <target name="-build-all" unless="langtools.tool.name">
-        <echo level="info" message="Building all tools"/>
-        <echo level="verbose" message="(Set langtools.tool.name to build a single tool)"/>
+    <target name="-build-all" unless="langtools.tool.bootstrap">
         <antcall target="build-all-tools"/>
     </target>
 
     <!-- Compile a single file. (action: compile.single; F9) -->
 
-    <target name="compile-single" depends="build-bootstrap-javac">
+    <target name="compile-single" depends="-get-tool-if-set,build-bootstrap-javac-classes" unless="langtools.tool.bootstrap">
         <fail unless="includes">Must set property 'includes'</fail>
-        <javac fork="true" executable="${build.bootstrap.dir}/bin/javac"
-               srcdir="${srcdir}"
-               destdir="${build.classes.dir}"
+        <mkdir dir="${build.dir}/${module.name}/classes" />
+        <javac fork="true" executable="${boot.java.home}/bin/javac"
+               srcdir="${basedir}/src/${module.name}/share/classes"
+               destdir="${build.dir}/${module.name}/classes"
                includes="${includes}"
                sourcepath=""
+               classpath="${langtools.classes}"
                includeAntRuntime="no"
                source="${javac.source}"
                target="${javac.target}"
                debug="${javac.debug}"
-               debuglevel="${javac.debuglevel}"/>
+               debuglevel="${javac.debuglevel}">
+            <compilerarg value="-J-Xbootclasspath/p:${build.bootstrap.dir}/classes"/>
+        </javac>
     </target>
 
     <!-- Run tool. (action: run; F6)
@@ -95,16 +81,24 @@
         the user.
     -->
 
-    <target name="run" depends="-check-target.java.home,build,-def-run,-get-tool-and-args"
+    <target name="run" depends="-check-target.java.home,-build-classes,-def-run,-get-tool-and-args,-setup-bootclasspath"
             description="run tool">
         <echo level="info" message="${with_bootclasspath}"/>
         <echo level="info" message="Run ${use_bootstrap}${langtools.tool.name} with args ${langtools.tool.args}"/>
         <run bcp="${with_bootclasspath}" mainclass="com.sun.tools.${langtools.tool.name}.Main" args="${langtools.tool.args}"/>
     </target>
 
+    <target name="-build-classes" depends="-get-tool-if-set,-build-classes-bootstrap-javac,-build-classes-all" />
+    <target name="-build-classes-bootstrap-javac" if="langtools.tool.bootstrap">
+        <antcall target="build-bootstrap-javac-classes"/>
+    </target>
+    <target name="-build-classes-all" unless="langtools.tool.bootstrap">
+        <antcall target="build-all-classes"/>
+    </target>
+
     <!-- Run a selected class. (action: run.single;  shift-F6) -->
 
-    <target name="run-single" depends="-check-target.java.home,-def-run">
+    <target name="run-single" depends="-check-target.java.home,-setup-bootclasspath,-def-run">
         <fail unless="run.classname">Must set property 'run.classname' </fail>
         <echo level="info" message="run ${run.classname}"/>
         <run mainclass="${run.classname}" args=""/>
@@ -115,22 +109,22 @@
         test all tools.
     -->
 
-    <target name="jtreg" depends="-get-tool-if-set,-jtreg-tool,-jtreg-all"
-        description="Test one or all langtools tools"
+    <target name="jtreg" depends="-get-tool-if-set,-jtreg-bootstrap-javac,-jtreg-all"
+        description="Test langtools tools or bootstrap javac"
         />
 
-    <target name="-jtreg-tool" if="langtools.tool.name">
-        <echo level="info" message="Testing ${langtools.tool.name}"/>
-        <echo level="verbose" message="(Unset langtools.tool.name to test all tools)"/>
+    <target name="-jtreg-bootstrap-javac" if="langtools.tool.bootstrap">
+        <echo level="info" message="Testing bootstrap javac"/>
+        <echo level="verbose" message="(Unset langtools.tool.bootstrap to test all tools)"/>
         <antcall>
-            <target name="jtreg-${langtools.tool.name}"/>
+            <target name="jtreg-bootstrap-javac"/>
             <target name="-show-jtreg"/>
         </antcall>
     </target>
 
-    <target name="-jtreg-all" unless="langtools.tool.name">
+    <target name="-jtreg-all" unless="langtools.tool.bootstrap">
         <echo level="info" message="Testing all tools"/>
-        <echo level="verbose" message="(Set langtools.tool.name to test a single tool)"/>
+        <echo level="verbose" message="(Set langtools.tool.bootstrap to test bootstrap javac)"/>
         <antcall>
             <target name="langtools.jtreg"/>
             <target name="-show-jtreg"/>
@@ -165,7 +159,7 @@
 
     <!-- Debug tool in NetBeans. -->
 
-    <target name="debug" depends="-check-target.java.home,-def-run,-def-start-debugger,-get-tool-and-args,build" if="netbeans.home">
+    <target name="debug" depends="-check-target.java.home,-def-run,-def-start-debugger,-get-tool-and-args,-setup-bootclasspath,-build-classes" if="netbeans.home">
         <echo level="info" message="Debug ${use_bootstrap}${langtools.tool.name} with args ${langtools.tool.args}"/>
         <start-debugger/>
         <run bcp="${with_bootclasspath}" mainclass="com.sun.tools.${langtools.tool.name}.Main" args="${langtools.tool.args}" jpda.jvmargs="${jpda.jvmargs}"/>
@@ -179,20 +173,29 @@
     </target>
 
     <!-- Debug a jtreg test. -->
-    <target name="debug-jtreg" depends="-check-target.java.home,-def-start-debugger,-def-jtreg">
+    <target name="debug-jtreg" depends="-check-target.java.home,-def-start-debugger,-def-jtreg,-get-tool-if-set,-setup-bootclasspath">
         <fail unless="jtreg.tests">Must set property 'jtreg.tests'</fail>
         <start-debugger/>
-        <jtreg-tool name="debug" samevm="false" tests="${jtreg.tests}" jpda.jvmargs="${jpda.jvmargs}"/>
+        <jtreg-tool name="debug"
+                    samevm="false"
+                    tests="${jtreg.tests}"
+                    jpda.jvmargs="${jpda.jvmargs}"
+                    langtools.classes="${with_bootclasspath}"/>
     </target>
 
     <!-- Update a class being debugged. -->
 
-    <target name="debug-fix">
+    <target name="debug-fix" depends="-get-tool-if-set">
         <fail unless="class">Must set property 'class'
         </fail>
         <antcall target="compile-single">
             <param name="includes" value="${class}.java"/>
         </antcall>
+        <condition property="build.classes.dir"
+                   value="${build.dir}/${module.name}/classes"
+                   else="${boot.build.dir}/${module.name}/classes">
+            <isset property="use_bootstrap"/>
+        </condition>
         <nbjpdareload>
             <fileset dir="${build.classes.dir}">
                 <include name="${class}.class"/>
@@ -205,31 +208,10 @@
         test all tools.
     -->
 
-    <target name="javadoc" depends="-javadoc-tool,-javadoc-all"
-        description="Generate javadoc for one or all langtools tools"
-        />
-
-    <target name="-javadoc-tool" if="langtools.tool.name">
-        <echo level="info" message="Generate javadoc for ${langtools.tool.name}"/>
-        <echo level="verbose" message="(Unset langtools.tool.name to generate javadoc for all tools)"/>
-        <antcall>
-            <target name="javadoc-${langtools.tool.name}"/>
-            <target name="-show-javadoc"/>
-        </antcall>
-    </target>
-
-    <target name="-javadoc-all" unless="langtools.tool.name">
-        <echo level="info" message="Generate javadoc for all tools"/>
-        <echo level="verbose" message="(Set langtools.tool.name to generate javadoc for a single tool)"/>
-        <antcall>
-            <target name="langtools.javadoc"/>
-            <target name="-show-javadoc"/>
-        </antcall>
-    </target>
+    <target name="javadoc" depends="langtools.javadoc,-show-javadoc" />
 
     <target name="-show-javadoc" if="netbeans.home">
-        <!-- what if doing javadoc for all? -->
-        <nbbrowse file="${build.javadoc.dir}/${langtools.tool.name}/index.html"/>
+        <nbbrowse file="${build.javadoc.dir}/index.html"/>
     </target>
 
     <!-- Prompt for values. -->
@@ -253,6 +235,15 @@
             />
     </target>
 
+    <target name="-setup-bootclasspath">
+        <condition property="use_bootstrap" value="bootstrap-" else="">
+            <isset property="langtools.tool.bootstrap"/>
+        </condition>
+        <condition property="with_bootclasspath" value="${langtools.boot.classes}" else="${langtools.classes}">
+            <isset property="langtools.tool.bootstrap"/>
+        </condition>
+    </target>
+
     <!-- Macro to run a tool or selected class - used by run* and debug* tasks -->
     <target name="-def-run">
         <macrodef name="run">
@@ -262,7 +253,7 @@
             <attribute name="jpda.jvmargs" default=""/>
 
             <sequential>
-                <java fork="true" jvm="${target.java}" classname="@{mainclass}">
+                <java fork="true" jvm="${target.java.home}/bin/java" classname="@{mainclass}">
                     <jvmarg line="-Xbootclasspath/p:@{bcp}"/>
                     <jvmarg line="@{jpda.jvmargs}"/>
                     <arg line="@{args}"/>
@@ -278,11 +269,11 @@
             <sequential>
                 <nbjpdastart name="${ant.project.name}" addressproperty="jpda.address" transport="dt_socket">
                     <bootclasspath>
-                        <pathelement location="${build.classes.dir}"/>
+                        <pathelement path="${langtools.classes}"/>
                         <pathelement location="${target.java.home}/jre/lib/rt.jar"/>
                     </bootclasspath>
                     <sourcepath>
-                        <path refid="src.dirs"/>
+                        <pathelement path="${langtools.sources}"/>
                     </sourcepath>
                 </nbjpdastart>
                 <property
--- a/langtools/make/netbeans/langtools/nbproject/project.xml	Fri Nov 07 07:54:35 2014 -0500
+++ b/langtools/make/netbeans/langtools/nbproject/project.xml	Fri Nov 07 18:22:36 2014 +0100
@@ -107,7 +107,7 @@
                 </action>
                 <action name="compile.single">
                     <target>compile-single</target>
-                    <property name="srcdir">src/java.base/share/classes</property>
+                    <property name="module.name">java.base</property>
                     <context>
                         <property>includes</property>
                         <folder>${root}/src/java.base/share/classes</folder>
@@ -120,7 +120,7 @@
                 </action>
                 <action name="compile.single">
                     <target>compile-single</target>
-                    <property name="srcdir">src/java.compiler/share/classes</property>
+                    <property name="module.name">java.compiler</property>
                     <context>
                         <property>includes</property>
                         <folder>${root}/src/java.compiler/share/classes</folder>
@@ -133,7 +133,7 @@
                 </action>
                 <action name="compile.single">
                     <target>compile-single</target>
-                    <property name="srcdir">src/jdk.compiler/share/classes</property>
+                    <property name="module.name">jdk.compiler</property>
                     <context>
                         <property>includes</property>
                         <folder>${root}/src/jdk.compiler/share/classes</folder>
@@ -146,7 +146,7 @@
                 </action>
                 <action name="compile.single">
                     <target>compile-single</target>
-                    <property name="srcdir">src/jdk.dev/share/classes</property>
+                    <property name="module.name">jdk.dev</property>
                     <context>
                         <property>includes</property>
                         <folder>${root}/src/jdk.dev/share/classes</folder>
@@ -159,7 +159,7 @@
                 </action>
                 <action name="compile.single">
                     <target>compile-single</target>
-                    <property name="srcdir">src/jdk.javadoc/share/classes</property>
+                    <property name="module.name">jdk.javadoc</property>
                     <context>
                         <property>includes</property>
                         <folder>${root}/src/jdk.javadoc/share/classes</folder>
@@ -333,7 +333,7 @@
                 </action>
                 <action name="debug.fix">
                     <target>debug-fix</target>
-                    <property name="srcdir">src/java.base/share/classes</property>
+                    <property name="module.name">java.base</property>
                     <context>
                         <property>class</property>
                         <folder>${root}/src/java.base/share/classes</folder>
@@ -346,7 +346,7 @@
                 </action>
                 <action name="debug.fix">
                     <target>debug-fix</target>
-                    <property name="srcdir">src/java.compiler/share/classes</property>
+                    <property name="module.name">java.compiler</property>
                     <context>
                         <property>class</property>
                         <folder>${root}/src/java.compiler/share/classes</folder>
@@ -359,7 +359,7 @@
                 </action>
                 <action name="debug.fix">
                     <target>debug-fix</target>
-                    <property name="srcdir">src/jdk.compiler/share/classes</property>
+                    <property name="module.name">jdk.compiler</property>
                     <context>
                         <property>class</property>
                         <folder>${root}/src/jdk.compiler/share/classes</folder>
@@ -372,7 +372,7 @@
                 </action>
                 <action name="debug.fix">
                     <target>debug-fix</target>
-                    <property name="srcdir">src/jdk.dev/share/classes</property>
+                    <property name="module.name">jdk.dev</property>
                     <context>
                         <property>class</property>
                         <folder>${root}/src/jdk.dev/share/classes</folder>
@@ -385,7 +385,7 @@
                 </action>
                 <action name="debug.fix">
                     <target>debug-fix</target>
-                    <property name="srcdir">src/jdk.dev/share/classes</property>
+                    <property name="module.name">jdk.javadoc</property>
                     <context>
                         <property>class</property>
                         <folder>${root}/src/jdk.javadoc/share/classes</folder>
@@ -478,11 +478,31 @@
         <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/4">
             <compilation-unit>
                 <package-root>${root}/src/java.base/share/classes</package-root>
+                <built-to>${root}/build/java.base/classes</built-to>
+                <source-level>1.8</source-level>
+            </compilation-unit>
+            <compilation-unit>
                 <package-root>${root}/src/java.compiler/share/classes</package-root>
+                <classpath mode="compile">${root}/build/java.base/classes</classpath>
+                <built-to>${root}/build/java.compiler/classes</built-to>
+                <source-level>1.8</source-level>
+            </compilation-unit>
+            <compilation-unit>
                 <package-root>${root}/src/jdk.compiler/share/classes</package-root>
+                <classpath mode="compile">${root}/build/java.base/classes:${root}/build/java.compiler/classes</classpath>
+                <built-to>${root}/build/jdk.compiler/classes</built-to>
+                <source-level>1.8</source-level>
+            </compilation-unit>
+            <compilation-unit>
                 <package-root>${root}/src/jdk.dev/share/classes</package-root>
+                <classpath mode="compile">${root}/build/java.base/classes:${root}/build/java.compiler/classes:${root}/build/jdk.compiler/classes</classpath>
+                <built-to>${root}/build/jdk.dev/classes</built-to>
+                <source-level>1.8</source-level>
+            </compilation-unit>
+            <compilation-unit>
                 <package-root>${root}/src/jdk.javadoc/share/classes</package-root>
-                <built-to>${root}/build/classes</built-to>
+                <classpath mode="compile">${root}/build/java.base/classes:${root}/build/java.compiler/classes:${root}/build/jdk.compiler/classes</classpath>
+                <built-to>${root}/build/jdk.javadoc/classes</built-to>
                 <source-level>1.8</source-level>
             </compilation-unit>
         </java-data>
--- a/langtools/make/tools/anttasks/SelectToolTask.java	Fri Nov 07 07:54:35 2014 -0500
+++ b/langtools/make/tools/anttasks/SelectToolTask.java	Fri Nov 07 18:22:36 2014 +0100
@@ -74,7 +74,18 @@
 
     enum ToolChoices {
         NONE(""),
-        JAVAC("javac"),
+        BOOSTRAP_JAVAC("bootstrap-javac", true) {
+            @Override
+            public ToolChoices baseTool() {
+                return JAVAC;
+            }
+        },
+        JAVAC("javac") {
+            @Override
+            public ToolChoices asBootstrap() {
+                return BOOSTRAP_JAVAC;
+            }
+        },
         JAVADOC("javadoc"),
         JAVAH("javah"),
         JAVAP("javap");
@@ -91,6 +102,14 @@
             this.bootstrap = bootstrap;
         }
 
+        public ToolChoices asBootstrap() {
+            return this;
+        }
+
+        public ToolChoices baseTool() {
+            return this;
+        }
+
         @Override
         public String toString() {
             return toolName;
@@ -176,9 +195,11 @@
         JOptionPane p = createPane(guiProps);
         p.createDialog("Select Tool").setVisible(true);
 
-        toolName = ((ToolChoices)toolChoice.getSelectedItem()).toolName;
+        ToolChoices tool = (ToolChoices)toolChoice.getSelectedItem();
+
+        toolName = tool.baseTool().toolName;
+        toolBootstrap = tool.bootstrap;
         toolArgs = argsField.getText();
-        toolBootstrap = bootstrapCheckbox.isSelected();
         if (defaultCheck.isSelected()) {
             if (toolName.equals("")) {
                 fileProps.remove("tool.name");
@@ -213,30 +234,31 @@
         EnumSet<ToolChoices> toolChoices = toolProperty == null ?
                 EnumSet.allOf(ToolChoices.class) : EnumSet.range(ToolChoices.JAVAC, ToolChoices.JAVAP);
         toolChoice = new JComboBox<>(toolChoices.toArray());
-        if (toolName != null)
-            toolChoice.setSelectedItem(ToolChoices.valueOf(toolName.toUpperCase()));
+        ToolChoices tool = toolName != null ? ToolChoices.valueOf(toolName.toUpperCase()) : null;
+        if (toolName != null) {
+            if (toolBootstrap)
+                tool = tool.asBootstrap();
+            toolChoice.setSelectedItem(tool);
+        }
         toolChoice.addItemListener(new ItemListener() {
             @Override
             public void itemStateChanged(ItemEvent e) {
-                String tn = ((ToolChoices)e.getItem()).toolName;
-                argsField.setText(getDefaultArgsForTool(props, tn));
+                ToolChoices tool = (ToolChoices)e.getItem();
+                argsField.setText(getDefaultArgsForTool(props, tool));
                 if (toolProperty != null)
-                    okButton.setEnabled(!tn.equals(""));
+                    okButton.setEnabled(tool != ToolChoices.NONE);
             }
         });
-        GridBagConstraints checkConstraint = new GridBagConstraints();
         fc.anchor = GridBagConstraints.EAST;
 
         GridBagConstraints toolConstraint = new GridBagConstraints();
         fc.anchor = GridBagConstraints.WEST;
 
         toolPane.add(toolChoice, toolConstraint);
-        bootstrapCheckbox = new JCheckBox("bootstrap", toolBootstrap);
-        toolPane.add(bootstrapCheckbox, checkConstraint);
 
         body.add(toolPane, fc);
 
-        argsField = new JTextField(getDefaultArgsForTool(props, toolName), 40);
+        argsField = new JTextField(getDefaultArgsForTool(props, tool), 40);
         if (toolProperty == null || argsProperty != null) {
             JLabel argsLabel = new JLabel("Args:");
             body.add(argsLabel, lc);
@@ -322,8 +344,11 @@
         }
     }
 
-    String getDefaultArgsForTool(Properties props, String tn) {
-        return (tn == null || tn.equals("")) ? "" : props.getProperty(tn + ".args", "");
+    String getDefaultArgsForTool(Properties props, ToolChoices tool) {
+        if (tool == null)
+            return "";
+        String toolName = tool.baseTool().toolName;
+        return toolName.equals("") ? "" : props.getProperty(toolName + ".args", "");
     }
 
     // Ant task parameters
@@ -335,7 +360,6 @@
 
     // GUI components
     private JComboBox<?> toolChoice;
-    private JCheckBox bootstrapCheckbox;
     private JTextField argsField;
     private JCheckBox defaultCheck;
     private JButton okButton;