Build for Idea plugin fails for Idea 2020.1

John Rhee guins_j at guins.org
Sat May 23 13:07:27 UTC 2020


Hello all,


I’ve been trying to build the jtreg IntelliJ plugin using Intellij 2020 and
ran into compilation issues where AntIcons.Target isn’t found.


https://github.com/openjdk/jtreg/blob/5841ff0844f607f13bba569d5edd122b00ec2972/plugins/idea/src/com/oracle/plugin/jtreg/service/ui/JTRegServiceConfigurable.java#L232


Looking into the IntelliJ CE source code:


It seems like AntIcon.Target has been deprecated since late 2018

https://github.com/JetBrains/intellij-community/blob/e0229a84794b7bce747e3c1bfbb2a08f3f4efa6e/plugins/ant/src/icons/AntIcons.java#L47

And subsequently removed starting with IntelliJ 2020

https://github.com/JetBrains/intellij-community/commit/6c74a7dcd3aa02a3a4e93596801a5f6c7128f0eb#diff-d070a13cb7b56a134dd221cd68121125



I was thinking a fix like the following might help (I have verified with my
Intellij Ultimate 2020.1)

(Forgive me for jumping straight into code, but I’ve been looking for an
opportunity to contribute for a while :D)


Johnui-MacBook-Pro:jtreg john$ hg export

# HG changeset patch

# User John Rhee <guins_j at guins.org>

# Date 1590238361 -32400

#      Sat May 23 21:52:41 2020 +0900

# Node ID e147432da589a67d57b1d1aea2ad9e8973cbab9a

# Parent  34c51cabc7f09c6bfa24b3ea73fb11b1191ff50b

make jtreg idea plugin compatible with Idea 2020.1


*diff -r 34c51cabc7f0 -r e147432da589 plugins/idea/.idea/jtreg-plugin.iml*

*--- a/plugins/idea/.idea/jtreg-plugin.iml       Tue May 12 16:09:47 2020
-0700*

*+++ b/plugins/idea/.idea/jtreg-plugin.iml       Sat May 23 21:52:41 2020
+0900*

@@ -21,6 +21,15 @@

     <orderEntry type="module-library" scope="PROVIDED">

       <library>

         <CLASSES>

+          <root url="jar://$APPLICATION_HOME_DIR$/plugins/icons.jar!/" />

+        </CLASSES>

+        <JAVADOC />

+        <SOURCES />

+      </library>

+    </orderEntry>

+    <orderEntry type="module-library" scope="PROVIDED">

+      <library>

+        <CLASSES>

           <root
url="jar://$APPLICATION_HOME_DIR$/plugins/testng/lib/testng-plugin.jar!/" />

         </CLASSES>

         <JAVADOC />

*diff -r 34c51cabc7f0 -r e147432da589
plugins/idea/src/com/oracle/plugin/jtreg/service/ui/JTRegServiceConfigurable.java*

*---
a/plugins/idea/src/com/oracle/plugin/jtreg/service/ui/JTRegServiceConfigurable.java
Tue May 12 16:09:47 2020 -0700*

*+++
b/plugins/idea/src/com/oracle/plugin/jtreg/service/ui/JTRegServiceConfigurable.java
Sat May 23 21:52:41 2020 +0900*

@@ -28,6 +28,7 @@

 import com.intellij.execution.ExecutionBundle;

 import com.intellij.execution.ui.DefaultJreSelector;

 import com.intellij.execution.ui.JrePathEditor;

+import com.intellij.icons.AllIcons.Nodes;

 import com.intellij.lang.ant.AntBundle;

 import com.intellij.lang.ant.config.AntBuildTarget;

 import com.intellij.lang.ant.config.AntConfiguration;

@@ -229,7 +230,7 @@

         }



         public Icon getTaskIcon(AntBuildTarget antTarget) {

-            return antTarget instanceof MetaTarget ? AntIcons.MetaTarget :
AntIcons.Target;

+            return antTarget instanceof MetaTarget ? AntIcons.MetaTarget :
Nodes.Target;

         }



         public String getDescription(AntBuildTarget antTarget) {

Johnui-MacBook-Pro:jtreg john$




Any feedback, comments are welcome.


Thank you


More information about the jtreg-dev mailing list