build scripts: automatically set 'idea.jars.nocopy' property for products without java support (such products don't use *.jar libraries so don't need to avoid locking of jar files)

This commit is contained in:
nik
2016-08-31 18:03:03 +03:00
parent 53477d978c
commit b06d96a490
4 changed files with 25 additions and 2 deletions
@@ -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()
@@ -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")
}
@@ -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
}
@@ -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")