8064367: Fix IntelliJ langtools support to use new dev build
authormcimadamore
Sat, 08 Nov 2014 22:00:31 +0000
changeset 27548 d3f506b108e5
parent 27547 d07b3dcbc707
child 27549 55a03b691be2
8064367: Fix IntelliJ langtools support to use new dev build Summary: Update ant hooks in langtools IntelliJ project Reviewed-by: jlahoda
langtools/make/intellij/build.xml
langtools/make/intellij/src/idea/LangtoolsIdeaAntLogger.java
langtools/make/intellij/workspace.xml
--- a/langtools/make/intellij/build.xml	Fri Nov 07 14:51:35 2014 -0800
+++ b/langtools/make/intellij/build.xml	Sat Nov 08 22:00:31 2014 +0000
@@ -2,10 +2,8 @@
 <project name="langtools" basedir="..">
 
     <script language="javascript" classpath=".idea/classes">
-        var ideaListener = project.getBuildListeners().firstElement();            
         var LangtoolsLogger = Java.type("idea.LangtoolsIdeaAntLogger");
-        project.removeBuildListener(ideaListener)
-        project.addBuildListener(new LangtoolsLogger(ideaListener))
+        new LangtoolsLogger(project)
     </script>
 
     <import file="../make/build.xml"/>
--- a/langtools/make/intellij/src/idea/LangtoolsIdeaAntLogger.java	Fri Nov 07 14:51:35 2014 -0800
+++ b/langtools/make/intellij/src/idea/LangtoolsIdeaAntLogger.java	Sat Nov 08 22:00:31 2014 +0000
@@ -26,7 +26,9 @@
 package idea;
 
 import org.apache.tools.ant.BuildEvent;
+import org.apache.tools.ant.BuildListener;
 import org.apache.tools.ant.DefaultLogger;
+import org.apache.tools.ant.Project;
 
 import java.util.EnumSet;
 import java.util.Stack;
@@ -166,21 +168,17 @@
             }
         },
         /** build bootstrap tool target - executed when bootstrapping javac */
-        BUILD_BOOTSTRAP_TOOL("build-bootstrap-.*") {
+        BUILD_BOOTSTRAP_JAVAC("build-bootstrap-javac-classes") {
             @Override
             String getDisplayMessage(BuildEvent e) {
-                String targetName = e.getTarget().getName();
-                String tool = targetName.split("-")[2];
-                return "Building bootstrap " + tool + "...";
+                return "Building bootstrap javac...";
             }
         },
         /** build classes target - executed when building classes of given tool */
-        BUILD_TOOL("build-classes-.*") {
+        BUILD_ALL_CLASSES("build-all-classes") {
             @Override
             String getDisplayMessage(BuildEvent e) {
-                String targetName = e.getTarget().getName();
-                String tool = targetName.split("-")[2];
-                return "Building " + tool + "...";
+                return "Building all classes...";
             }
         },
         /** synthetic target catching any other target not in this list */
@@ -195,14 +193,14 @@
             }
         };
 
-        String targetRegex;
+        String targetName;
 
