build scripts: automatically set 'idea.jars.nocopy' property for products without...
authornik <Nikolay.Chashnikov@jetbrains.com>
Wed, 31 Aug 2016 15:02:26 +0000 (18:02 +0300)
committernik <Nikolay.Chashnikov@jetbrains.com>
Wed, 31 Aug 2016 15:03:03 +0000 (18:03 +0300)
build/groovy/org/jetbrains/intellij/build/BuildContext.groovy
build/groovy/org/jetbrains/intellij/build/impl/BuildContextImpl.groovy
build/groovy/org/jetbrains/intellij/build/impl/BuildTasksImpl.groovy
python/build/groovy/org/jetbrains/intellij/build/pycharm/PyCharmPropertiesBase.groovy

index aababf51b22b8bae256801f7c5bef2480dce9757..121e52b0b0c4461364b95c08652995cc8ec2ece8 100644 (file)
@@ -65,6 +65,12 @@ abstract class BuildContext {
 
   abstract boolean includeBreakGenLibraries()
 
+  /**
+   * If the method returns {@code false} 'idea.jars.nocopy' property will be set to {@code true} in idea.properties by default. Otherwise it
+   * won't be set and the IDE will copy library *.jar files to avoid their locking when running under Windows.
+   */
+  abstract boolean shouldIDECopyJarsByDefault()
+
   abstract void patchInspectScript(String path)
 
   abstract String getAdditionalJvmArguments()
index b741ca5fdbbe17441f6e6c98030d72b3fa37d6a6..5fe53ef1e02964796e0ff8cdc7ff262b8c199229 100644 (file)
@@ -259,8 +259,18 @@ class BuildContextImpl extends BuildContext {
 
   @Override
   boolean includeBreakGenLibraries() {
+    return isJavaSupportedInProduct()
+  }
+
+  @Override
+  boolean shouldIDECopyJarsByDefault() {
+    return isJavaSupportedInProduct()
+  }
+
+  private boolean isJavaSupportedInProduct() {
     def productLayout = productProperties.productLayout
-    return productLayout.mainJarName == null || //todo[nik] remove this condition later
+    return productLayout.mainJarName == null ||
+           //todo[nik] remove this condition later; currently build scripts for IDEA don't fully migrated to the new scheme
            productLayout.includedPlatformModules.contains("execution-impl")
   }
 
index 2a01f0f6ed2312d5ff5f6b48867002b622b57f67..6d03a54eca4074122a965adfb3dae8b826aeb7e2 100644 (file)
@@ -143,6 +143,14 @@ class BuildTasksImpl extends BuildTasks {
     File originalFile = new File("$buildContext.paths.communityHome/bin/idea.properties")
 
     String text = originalFile.text
+    if (!buildContext.shouldIDECopyJarsByDefault()) {
+      text += """
+#---------------------------------------------------------------------
+# IDE can copy library .jar files to prevent their locking. Set this property to 'false' to enable copying.
+#---------------------------------------------------------------------
+idea.jars.nocopy=true
+"""
+    }
     buildContext.productProperties.additionalIDEPropertiesFilePaths.each {
       text += "\n" + new File(it).text
     }
index 934febae1d725d143da77c29a0bed016c9f08636..9d7c7c31957ef95b00ce0061f10b4179190397cf 100644 (file)
@@ -43,7 +43,6 @@ import org.jetbrains.intellij.build.WindowsDistributionCustomizer
 abstract class PyCharmPropertiesBase extends ProductProperties {
   PyCharmPropertiesBase(String home) {
     baseFileName = "pycharm"
-    additionalIDEPropertiesFilePaths = ["$home/build/conf/ideaJNC.properties"]
     reassignAltClickToMultipleCarets = true
     productLayout.mainJarName = "pycharm.jar"
     productLayout.additionalPlatformJars.put("pycharm-pydev.jar", "python-pydev")