Skip to content

Commit 951bf8e

Browse files
ALikhachevSpace Team
authored and
Space Team
committed
Completely remove trove4j dependency
^KTI-1135 Fixed
1 parent d7977a2 commit 951bf8e

File tree

35 files changed

+6
-607
lines changed

35 files changed

+6
-607
lines changed

compiler/tests-compiler-utils/build.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ dependencies {
3030
testCompileOnly(intellijCore())
3131

3232
testApi(libs.guava)
33-
testApi(commonDependency("org.jetbrains.intellij.deps:trove4j"))
3433
testApi(libs.intellij.asm)
3534
testApi(commonDependency("org.jetbrains.intellij.deps:log4j"))
3635
testApi(intellijJDom())

compiler/util/src/org/jetbrains/kotlin/utils/KotlinPaths.kt

+1-6
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ interface KotlinPaths {
7373
val samWithReceiverJarPath: File
7474
get() = jar(Jar.SamWithReceiver)
7575

76-
// @Deprecated("Obsolete API", ReplaceWith("jar(KotlinPaths.Jars.trove4j)"))
77-
val trove4jJarPath: File
78-
get() = jar(Jar.Trove4j)
79-
8076
// @Deprecated("Obsolete API", ReplaceWith("classPath(KotlinPaths.ClassPaths.Compiler)"))
8177
val compilerClasspath: List<File>
8278
get() = classPath(ClassPaths.Compiler)
@@ -99,7 +95,6 @@ interface KotlinPaths {
9995
LombokPlugin(PathUtil.LOMBOK_PLUGIN_NAME),
10096
SamWithReceiver(PathUtil.SAM_WITH_RECEIVER_PLUGIN_NAME),
10197
SerializationPlugin(PathUtil.SERIALIZATION_PLUGIN_NAME),
102-
Trove4j(PathUtil.TROVE4J_NAME),
10398
Compiler(PathUtil.KOTLIN_COMPILER_NAME),
10499
ScriptingPlugin(PathUtil.KOTLIN_SCRIPTING_COMPILER_PLUGIN_NAME),
105100
ScriptingImpl(PathUtil.KOTLIN_SCRIPTING_COMPILER_IMPL_NAME),
@@ -120,7 +115,7 @@ interface KotlinPaths {
120115
else -> emptyList()
121116
}
122117
}),
123-
Compiler(StdLib, Jar.Compiler, Jar.Reflect, Jar.ScriptRuntime, Jar.Trove4j, Jar.KotlinDaemon, Jar.CoroutinesCore),
118+
Compiler(StdLib, Jar.Compiler, Jar.Reflect, Jar.ScriptRuntime, Jar.KotlinDaemon, Jar.CoroutinesCore),
124119
CompilerWithScripting(Compiler, Jar.ScriptingPlugin, Jar.ScriptingImpl, Jar.ScriptingLib, Jar.ScriptingJvmLib),
125120
MainKts(StdLib, Jar.MainKts, Jar.ScriptRuntime, Jar.Reflect)
126121
;

compiler/util/src/org/jetbrains/kotlin/utils/PathUtil.kt

-3
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ object PathUtil {
9595

9696
const val KOTLIN_JAVA_STDLIB_SRC_JAR_OLD = "kotlin-runtime-sources.jar"
9797

98-
const val TROVE4J_NAME = "trove4j"
99-
const val TROVE4J_JAR = "$TROVE4J_NAME.jar"
100-
10198
const val KOTLIN_COMPILER_NAME = "kotlin-compiler"
10299
const val KOTLIN_COMPILER_JAR = "$KOTLIN_COMPILER_NAME.jar"
103100

gradle/versions.properties

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ versions.oro=2.0.8
1818
versions.serviceMessages=2019.1.4
1919
versions.stax2-api=4.2.1
2020
versions.streamex=0.7.2
21-
versions.trove4j=1.0.20200330
2221
versions.lombok=1.18.16
2322
versions.commons-text=1.10.0
2423
# should be in sync with libs.versions.toml

js/js.tests/build.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ dependencies {
6666
testApi(project(":compiler:cli"))
6767
testApi(project(":compiler:util"))
6868

69-
testRuntimeOnly(commonDependency("org.jetbrains.intellij.deps:trove4j"))
7069
testRuntimeOnly(libs.guava)
7170
testRuntimeOnly(intellijJDom())
7271

js/js.tests/test/org/jetbrains/kotlin/js/test/ir/AbstractJsKlibLinkageTestCase.kt

-2
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ internal class ReleasedJsCompiler(private val jsHome: ReleasedJsArtifactsHome) {
264264
private fun createClassLoader(jsHome: ReleasedJsArtifactsHome): URLClassLoader {
265265
val jsClassPath = setOf(
266266
jsHome.compilerEmbeddable,
267-
jsHome.trove,
268267
jsHome.baseStdLib,
269268
)
270269
.map { it.toURI().toURL() }
@@ -276,7 +275,6 @@ private fun createClassLoader(jsHome: ReleasedJsArtifactsHome): URLClassLoader {
276275

277276
internal class ReleasedJsArtifactsHome(val dir: File, version: String) {
278277
val compilerEmbeddable: File = dir.resolve("kotlin-compiler-embeddable-$version.jar")
279-
val trove: File = dir.listFiles()?.single { it.name.contains("trove4j") } ?: error("Filed to find trove4j jar in $dir")
280278
val baseStdLib: File = dir.resolve("kotlin-stdlib-$version.jar")
281279
val jsStdLib: File = dir.resolve("kotlin-stdlib-js-$version.klib")
282280
}

kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/nativeDistribution/NativeDistribution.kt

-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ class NativeDistribution(val root: Directory) {
9191
*/
9292
val compilerClasspath: FileCollection
9393
get() = compilerJars.asFileTree.matching {
94-
include("trove4j.jar")
9594
include("kotlin-native-compiler-embeddable.jar")
9695
}
9796

kotlin-native/build.gradle

-17
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,6 @@ configurations {
104104
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, CppUsage.LIBRARY_RUNTIME))
105105
}
106106
}
107-
108-
trove4j_jar {
109-
canBeConsumed = false
110-
canBeResolved = true
111-
}
112107
}
113108

114109
apply plugin: CompilationDatabasePlugin
@@ -126,9 +121,6 @@ dependencies {
126121
nativeLibs project(':kotlin-native:llvmInterop')
127122
nativeLibs project(':kotlin-native:libclangInterop')
128123
nativeLibs project(':kotlin-native:Interop:Runtime')
129-
use(RepoDependencies) {
130-
trove4j_jar commonDependency("org.jetbrains.intellij.deps:trove4j")
131-
}
132124

133125
// declared to be included in verification-metadata.xml
134126
implicitDependencies("org.jetbrains.kotlin:kotlin-native-prebuilt:$bootstrapKotlinVersion:[email protected]")
@@ -195,8 +187,6 @@ def shadowJar = tasks.register("shadowJar", ShadowJar) {
195187
archiveBaseName.set("kotlin-native")
196188
archiveVersion.set("")
197189
archiveClassifier.set("")
198-
// Exclude trove4j because of license agreement.
199-
exclude "*trove4j*"
200190
exclude("META-INF/versions/9/module-info.class")
201191
configurations = [project.configurations.distPack]
202192
}
@@ -262,13 +252,6 @@ tasks.register("distNativeLibs", Sync) {
262252

263253
tasks.register("distCompilerJars", Sync) {
264254
from(shadowJar.map { it.archiveFile })
265-
from(configurations.trove4j_jar) {
266-
include "trove4j*.jar"
267-
rename "trove4j(.*).jar", "trove4j.jar"
268-
filePermissions {
269-
unix("0644")
270-
}
271-
}
272255
from(configurations.embeddableJar) {
273256
rename {
274257
"kotlin-native-compiler-embeddable.jar"

kotlin-native/cmd/run_konan

+1-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ while IFS=$'\r' read -r line || [[ -n "$line" ]]; do
7575
done < "${KONAN_HOME}/tools/env_blacklist"
7676

7777
KONAN_JAR="${KONAN_HOME}/konan/lib/kotlin-native-compiler-embeddable.jar"
78-
TROVE_JAR="${KONAN_HOME}/konan/lib/trove4j.jar"
79-
KONAN_CLASSPATH="$KONAN_JAR:$TROVE_JAR"
78+
KONAN_CLASSPATH="$KONAN_JAR"
8079
TOOL_CLASS=org.jetbrains.kotlin.cli.utilities.MainKt
8180
LIBCLANG_DISABLE_CRASH_RECOVERY=1 \
8281
$TIMECMD "$JAVACMD" "${java_opts[@]}" "${java_args[@]}" -cp "$KONAN_CLASSPATH" "$TOOL_CLASS" "$TOOL_NAME" "${konan_args[@]}"

kotlin-native/cmd/run_konan.bat

+1-2
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@ if not "!ARG!" == "" (
5454
set "KONAN_LIB=%_KONAN_HOME%\konan\lib"
5555

5656
set "KONAN_JAR=%KONAN_LIB%\kotlin-native-compiler-embeddable.jar"
57-
set TROVE_JAR="%KONAN_LIB%\trove4j.jar"
5857

59-
set "KONAN_CLASSPATH=%KONAN_JAR%;%TROVE_JAR%"
58+
set "KONAN_CLASSPATH=%KONAN_JAR%"
6059
set JAVA_OPTS=-ea ^
6160
-Xmx3G ^
6261
-XX:TieredStopAtLevel=1 ^

kotlin-native/prepare/kotlin-native-compiler-embeddable/build.gradle.kts

-3
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@ projectTest {
118118
*/
119119
jvmArgumentProviders.add(objects.newInstance<ProjectTestArgumentProvider>().apply {
120120
compilerClasspath.from(runtimeJar)
121-
compilerClasspath.from(configurations.detachedConfiguration(
122-
dependencies.create(commonDependency("org.jetbrains.intellij.deps:trove4j"))
123-
))
124121

125122
// The tests run the compiler and try to produce an executable on host.
126123
// So, distribution with stdlib and runtime for host is required.

libraries/scripting/jvm-host-test/build.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ dependencies {
2020

2121
testRuntimeOnly(project(":kotlin-compiler"))
2222
testImplementation(commonDependency("org.jetbrains.kotlin:kotlin-reflect")) { isTransitive = false }
23-
testRuntimeOnly(commonDependency("org.jetbrains.intellij.deps", "trove4j"))
2423
}
2524

2625
sourceSets {

libraries/scripting/jvm-host/build.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ dependencies {
1919
publishedRuntime(project(":kotlin-compiler"))
2020
publishedRuntime(project(":kotlin-scripting-compiler"))
2121
publishedRuntime(commonDependency("org.jetbrains.kotlin:kotlin-reflect")) { isTransitive = false }
22-
publishedRuntime(commonDependency("org.jetbrains.intellij.deps", "trove4j"))
2322
}
2423

2524
sourceSets {

libraries/scripting/jvm/src/kotlin/script/experimental/jvm/util/jvmClasspathUtil.kt

-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import kotlin.script.templates.standard.ScriptTemplateWithArgs
2525
internal const val KOTLIN_JAVA_STDLIB_JAR = "kotlin-stdlib.jar"
2626
internal const val KOTLIN_JAVA_REFLECT_JAR = "kotlin-reflect.jar"
2727
internal const val KOTLIN_JAVA_SCRIPT_RUNTIME_JAR = "kotlin-script-runtime.jar"
28-
internal const val TROVE4J_JAR = "trove4j.jar"
2928
internal const val KOTLIN_SCRIPTING_COMPILER_JAR = "kotlin-scripting-compiler.jar"
3029
internal const val KOTLIN_SCRIPTING_COMPILER_EMBEDDABLE_JAR = "kotlin-scripting-compiler-embeddable.jar"
3130
internal const val KOTLIN_SCRIPTING_COMPILER_IMPL_JAR = "kotlin-scripting-compiler-impl.jar"
@@ -368,7 +367,6 @@ object KotlinJars {
368367
KOTLIN_JAVA_STDLIB_JAR,
369368
KOTLIN_JAVA_REFLECT_JAR,
370369
KOTLIN_JAVA_SCRIPT_RUNTIME_JAR,
371-
TROVE4J_JAR
372370
)
373371
val kotlinScriptingJars = if (withScripting) listOf(
374372
KOTLIN_SCRIPTING_COMPILER_JAR,

libraries/tools/ide-plugin-dependencies-validator/build.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ dependencies {
1919
runtimeOnly(libs.intellij.fastutil)
2020
runtimeOnly(commonDependency("org.codehaus.woodstox:stax2-api"))
2121
runtimeOnly(commonDependency("com.fasterxml:aalto-xml"))
22-
runtimeOnly(commonDependency("org.jetbrains.intellij.deps:trove4j"))
2322

2423
// test dependencies
2524
testImplementation(platform(libs.junit.bom))

libraries/tools/kotlin-gradle-plugin-integration-tests/build.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ dependencies {
124124
testImplementation(project(path = ":examples:annotation-processor-example"))
125125
testImplementation(kotlinStdlib("jdk8"))
126126
testImplementation(project(":kotlin-parcelize-compiler"))
127-
testImplementation(commonDependency("org.jetbrains.intellij.deps", "trove4j"))
128127
testImplementation(libs.kotlinx.serialization.json)
129128
testImplementation(libs.ktor.client.cio)
130129
testImplementation(libs.ktor.client.mock)

libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/KotlinNativeCompilerDownloadIT.kt

-2
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,12 @@ class KotlinNativeCompilerDownloadIT : KGPBaseTest() {
204204
assertNativeTasksClasspath(":native1:compileKotlin${nativeHostTargetName.capitalize()}") {
205205
val konanLibsPath = customNativeHomePath.resolve(STABLE_VERSION_DIR_NAME).resolve("konan").resolve("lib")
206206
assertContains(it, konanLibsPath.resolve("kotlin-native-compiler-embeddable.jar").absolutePathString())
207-
assertContains(it, konanLibsPath.resolve("trove4j.jar").absolutePathString())
208207
}
209208

210209
// check that in second project we use k/n from default konan location
211210
assertNativeTasksClasspath(":native2:compileKotlin${nativeHostTargetName.capitalize()}") {
212211
val konanLibsPath = defaultKotlinNativeHomePath.resolve(STABLE_VERSION_DIR_NAME).resolve("konan").resolve("lib")
213212
assertContains(it, konanLibsPath.resolve("kotlin-native-compiler-embeddable.jar").absolutePathString())
214-
assertContains(it, konanLibsPath.resolve("trove4j.jar").absolutePathString())
215213
}
216214
}
217215
}

libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/internal/compilerRunner/native/nativeRunnerHelpers.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ internal fun ObjectFactory.nativeCompilerClasspath(
3030
shouldUseEmbeddableCompilerJar: Provider<Boolean>,
3131
) = fileCollection().from(
3232
nativeHomeDirectory.kotlinNativeCompilerJar(shouldUseEmbeddableCompilerJar),
33-
nativeHomeDirectory.map { it.resolve("konan/lib/trove4j.jar") },
33+
nativeHomeDirectory.map { it.resolve("konan/lib/trove4j.jar") }, // for compatibility with K/N < 2.2.0
3434
)
3535

3636
internal fun nativeExecSystemProperties(

0 commit comments

Comments
 (0)