-        Target(String targetRegex) {
-            this.targetRegex = targetRegex;
+        Target(String targetName) {
+            this.targetName = targetName;
         }
 
         boolean matches(String msg) {
-            return msg.matches(targetRegex);
+            return msg.equals(targetName);
         }
 
         abstract String getDisplayMessage(BuildEvent e);
@@ -253,8 +251,14 @@
     /** stack of pending tasks */
     Stack<Task> tasks = new Stack<>();
 
-    public LangtoolsIdeaAntLogger(DefaultLogger logger) {
-        this.logger = logger;
+    public LangtoolsIdeaAntLogger(Project project) {
+        for (Object o : project.getBuildListeners()) {
+            if (o instanceof DefaultLogger) {
+                this.logger = (DefaultLogger)o;
+                project.removeBuildListener((BuildListener)o);
+                project.addBuildListener(this);
+            }
+        }
         tasks.push(Task.ROOT);
     }
 
--- a/langtools/make/intellij/workspace.xml	Fri Nov 07 14:51:35 2014 -0800
+++ b/langtools/make/intellij/workspace.xml	Sat Nov 08 22:00:31 2014 +0000
@@ -10,7 +10,7 @@
     <!-- standard tools -->
     <configuration default="false" name="javac" type="Application" factoryName="Application">
       <option name="MAIN_CLASS_NAME" value="com.sun.tools.javac.Main" />
-      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build/classes" />
+      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build/java.compiler/classes:build/jdk.compiler/classes:build/java.base/classes:build/jdk.javadoc/classes:build/jdk.dev/classes" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -24,12 +24,12 @@
       <ConfigurationWrapper RunnerId="Run" />
       <method>
         <option name="Make" enabled="false" />
-        <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-classes-javac" />
+        <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-all-classes" />
       </method>
     </configuration>
     <configuration default="false" name="javadoc" type="Application" factoryName="Application">
       <option name="MAIN_CLASS_NAME" value="com.sun.tools.javadoc.Main" />
-      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build/classes" />
+      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build/java.compiler/classes:build/jdk.compiler/classes:build/java.base/classes:build/jdk.javadoc/classes:build/jdk.dev/classes" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -43,12 +43,12 @@
       <ConfigurationWrapper RunnerId="Run" />
       <method>
         <option name="Make" enabled="false" />
-        <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-classes-javadoc" />
+        <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-all-classes" />
       </method> 
     </configuration>
     <configuration default="false" name="javap" type="Application" factoryName="Application">
       <option name="MAIN_CLASS_NAME" value="com.sun.tools.javap.Main" />
-      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build/classes" />
+      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build/java.compiler/classes:build/jdk.compiler/classes:build/java.base/classes:build/jdk.javadoc/classes:build/jdk.dev/classes" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -62,12 +62,12 @@
       <ConfigurationWrapper RunnerId="Run" />
       <method>
         <option name="Make" enabled="false" />
-        <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-classes-javap" />
+        <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-all-classes" />
       </method> 
     </configuration>
     <configuration default="false" name="javah" type="Application" factoryName="Application">
       <option name="MAIN_CLASS_NAME" value="com.sun.tools.javah.Main" />
-      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build/classes" />
+      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build/java.compiler/classes:build/jdk.compiler/classes:build/java.base/classes:build/jdk.javadoc/classes:build/jdk.dev/classes" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -81,12 +81,12 @@
       <ConfigurationWrapper RunnerId="Run" />
       <method>
         <option name="Make" enabled="false" />
-        <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-classes-javah" />
+        <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-all-classes" />
       </method> 
     </configuration>
     <configuration default="false" name="sjavac" type="Application" factoryName="Application">
       <option name="MAIN_CLASS_NAME" value="com.sun.tools.sjavac.Main" />
-      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build/classes" />
+      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build/java.compiler/classes:build/jdk.compiler/classes:build/java.base/classes:build/jdk.javadoc/classes:build/jdk.dev/classes" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -100,13 +100,13 @@
       <ConfigurationWrapper RunnerId="Run" />
       <method>
         <option name="Make" enabled="false" />
-        <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-classes-sjavac" />
+        <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-all-classes" />
       </method> 
     </configuration>
     <!-- bootstrap javac -->
     <configuration default="false" name="javac (bootstrap)" type="Application" factoryName="Application">
       <option name="MAIN_CLASS_NAME" value="com.sun.tools.javac.Main" />
-      <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build/bootstrap/classes" />
+            <option name="VM_PARAMETERS" value="-Xbootclasspath/p:build/bootstrap/java.compiler/classes:build/bootstrap/jdk.compiler/classes:build/bootstrap/java.base/classes:build/bootstrap/jdk.javadoc/classes:build/bootstrap/jdk.dev/classes" />
       <option name="PROGRAM_PARAMETERS" value="" />
       <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />