don't put annotations-java8.jar in 'lib' directory to avoid its inclusion to IDE...
authornik <Nikolay.Chashnikov@jetbrains.com>
Fri, 29 May 2015 08:19:38 +0000 (11:19 +0300)
committernik <Nikolay.Chashnikov@jetbrains.com>
Fri, 29 May 2015 08:19:38 +0000 (11:19 +0300)
build/scripts/layouts.gant
java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/OrderEntryFix.java

index 99ef7740bfce61c93876a78a61a770f47f3077c8..074f7f4b417dd060415a95544b51c562cf339202 100644 (file)
@@ -137,10 +137,6 @@ def layoutFull(String home, String targetDirectory, String patchedDescriptorDir
         module("annotations-common")
         module("annotations")
       }
-      jar("annotations-java8.jar") {
-        module("annotations-common")
-        module("annotations-java8")
-      }
       jar("jdkAnnotations.jar") {
         fileset(dir: "${home}/java/jdkAnnotations")
       }
index 1fca087d0d1c2a51fa38b158af4fd85ceb227539..73b067ce25edc69fc37ff98e307bcafc4e2b6e19 100644 (file)
@@ -384,8 +384,17 @@ public abstract class OrderEntryFix implements IntentionAction, LocalQuickFix {
 
   @Nullable
   public static String locateAnnotationsJar(@NotNull Module module) {
-    String jarName = EffectiveLanguageLevelUtil.getEffectiveLanguageLevel(module).isAtLeast(LanguageLevel.JDK_1_8) ? "annotations-java8.jar" : "annotations.jar";
-    final LocateLibraryDialog dialog = new LocateLibraryDialog(module, PathManager.getLibPath(), jarName, QuickFixBundle.message("add.library.annotations.description"));
+    String jarName;
+    String libPath;
+    if (EffectiveLanguageLevelUtil.getEffectiveLanguageLevel(module).isAtLeast(LanguageLevel.JDK_1_8)) {
+      jarName = "annotations-java8.jar";
+      libPath = new File(PathManager.getHomePath(), "redist").getAbsolutePath();
+    }
+    else {
+      jarName = "annotations.jar";
+      libPath = PathManager.getLibPath();
+    }
+    final LocateLibraryDialog dialog = new LocateLibraryDialog(module, libPath, jarName, QuickFixBundle.message("add.library.annotations.description"));
     return dialog.showAndGet() ? dialog.getResultingLibraryPath() : null;
   }