From 8f07a9cc610e572888d647fee0c6aaafb33efeb8 Mon Sep 17 00:00:00 2001 From: Yahor Berdnikau Date: Wed, 18 Jan 2023 13:28:49 +0100 Subject: [PATCH] Cleanup unused Kotlin daemon dependencies --- build.gradle.kts | 11 -------- .../compiler-runner-unshaded/build.gradle.kts | 1 - compiler/daemon/build.gradle.kts | 17 ----------- .../daemon/daemon-client/build.gradle.kts | 8 ------ .../daemon/daemon-common/build.gradle.kts | 3 -- compiler/daemon/daemon-tests/build.gradle.kts | 28 +++++++------------ native/native.tests/build.gradle.kts | 1 + 7 files changed, 11 insertions(+), 58 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index e6c81ed6cf0..8e602fc4d31 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -78,17 +78,6 @@ val ideaSandboxDir = "$commonLocalDataDir/ideaSandbox" val artifactsDir = "$distDir/artifacts" val ideaPluginDir = "$artifactsDir/ideaPlugin/Kotlin" -extra["ktorExcludesForDaemon"] = listOf( - "org.jetbrains.kotlin" to "kotlin-reflect", - "org.jetbrains.kotlin" to "kotlin-stdlib", - "org.jetbrains.kotlin" to "kotlin-stdlib-common", - "org.jetbrains.kotlin" to "kotlin-stdlib-jdk8", - "org.jetbrains.kotlin" to "kotlin-stdlib-jdk7", - "org.jetbrains.kotlinx" to "kotlinx-coroutines-jdk8", - "org.jetbrains.kotlinx" to "kotlinx-coroutines-core", - "org.jetbrains.kotlinx" to "kotlinx-coroutines-core-common" -) - // TODO: use "by extra()" syntax where possible extra["distLibDir"] = project.file(distLibDir) extra["commonLocalDataDir"] = project.file(commonLocalDataDir) diff --git a/compiler/compiler-runner-unshaded/build.gradle.kts b/compiler/compiler-runner-unshaded/build.gradle.kts index e7534604792..dc525eedc51 100644 --- a/compiler/compiler-runner-unshaded/build.gradle.kts +++ b/compiler/compiler-runner-unshaded/build.gradle.kts @@ -7,7 +7,6 @@ plugins { dependencies { implementation(project(":kotlin-daemon-client")) - implementation(commonDependency("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { isTransitive = false } compileOnly(project(":compiler:cli-common")) compileOnly(project(":kotlin-preloader")) diff --git a/compiler/daemon/build.gradle.kts b/compiler/daemon/build.gradle.kts index 518a9bcaafe..21e0646e535 100644 --- a/compiler/daemon/build.gradle.kts +++ b/compiler/daemon/build.gradle.kts @@ -5,22 +5,15 @@ plugins { id("jps-compatible") } -val ktorExcludesForDaemon : List> by rootProject.extra - dependencies { compileOnly(project(":compiler:cli")) - compileOnly(project(":compiler:cli-js")) compileOnly(project(":compiler:incremental-compilation-impl")) - compileOnly(intellijCore()) compileOnly(commonDependency("org.jetbrains.intellij.deps:trove4j")) runtimeOnly(commonDependency("org.jetbrains.kotlin:kotlin-reflect")) { isTransitive = false } embedded(project(":daemon-common")) { isTransitive = false } - api(commonDependency("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { - isTransitive = false - } } optInToExperimentalCompilerApi() @@ -33,15 +26,5 @@ sourceSets { publish() runtimeJar() - sourcesJar() - javadocJar() - -tasks { - val compileKotlin by existing(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class) { - kotlinOptions { - freeCompilerArgs += "-opt-in=kotlinx.coroutines.DelicateCoroutinesApi" - } - } -} diff --git a/compiler/daemon/daemon-client/build.gradle.kts b/compiler/daemon/daemon-client/build.gradle.kts index a02f61fb894..f6714c01d04 100644 --- a/compiler/daemon/daemon-client/build.gradle.kts +++ b/compiler/daemon/daemon-client/build.gradle.kts @@ -22,10 +22,7 @@ val nativePlatformVariants = listOf( ) dependencies { - compileOnly(project(":compiler:util")) - compileOnly(project(":compiler:cli-common")) compileOnly(project(":daemon-common")) - compileOnly(project(":js:js.frontend")) compileOnly(commonDependency("net.rubygrapefruit", "native-platform")) embedded(project(":daemon-common")) { isTransitive = false } @@ -33,9 +30,6 @@ dependencies { nativePlatformVariants.forEach { embedded(commonDependency("net.rubygrapefruit", "native-platform", "-$it")) } - api(commonDependency("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { - isTransitive = false - } } tasks.withType> { @@ -57,7 +51,5 @@ sourceSets { publish() runtimeJar() - sourcesJar() - javadocJar() diff --git a/compiler/daemon/daemon-common/build.gradle.kts b/compiler/daemon/daemon-common/build.gradle.kts index c4fbc0de032..1efee8c06f6 100644 --- a/compiler/daemon/daemon-common/build.gradle.kts +++ b/compiler/daemon/daemon-common/build.gradle.kts @@ -10,9 +10,6 @@ dependencies { api(project(":compiler:cli-common")) api(project(":kotlin-build-common")) api(kotlinStdlib()) - compileOnly(project(":js:js.config")) - compileOnly(intellijCore()) - api(commonDependency("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { isTransitive = false } } sourceSets { diff --git a/compiler/daemon/daemon-tests/build.gradle.kts b/compiler/daemon/daemon-tests/build.gradle.kts index 63817c16a82..6957f22a99f 100644 --- a/compiler/daemon/daemon-tests/build.gradle.kts +++ b/compiler/daemon/daemon-tests/build.gradle.kts @@ -1,4 +1,3 @@ - description = "Kotlin Daemon Tests" plugins { @@ -6,24 +5,13 @@ plugins { id("jps-compatible") } -val ktorExcludesForDaemon: List> by rootProject.extra - dependencies { - testApi(project(":kotlin-test:kotlin-test-jvm")) - testApi(kotlinStdlib()) - testApi(commonDependency("junit:junit")) - testCompileOnly(project(":kotlin-test:kotlin-test-jvm")) - testCompileOnly(project(":kotlin-test:kotlin-test-junit")) - testApi(project(":kotlin-daemon-client")) - testCompileOnly(project(":kotlin-daemon")) - testApi(projectTests(":compiler:tests-common")) - testApi(commonDependency("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { isTransitive = false } - testApi(commonDependency("io.ktor", "ktor-network")) { - ktorExcludesForDaemon.forEach { (group, module) -> - exclude(group = group, module = module) - } - } + testImplementation(kotlinStdlib()) + testImplementation(project(":kotlin-test:kotlin-test-jvm")) testImplementation(project(":kotlin-daemon")) + testImplementation(project(":kotlin-daemon-client")) + testImplementation(commonDependency("junit:junit")) + testImplementation(projectTests(":compiler:tests-common")) testImplementation(intellijCore()) } @@ -35,5 +23,9 @@ sourceSets { projectTest(parallel = true) { dependsOn(":dist") workingDir = rootDir - systemProperty("kotlin.test.script.classpath", testSourceSet.output.classesDirs.joinToString(File.pathSeparator)) + + val testClassesDirs = testSourceSet.output.classesDirs + doFirst { + systemProperty("kotlin.test.script.classpath", testClassesDirs.joinToString(File.pathSeparator)) + } } diff --git a/native/native.tests/build.gradle.kts b/native/native.tests/build.gradle.kts index 97b956cd665..ad20e27af0b 100644 --- a/native/native.tests/build.gradle.kts +++ b/native/native.tests/build.gradle.kts @@ -19,6 +19,7 @@ dependencies { testImplementation(projectTests(":compiler:test-infrastructure")) testImplementation(projectTests(":generators:test-generator")) testApiJUnit5() + testImplementation(commonDependency("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { isTransitive = false } testRuntimeOnly(commonDependency("org.jetbrains.intellij.deps:trove4j")) testRuntimeOnly(commonDependency("org.jetbrains.intellij.deps.fastutil:intellij-deps-fastutil"))