From d5ebe2e66a974c3a51d6136d8e6980708cbdd058 Mon Sep 17 00:00:00 2001 From: Mikhail Zarechenskiy Date: Wed, 12 Dec 2018 11:51:25 +0300 Subject: [PATCH] Reorganize dependencies around `kotlin-compiler.jar` #KT-26807 Fixed --- ant/build.gradle.kts | 2 +- build.gradle.kts | 1 + buildSrc/src/main/kotlin/dependencies.kt | 3 +++ buildSrc/src/main/kotlin/embeddable.kt | 1 - .../jetbrains/kotlin/utils/KotlinPaths.java | 7 +++++ .../kotlin/utils/KotlinPathsFromHomeDir.java | 14 ++++++++++ .../org/jetbrains/kotlin/utils/PathUtil.kt | 3 +++ .../kotlin/console/KotlinConsoleKeeper.kt | 3 ++- include/kotlin-compiler/build.gradle.kts | 1 - include/kotlin-compiler/build.gradle.kts.173 | 1 - .../build.gradle.kts | 1 + .../experimental/jvm/util/jvmClasspathUtil.kt | 6 ++++- .../kotlin/gradle/tasks/jarSearchingUtil.kt | 27 ++++++++++++++++--- .../tools/kotlin-script-util/build.gradle.kts | 1 + prepare/compiler-embeddable/build.gradle.kts | 1 + prepare/compiler/build.gradle.kts | 19 ++++++++----- prepare/compiler/build.gradle.kts.182 | 19 ++++++++----- prepare/compiler/build.gradle.kts.as34 | 19 ++++++++----- 18 files changed, 98 insertions(+), 31 deletions(-) diff --git a/ant/build.gradle.kts b/ant/build.gradle.kts index 6814c3ff9a1..77c545f7793 100644 --- a/ant/build.gradle.kts +++ b/ant/build.gradle.kts @@ -17,7 +17,7 @@ sourceSets { } runtimeJar { - manifest.attributes.put("Class-Path", "kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar kotlin-preloader.jar") + manifest.attributes.put("Class-Path", "$compilerManifestClassPath kotlin-preloader.jar") } dist() diff --git a/build.gradle.kts b/build.gradle.kts index 095436124fb..1ded15ee2f7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -167,6 +167,7 @@ extra["versions.robolectric"] = "3.1" extra["versions.org.springframework"] = "4.2.0.RELEASE" extra["versions.jflex"] = "1.7.0" extra["versions.markdown"] = "0.1.25" +extra["versions.trove4j"] = "1.0.20181211" val isTeamcityBuild = project.hasProperty("teamcity") || System.getenv("TEAMCITY_VERSION") != null val intellijUltimateEnabled = project.getBooleanProperty("intellijUltimateEnabled") ?: isTeamcityBuild diff --git a/buildSrc/src/main/kotlin/dependencies.kt b/buildSrc/src/main/kotlin/dependencies.kt index 34dd27c4404..105c05a3be5 100644 --- a/buildSrc/src/main/kotlin/dependencies.kt +++ b/buildSrc/src/main/kotlin/dependencies.kt @@ -104,6 +104,9 @@ fun Project.firstFromJavaHomeThatExists(vararg paths: String, jdkHome: File = Fi fun Project.toolsJar(jdkHome: File = File(this.property("JDK_18") as String)): File? = firstFromJavaHomeThatExists("lib/tools.jar", jdkHome = jdkHome) +val compilerManifestClassPath + get() = "kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar trove4j.jar" + object EmbeddedComponents { val CONFIGURATION_NAME = "embeddedComponents" } diff --git a/buildSrc/src/main/kotlin/embeddable.kt b/buildSrc/src/main/kotlin/embeddable.kt index 1c6a458f2fd..73fd3b11064 100644 --- a/buildSrc/src/main/kotlin/embeddable.kt +++ b/buildSrc/src/main/kotlin/embeddable.kt @@ -18,7 +18,6 @@ val packagesToRelocate = "org.jdom", "org.picocontainer", "org.jline", - "gnu", "org.fusesource", "kotlinx.coroutines") diff --git a/compiler/util/src/org/jetbrains/kotlin/utils/KotlinPaths.java b/compiler/util/src/org/jetbrains/kotlin/utils/KotlinPaths.java index 2d2b5842e9f..a4ed89f3643 100644 --- a/compiler/util/src/org/jetbrains/kotlin/utils/KotlinPaths.java +++ b/compiler/util/src/org/jetbrains/kotlin/utils/KotlinPaths.java @@ -19,6 +19,7 @@ package org.jetbrains.kotlin.utils; import org.jetbrains.annotations.NotNull; import java.io.File; +import java.util.List; public interface KotlinPaths { @NotNull @@ -60,6 +61,12 @@ public interface KotlinPaths { @NotNull File getSamWithReceiverJarPath(); + @NotNull + File getTrove4jJarPath(); + + @NotNull + List getCompilerClasspath(); + @NotNull File getCompilerPath(); diff --git a/compiler/util/src/org/jetbrains/kotlin/utils/KotlinPathsFromHomeDir.java b/compiler/util/src/org/jetbrains/kotlin/utils/KotlinPathsFromHomeDir.java index af7de9203b5..ca159325fe8 100644 --- a/compiler/util/src/org/jetbrains/kotlin/utils/KotlinPathsFromHomeDir.java +++ b/compiler/util/src/org/jetbrains/kotlin/utils/KotlinPathsFromHomeDir.java @@ -16,9 +16,11 @@ package org.jetbrains.kotlin.utils; +import kotlin.collections.CollectionsKt; import org.jetbrains.annotations.NotNull; import java.io.File; +import java.util.List; public class KotlinPathsFromHomeDir implements KotlinPaths { // kotlinc directory @@ -106,6 +108,18 @@ public class KotlinPathsFromHomeDir implements KotlinPaths { return getLibraryFile(PathUtil.SAM_WITH_RECEIVER_PLUGIN_JAR_NAME); } + @NotNull + @Override + public File getTrove4jJarPath() { + return getLibraryFile(PathUtil.TROVE4J_NAME); + } + + @NotNull + @Override + public List getCompilerClasspath() { + return CollectionsKt.listOf(getStdlibPath(), getReflectPath(), getScriptRuntimePath(), getTrove4jJarPath()); + } + @NotNull @Override public File getCompilerPath() { diff --git a/compiler/util/src/org/jetbrains/kotlin/utils/PathUtil.kt b/compiler/util/src/org/jetbrains/kotlin/utils/PathUtil.kt index 83171bd2873..f1c9247f65e 100644 --- a/compiler/util/src/org/jetbrains/kotlin/utils/PathUtil.kt +++ b/compiler/util/src/org/jetbrains/kotlin/utils/PathUtil.kt @@ -71,6 +71,9 @@ object PathUtil { const val KOTLIN_JAVA_STDLIB_SRC_JAR_OLD = "kotlin-runtime-sources.jar" + const val TROVE4J_NAME = "trove4j" + const val TROVE4J_JAR = "$TROVE4J_NAME.jar" + const val KOTLIN_COMPILER_NAME = "kotlin-compiler" const val KOTLIN_COMPILER_JAR = "$KOTLIN_COMPILER_NAME.jar" diff --git a/idea/idea-repl/src/org/jetbrains/kotlin/console/KotlinConsoleKeeper.kt b/idea/idea-repl/src/org/jetbrains/kotlin/console/KotlinConsoleKeeper.kt index 2c83e880b42..6ca7829bd5a 100644 --- a/idea/idea-repl/src/org/jetbrains/kotlin/console/KotlinConsoleKeeper.kt +++ b/idea/idea-repl/src/org/jetbrains/kotlin/console/KotlinConsoleKeeper.kt @@ -70,7 +70,8 @@ class KotlinConsoleKeeper(val project: Project) { //paramList.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005") val kotlinPaths = PathUtil.kotlinPathsForIdeaPlugin - val replClassPath = listOf(kotlinPaths.compilerPath, kotlinPaths.reflectPath, kotlinPaths.stdlibPath, kotlinPaths.scriptRuntimePath) + val replClassPath = + (kotlinPaths.compilerClasspath + kotlinPaths.compilerPath) .joinToString(File.pathSeparator) { it.absolutePath } paramList.add("-cp") diff --git a/include/kotlin-compiler/build.gradle.kts b/include/kotlin-compiler/build.gradle.kts index 23db7d5dceb..e288c5885ae 100644 --- a/include/kotlin-compiler/build.gradle.kts +++ b/include/kotlin-compiler/build.gradle.kts @@ -9,7 +9,6 @@ val fatJarContentsStripMetadata by configurations.creating val fatJarContentsStripServices by configurations.creating val compilerModules: Array by rootProject.extra -val compilerManifestClassPath = "kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar" dependencies { compilerModules.forEach { module -> diff --git a/include/kotlin-compiler/build.gradle.kts.173 b/include/kotlin-compiler/build.gradle.kts.173 index bf2853e497e..c5fff47f1b7 100644 --- a/include/kotlin-compiler/build.gradle.kts.173 +++ b/include/kotlin-compiler/build.gradle.kts.173 @@ -9,7 +9,6 @@ val fatJarContentsStripMetadata by configurations.creating val fatJarContentsStripServices by configurations.creating val compilerModules: Array by rootProject.extra -val compilerManifestClassPath = "kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar" dependencies { compilerModules.forEach { module -> diff --git a/libraries/examples/kotlin-jsr223-daemon-local-eval-example/build.gradle.kts b/libraries/examples/kotlin-jsr223-daemon-local-eval-example/build.gradle.kts index 031dcf76e7a..7975303aaa4 100644 --- a/libraries/examples/kotlin-jsr223-daemon-local-eval-example/build.gradle.kts +++ b/libraries/examples/kotlin-jsr223-daemon-local-eval-example/build.gradle.kts @@ -20,6 +20,7 @@ dependencies { compilerClasspath(project(":kotlin-reflect")) compilerClasspath(project(":kotlin-stdlib")) compilerClasspath(project(":kotlin-script-runtime")) + compilerClasspath(commonDep("org.jetbrains.intellij.deps", "trove4j")) compileOnly(project(":compiler:cli-common")) // TODO: fix import (workaround for jps build) testCompileOnly(project(":core:util.runtime")) // TODO: fix import (workaround for jps build) testCompileOnly(project(":compiler:daemon-common")) // TODO: fix import (workaround for jps build) diff --git a/libraries/scripting/jvm/src/kotlin/script/experimental/jvm/util/jvmClasspathUtil.kt b/libraries/scripting/jvm/src/kotlin/script/experimental/jvm/util/jvmClasspathUtil.kt index dfb167a3b8c..4bc8e17e97a 100644 --- a/libraries/scripting/jvm/src/kotlin/script/experimental/jvm/util/jvmClasspathUtil.kt +++ b/libraries/scripting/jvm/src/kotlin/script/experimental/jvm/util/jvmClasspathUtil.kt @@ -16,9 +16,12 @@ import kotlin.script.templates.standard.ScriptTemplateWithArgs // TODO: consider moving all these utilites to the build-common or some other shared compiler API module +// Kotlin Compiler dependencies internal const val KOTLIN_JAVA_STDLIB_JAR = "kotlin-stdlib.jar" internal const val KOTLIN_JAVA_REFLECT_JAR = "kotlin-reflect.jar" internal const val KOTLIN_JAVA_SCRIPT_RUNTIME_JAR = "kotlin-script-runtime.jar" +internal const val TROVE4J_JAR = "trove4j.jar" + internal const val KOTLIN_COMPILER_NAME = "kotlin-compiler" internal const val KOTLIN_COMPILER_JAR = "$KOTLIN_COMPILER_NAME.jar" @@ -160,7 +163,8 @@ object KotlinJars { val kotlinLibsJars = listOf( KOTLIN_JAVA_STDLIB_JAR, KOTLIN_JAVA_REFLECT_JAR, - KOTLIN_JAVA_SCRIPT_RUNTIME_JAR + KOTLIN_JAVA_SCRIPT_RUNTIME_JAR, + TROVE4J_JAR ) val kotlinBaseJars = kotlinCompilerJars + kotlinLibsJars diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/jarSearchingUtil.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/jarSearchingUtil.kt index 62370cde81b..97baeb61d47 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/jarSearchingUtil.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/jarSearchingUtil.kt @@ -38,6 +38,7 @@ private val KOTLIN_SCRIPT_RUNTIME_EXPECTED_CLASS = "kotlin.script.templates.Anno private val KOTLIN_SCRIPT_ANNOTATION_EXPECTED_CLASS = "kotlin.script.experimental.annotations.KotlinScript" private val KOTLIN_JVM_SCRIPT_COMPILER_EXPECTED_CLASS = "kotlin.script.experimental.jvm.JvmScriptCompiler" private val KOTLIN_REFLECT_EXPECTED_CLASS = "kotlin.reflect.full.KClasses" +private val TROVE4J_EXPECTED_CLASS = "gnu.trove.THashMap" internal const val KOTLIN_MODULE_GROUP = "org.jetbrains.kotlin" private val KOTLIN_GRADLE_PLUGIN = "kotlin-gradle-plugin" internal const val KOTLIN_COMPILER_EMBEDDABLE = "kotlin-compiler-embeddable" @@ -50,27 +51,45 @@ private val KOTLIN_REFLECT = "kotlin-reflect" internal fun findKotlinJvmCompilerClasspath(project: Project): List = findKotlinModuleJar(project, K2JVM_COMPILER_CLASS, KOTLIN_COMPILER_EMBEDDABLE).let { if (it.isEmpty()) it - else it + findKotlinStdlibClasspath(project) + findKotlinScriptRuntimeClasspath(project) + findKotlinReflectClasspath(project) + else it + findKotlinCompilerClasspath(project) } internal fun findKotlinJsCompilerClasspath(project: Project): List = findKotlinModuleJar(project, K2JS_COMPILER_CLASS, KOTLIN_COMPILER_EMBEDDABLE).let { if (it.isEmpty()) it - else it + findKotlinStdlibClasspath(project) + findKotlinScriptRuntimeClasspath(project) + findKotlinReflectClasspath(project) + else it + findKotlinCompilerClasspath(project) } internal fun findKotlinMetadataCompilerClasspath(project: Project): List = findKotlinModuleJar(project, K2METADATA_COMPILER_CLASS, KOTLIN_COMPILER_EMBEDDABLE).let { if (it.isEmpty()) it - else it + findKotlinStdlibClasspath(project) + findKotlinScriptRuntimeClasspath(project) + findKotlinReflectClasspath(project) + else it + findKotlinCompilerClasspath(project) } internal fun findKotlinJsDceClasspath(project: Project): List = findKotlinModuleJar(project, K2JS_DCE_CLASS, KOTLIN_COMPILER_EMBEDDABLE).let { if (it.isEmpty()) it - else it + findKotlinStdlibClasspath(project) + findKotlinScriptRuntimeClasspath(project) + findKotlinReflectClasspath(project) + else it + findKotlinCompilerClasspath(project) } +internal fun findKotlinCompilerClasspath(project: Project): List { + return findKotlinStdlibClasspath(project) + + findKotlinScriptRuntimeClasspath(project) + + findKotlinReflectClasspath(project) + + listOfNotNull(findTrove4j()) +} + +internal fun findTrove4j(): File? { + val classLoader = Thread.currentThread().contextClassLoader + val classFromTrove4j = try { + classLoader.loadClass(TROVE4J_EXPECTED_CLASS) + } catch (e: ClassNotFoundException) { + null + } ?: return null + + return findJarByClass(classFromTrove4j) +} + internal fun findKotlinStdlibClasspath(project: Project): List = findKotlinModuleJar(project, KOTLIN_STDLIB_EXPECTED_CLASS, KOTLIN_STDLIB) diff --git a/libraries/tools/kotlin-script-util/build.gradle.kts b/libraries/tools/kotlin-script-util/build.gradle.kts index 9b0803a33cb..6113cfd102c 100644 --- a/libraries/tools/kotlin-script-util/build.gradle.kts +++ b/libraries/tools/kotlin-script-util/build.gradle.kts @@ -14,6 +14,7 @@ dependencies { compile(project(":kotlin-stdlib")) compile(project(":kotlin-script-runtime")) compile(project(":kotlin-scripting-jvm")) + compile(commonDep("org.jetbrains.intellij.deps", "trove4j")) compileOnly(project(":compiler:cli")) compileOnly(project(":compiler:daemon-common")) compile(projectRuntimeJar(":kotlin-daemon-client")) diff --git a/prepare/compiler-embeddable/build.gradle.kts b/prepare/compiler-embeddable/build.gradle.kts index 29f312ea5d6..d729e2b99d5 100644 --- a/prepare/compiler-embeddable/build.gradle.kts +++ b/prepare/compiler-embeddable/build.gradle.kts @@ -9,6 +9,7 @@ dependencies { runtime(project(":kotlin-stdlib")) runtime(project(":kotlin-script-runtime")) runtime(project(":kotlin-reflect")) + runtime(commonDep("org.jetbrains.intellij.deps", "trove4j")) } noDefaultJar() diff --git a/prepare/compiler/build.gradle.kts b/prepare/compiler/build.gradle.kts index 382ddb9ef64..60c47f3c16c 100644 --- a/prepare/compiler/build.gradle.kts +++ b/prepare/compiler/build.gradle.kts @@ -17,8 +17,6 @@ val shrink = findProperty("kotlin.build.proguard")?.toString()?.toBoolean() ?: hasProperty("teamcity") -val compilerManifestClassPath = "kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar" - val fatJarContents by configurations.creating val fatJarContentsStripMetadata by configurations.creating @@ -31,6 +29,7 @@ val compile by configurations // maven plugin writes pom compile scope from com val libraries by configurations.creating { extendsFrom(compile) } +val trove4jJar by configurations.creating val default by configurations default.extendsFrom(runtimeJar) @@ -51,6 +50,7 @@ dependencies { compile(project(":kotlin-stdlib")) compile(project(":kotlin-script-runtime")) compile(project(":kotlin-reflect")) + compile(commonDep("org.jetbrains.intellij.deps", "trove4j")) libraries(project(":kotlin-annotations-jvm")) libraries( @@ -69,6 +69,8 @@ dependencies { fatSourcesJarContents(it) } + trove4jJar(intellijDep()) { includeIntellijCoreJarDependencies(project) { it.startsWith("trove4j") } } + fatJarContents(project(":core:builtins", configuration = "builtins")) fatJarContents(commonDep("javax.inject")) fatJarContents(commonDep("org.jline", "jline")) @@ -79,7 +81,11 @@ dependencies { fatJarContents(commonDep("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { isTransitive = false } fatJarContents(intellijCoreDep()) { includeJars("intellij-core", "java-compatibility-1.0.1") } - fatJarContents(intellijDep()) { includeIntellijCoreJarDependencies(project, { !(it.startsWith("jdom") || it.startsWith("log4j")) }) } + fatJarContents(intellijDep()) { + includeIntellijCoreJarDependencies(project) { + !(it.startsWith("jdom") || it.startsWith("log4j") || it.startsWith("trove4j")) + } + } fatJarContents(intellijDep()) { includeJars("jna-platform", "lz4-1.3.0") } fatJarContentsStripServices(intellijDep("jps-standalone")) { includeJars("jps-model") } fatJarContentsStripMetadata(intellijDep()) { includeJars("oro-2.0.8", "jdom", "log4j" ) } @@ -136,10 +142,9 @@ val proguard by task { val pack = if (shrink) proguard else packCompiler -dist( - targetName = "$compilerBaseName.jar", - fromTask = pack -) +dist(targetName = "$compilerBaseName.jar", fromTask = pack) { + from(trove4jJar) +} runtimeJarArtifactBy(pack, pack.outputs.files.singleFile) { name = compilerBaseName diff --git a/prepare/compiler/build.gradle.kts.182 b/prepare/compiler/build.gradle.kts.182 index 2fe52bd8235..1e2149445e0 100644 --- a/prepare/compiler/build.gradle.kts.182 +++ b/prepare/compiler/build.gradle.kts.182 @@ -17,8 +17,6 @@ val shrink = findProperty("kotlin.build.proguard")?.toString()?.toBoolean() ?: hasProperty("teamcity") -val compilerManifestClassPath = "kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar" - val fatJarContents by configurations.creating val fatJarContentsStripMetadata by configurations.creating @@ -31,6 +29,7 @@ val compile by configurations // maven plugin writes pom compile scope from com val libraries by configurations.creating { extendsFrom(compile) } +val trove4jJar by configurations.creating val default by configurations default.extendsFrom(runtimeJar) @@ -51,6 +50,7 @@ dependencies { compile(project(":kotlin-stdlib")) compile(project(":kotlin-script-runtime")) compile(project(":kotlin-reflect")) + compile(commonDep("org.jetbrains.intellij.deps", "trove4j")) libraries(project(":kotlin-annotations-jvm")) libraries( @@ -69,6 +69,8 @@ dependencies { fatSourcesJarContents(it) } + trove4jJar(intellijDep()) { includeIntellijCoreJarDependencies(project) { it.startsWith("trove4j") } } + fatJarContents(project(":core:builtins", configuration = "builtins")) fatJarContents(commonDep("javax.inject")) fatJarContents(commonDep("org.jline", "jline")) @@ -79,7 +81,11 @@ dependencies { fatJarContents(commonDep("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { isTransitive = false } fatJarContents(intellijCoreDep()) { includeJars("intellij-core") } - fatJarContents(intellijDep()) { includeIntellijCoreJarDependencies(project, { !(it.startsWith("jdom") || it.startsWith("log4j")) }) } + fatJarContents(intellijDep()) { + includeIntellijCoreJarDependencies(project) { + !(it.startsWith("jdom") || it.startsWith("log4j") || it.startsWith("trove4j")) + } + } when { Platform[173].orLower() -> { fatJarContents(intellijDep()) { includeJars("jna-platform") } @@ -148,10 +154,9 @@ val proguard by task { val pack = if (shrink) proguard else packCompiler -dist( - targetName = "$compilerBaseName.jar", - fromTask = pack -) +dist(targetName = "$compilerBaseName.jar", fromTask = pack) { + from(trove4jJar) +} runtimeJarArtifactBy(pack, pack.outputs.files.singleFile) { name = compilerBaseName diff --git a/prepare/compiler/build.gradle.kts.as34 b/prepare/compiler/build.gradle.kts.as34 index 956f38d7da1..c89add3a78a 100644 --- a/prepare/compiler/build.gradle.kts.as34 +++ b/prepare/compiler/build.gradle.kts.as34 @@ -17,8 +17,6 @@ val shrink = findProperty("kotlin.build.proguard")?.toString()?.toBoolean() ?: hasProperty("teamcity") -val compilerManifestClassPath = "kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar" - val fatJarContents by configurations.creating val fatJarContentsStripMetadata by configurations.creating @@ -31,6 +29,7 @@ val compile by configurations // maven plugin writes pom compile scope from com val libraries by configurations.creating { extendsFrom(compile) } +val trove4jJar by configurations.creating val default by configurations default.extendsFrom(runtimeJar) @@ -51,6 +50,7 @@ dependencies { compile(project(":kotlin-stdlib")) compile(project(":kotlin-script-runtime")) compile(project(":kotlin-reflect")) + compile(commonDep("org.jetbrains.intellij.deps", "trove4j")) libraries(project(":kotlin-annotations-jvm")) libraries( @@ -69,6 +69,8 @@ dependencies { fatSourcesJarContents(it) } + trove4jJar(intellijDep()) { includeIntellijCoreJarDependencies(project) { it.startsWith("trove4j") } } + fatJarContents(project(":core:builtins", configuration = "builtins")) fatJarContents(commonDep("javax.inject")) fatJarContents(commonDep("org.jline", "jline")) @@ -79,7 +81,11 @@ dependencies { fatJarContents(commonDep("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { isTransitive = false } fatJarContents(intellijCoreDep()) { includeJars("intellij-core") } - fatJarContents(intellijDep()) { includeIntellijCoreJarDependencies(project, { !(it.startsWith("jdom") || it.startsWith("log4j")) }) } + fatJarContents(intellijDep()) { + includeIntellijCoreJarDependencies(project) { + !(it.startsWith("jdom") || it.startsWith("log4j") || it.startsWith("trove4j")) + } + } fatJarContents(intellijDep()) { includeJars("jna-platform", "lz4-1.3.0") } fatJarContentsStripServices(intellijDep("jps-standalone")) { includeJars("jps-model") } fatJarContentsStripMetadata(intellijDep()) { includeJars("oro-2.0.8", "jdom", "log4j" ) } @@ -136,10 +142,9 @@ val proguard by task { val pack = if (shrink) proguard else packCompiler -dist( - targetName = "$compilerBaseName.jar", - fromTask = pack -) +dist(targetName = "$compilerBaseName.jar", fromTask = pack) { + from(trove4jJar) +} runtimeJarArtifactBy(pack, pack.outputs.files.singleFile) { name = compilerBaseName