From d2aae67e034b88040cf20790e211b42cfe0f37a9 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Wed, 8 Nov 2023 05:12:24 +0100 Subject: [PATCH] Replace kotlin-test project dependencies in the project Use dependency helper function that chooses whether to take them from the bootstrap repository or from a configuration of kotlin-test KT-61969 --- analysis/analysis-api-fir/build.gradle.kts | 2 +- analysis/analysis-api-impl-barebone/build.gradle.kts | 2 +- analysis/analysis-api-impl-base/build.gradle.kts | 2 +- analysis/analysis-api-standalone/build.gradle.kts | 2 +- analysis/analysis-test-framework/build.gradle.kts | 2 +- analysis/low-level-api-fir/build.gradle.kts | 2 +- compiler/build.gradle.kts | 7 +++---- compiler/container/build.gradle.kts | 3 +-- compiler/daemon/daemon-tests/build.gradle.kts | 2 +- .../fir/analysis-tests/legacy-fir-tests/build.gradle.kts | 3 +-- compiler/fir/fir2ir/build.gradle.kts | 3 +-- compiler/fir/modularized-tests/build.gradle.kts | 3 +-- compiler/fir/raw-fir/light-tree2fir/build.gradle.kts | 3 +-- compiler/fir/raw-fir/psi2fir/build.gradle.kts | 3 +-- compiler/incremental-compilation-impl/build.gradle.kts | 2 +- compiler/tests-common/build.gradle.kts | 2 +- kotlin-native/Interop/StubGenerator/build.gradle.kts | 3 +-- .../endorsedLibraries/kotlinx.cli/build.gradle.kts | 5 ++--- kotlin-native/klib/build.gradle | 2 +- kotlin-native/performance/build.gradle | 8 +++----- .../kotlin-native-compiler-embeddable/build.gradle.kts | 2 +- .../examples/kotlin-gradle-subplugin-example/build.gradle | 2 -- libraries/kotlinx-metadata/jvm/build.gradle.kts | 2 +- libraries/scripting/jvm-host-test/build.gradle.kts | 3 +-- .../tools/binary-compatibility-validator/build.gradle | 2 +- libraries/tools/jdk-api-validator/build.gradle.kts | 2 +- .../tools/kotlin-gradle-build-metrics/build.gradle.kts | 2 +- .../kotlin-gradle-plugin-idea-proto/build.gradle.kts | 2 +- .../tools/kotlin-gradle-plugin-idea/build.gradle.kts | 4 ++-- .../build.gradle.kts | 5 +---- libraries/tools/kotlin-gradle-plugin/build.gradle.kts | 2 +- libraries/tools/kotlin-gradle-statistics/build.gradle.kts | 2 +- libraries/tools/kotlin-tooling-core/build.gradle.kts | 2 +- libraries/tools/kotlin-tooling-metadata/build.gradle.kts | 2 +- native/commonizer-api/build.gradle.kts | 2 +- .../android-extensions-compiler/build.gradle.kts | 2 +- plugins/atomicfu/atomicfu-compiler/build.gradle.kts | 2 +- plugins/parcelize/parcelize-compiler/build.gradle.kts | 2 +- prepare/compiler-client-embeddable/build.gradle.kts | 3 +-- prepare/compiler-embeddable/build.gradle.kts | 2 +- repo/artifacts-tests/build.gradle.kts | 2 +- .../kotlin-gradle-plugin-idea.pom | 2 +- .../buildsrc-compat/src/main/kotlin/repoDependencies.kt | 4 +++- wasm/wasm.ir/build.gradle.kts | 3 +-- 44 files changed, 51 insertions(+), 68 deletions(-) diff --git a/analysis/analysis-api-fir/build.gradle.kts b/analysis/analysis-api-fir/build.gradle.kts index b6b4c71fac3..3a73c4c2cc5 100644 --- a/analysis/analysis-api-fir/build.gradle.kts +++ b/analysis/analysis-api-fir/build.gradle.kts @@ -44,7 +44,7 @@ dependencies { testImplementation(project(":analysis:analysis-api-standalone:analysis-api-fir-standalone-base")) testImplementation(project(":analysis:decompiled:decompiler-to-file-stubs")) testImplementation(project(":analysis:decompiled:decompiler-to-psi")) - testImplementation(project(":kotlin-test:kotlin-test-junit")) + testImplementation(kotlinTest("junit")) testApi(projectTests(":analysis:analysis-test-framework")) testImplementation(toolsJar()) diff --git a/analysis/analysis-api-impl-barebone/build.gradle.kts b/analysis/analysis-api-impl-barebone/build.gradle.kts index a94b04281bf..5d507a450b4 100644 --- a/analysis/analysis-api-impl-barebone/build.gradle.kts +++ b/analysis/analysis-api-impl-barebone/build.gradle.kts @@ -12,7 +12,7 @@ dependencies { testApi(platform(libs.junit.bom)) testImplementation(libs.junit.jupiter.api) testRuntimeOnly(libs.junit.jupiter.engine) - testImplementation(project(":kotlin-test:kotlin-test-junit")) + testImplementation(kotlinTest("junit")) testImplementation(projectTests(":compiler:tests-common")) testApi(projectTests(":compiler:test-infrastructure-utils")) testApi(projectTests(":compiler:test-infrastructure")) diff --git a/analysis/analysis-api-impl-base/build.gradle.kts b/analysis/analysis-api-impl-base/build.gradle.kts index 701378db90b..93a34c19591 100644 --- a/analysis/analysis-api-impl-base/build.gradle.kts +++ b/analysis/analysis-api-impl-base/build.gradle.kts @@ -16,7 +16,7 @@ dependencies { testApi(platform(libs.junit.bom)) testImplementation(libs.junit.jupiter.api) testRuntimeOnly(libs.junit.jupiter.engine) - testImplementation(project(":kotlin-test:kotlin-test-junit")) + testImplementation(kotlinTest("junit")) testImplementation(project(":analysis:analysis-api")) testImplementation(project(":analysis:analysis-api-standalone:analysis-api-standalone-base")) testImplementation(projectTests(":compiler:tests-common")) diff --git a/analysis/analysis-api-standalone/build.gradle.kts b/analysis/analysis-api-standalone/build.gradle.kts index 066cc5873e0..1370d9e3cf0 100644 --- a/analysis/analysis-api-standalone/build.gradle.kts +++ b/analysis/analysis-api-standalone/build.gradle.kts @@ -20,7 +20,7 @@ dependencies { testImplementation(projectTests(":analysis:analysis-api-impl-base")) testImplementation(projectTests(":analysis:analysis-api-fir")) - testImplementation(project(":kotlin-test:kotlin-test-junit")) + testImplementation(kotlinTest("junit")) testImplementation(toolsJar()) testApi(platform(libs.junit.bom)) testImplementation(libs.junit.jupiter.api) diff --git a/analysis/analysis-test-framework/build.gradle.kts b/analysis/analysis-test-framework/build.gradle.kts index 7add75926a0..0684efcc4da 100644 --- a/analysis/analysis-test-framework/build.gradle.kts +++ b/analysis/analysis-test-framework/build.gradle.kts @@ -10,7 +10,7 @@ dependencies { testImplementation(libs.junit.jupiter.api) testRuntimeOnly(libs.junit.jupiter.engine) - testImplementation(project(":kotlin-test:kotlin-test-junit")) + testImplementation(kotlinTest("junit")) testImplementation(project(":analysis:analysis-internal-utils")) testImplementation(project(":compiler:psi")) testImplementation(project(":analysis:kt-references")) diff --git a/analysis/low-level-api-fir/build.gradle.kts b/analysis/low-level-api-fir/build.gradle.kts index bcfce8f7cfa..769344f7785 100644 --- a/analysis/low-level-api-fir/build.gradle.kts +++ b/analysis/low-level-api-fir/build.gradle.kts @@ -50,7 +50,7 @@ dependencies { testImplementation(projectTests(":analysis:analysis-api-impl-barebone")) testImplementation(projectTests(":analysis:analysis-test-framework")) testImplementation(projectTests(":analysis:analysis-api-impl-base")) - testImplementation(project(":kotlin-test:kotlin-test-junit")) + testImplementation(kotlinTest("junit")) testApi(platform(libs.junit.bom)) testImplementation(libs.junit.jupiter.api) testRuntimeOnly(libs.junit.jupiter.engine) diff --git a/compiler/build.gradle.kts b/compiler/build.gradle.kts index a95419f356f..0b0d368660c 100644 --- a/compiler/build.gradle.kts +++ b/compiler/build.gradle.kts @@ -12,13 +12,12 @@ dependencies { testImplementation(intellijCore()) // Should come before compiler, because of "progarded" stuff needed for tests testApi(project(":kotlin-script-runtime")) - testApi(project(":kotlin-test:kotlin-test-jvm")) - + testApi(kotlinStdlib()) + testApi(kotlinTest()) + testCompileOnly(kotlinTest("junit")) testImplementation(libs.junit4) - testCompileOnly(project(":kotlin-test:kotlin-test-jvm")) - testCompileOnly(project(":kotlin-test:kotlin-test-junit")) testApi(projectTests(":compiler:tests-common")) testApi(projectTests(":compiler:tests-common-new")) testApi(projectTests(":compiler:fir:raw-fir:psi2fir")) diff --git a/compiler/container/build.gradle.kts b/compiler/container/build.gradle.kts index da5afea243b..bff55948f8d 100644 --- a/compiler/container/build.gradle.kts +++ b/compiler/container/build.gradle.kts @@ -10,8 +10,7 @@ dependencies { compileOnly(intellijCore()) testApi(kotlinStdlib()) testCompileOnly("org.jetbrains:annotations:13.0") - testApi(project(":kotlin-test:kotlin-test-jvm")) - testApi(project(":kotlin-test:kotlin-test-junit")) + testApi(kotlinTest("junit")) testImplementation(libs.junit4) testCompileOnly(intellijCore()) diff --git a/compiler/daemon/daemon-tests/build.gradle.kts b/compiler/daemon/daemon-tests/build.gradle.kts index 7c6e333ec58..cd1f4d91e9d 100644 --- a/compiler/daemon/daemon-tests/build.gradle.kts +++ b/compiler/daemon/daemon-tests/build.gradle.kts @@ -7,7 +7,7 @@ plugins { dependencies { testImplementation(kotlinStdlib()) - testImplementation(project(":kotlin-test:kotlin-test-jvm")) + testImplementation(kotlinTest("junit")) testImplementation(project(":kotlin-daemon")) testImplementation(project(":kotlin-daemon-client")) testImplementation(libs.junit4) diff --git a/compiler/fir/analysis-tests/legacy-fir-tests/build.gradle.kts b/compiler/fir/analysis-tests/legacy-fir-tests/build.gradle.kts index afcdb1309df..f29e5ac1142 100644 --- a/compiler/fir/analysis-tests/legacy-fir-tests/build.gradle.kts +++ b/compiler/fir/analysis-tests/legacy-fir-tests/build.gradle.kts @@ -14,8 +14,7 @@ dependencies { compileOnly(intellijCore()) testImplementation(libs.junit4) - testCompileOnly(project(":kotlin-test:kotlin-test-jvm")) - testCompileOnly(project(":kotlin-test:kotlin-test-junit")) + testCompileOnly(kotlinTest("junit")) testApi(projectTests(":compiler:tests-common")) testApi(project(":compiler:fir:checkers")) testApi(project(":compiler:fir:checkers:checkers.jvm")) diff --git a/compiler/fir/fir2ir/build.gradle.kts b/compiler/fir/fir2ir/build.gradle.kts index 670e310fa14..af37116eb1b 100644 --- a/compiler/fir/fir2ir/build.gradle.kts +++ b/compiler/fir/fir2ir/build.gradle.kts @@ -21,8 +21,7 @@ dependencies { compileOnly(intellijCore()) - testCompileOnly(project(":kotlin-test:kotlin-test-jvm")) - testCompileOnly(project(":kotlin-test:kotlin-test-junit")) + testCompileOnly(kotlinTest("junit")) testApi(projectTests(":compiler:test-infrastructure")) testApi(projectTests(":compiler:test-infrastructure-utils")) testApi(projectTests(":compiler:tests-compiler-utils")) diff --git a/compiler/fir/modularized-tests/build.gradle.kts b/compiler/fir/modularized-tests/build.gradle.kts index 2879d1e5047..e72d6304211 100644 --- a/compiler/fir/modularized-tests/build.gradle.kts +++ b/compiler/fir/modularized-tests/build.gradle.kts @@ -19,8 +19,7 @@ dependencies { testRuntimeOnly(commonDependency("commons-lang:commons-lang")) testImplementation(libs.junit4) - testCompileOnly(project(":kotlin-test:kotlin-test-jvm")) - testCompileOnly(project(":kotlin-test:kotlin-test-junit")) + testCompileOnly(kotlinTest("junit")) testApi(projectTests(":compiler:tests-common")) testRuntimeOnly(project(":core:descriptors.runtime")) diff --git a/compiler/fir/raw-fir/light-tree2fir/build.gradle.kts b/compiler/fir/raw-fir/light-tree2fir/build.gradle.kts index 13b5bf28033..f0342fd5030 100644 --- a/compiler/fir/raw-fir/light-tree2fir/build.gradle.kts +++ b/compiler/fir/raw-fir/light-tree2fir/build.gradle.kts @@ -26,8 +26,7 @@ dependencies { testImplementation(projectTests(":compiler:tests-common")) testImplementation(projectTests(":compiler:fir:raw-fir:psi2fir")) - testCompileOnly(project(":kotlin-test:kotlin-test-jvm")) - testCompileOnly(project(":kotlin-test:kotlin-test-junit")) + testCompileOnly(kotlinTest("junit")) testRuntimeOnly(project(":core:descriptors.runtime")) diff --git a/compiler/fir/raw-fir/psi2fir/build.gradle.kts b/compiler/fir/raw-fir/psi2fir/build.gradle.kts index b835664cc8d..e54afc6fcea 100644 --- a/compiler/fir/raw-fir/psi2fir/build.gradle.kts +++ b/compiler/fir/raw-fir/psi2fir/build.gradle.kts @@ -22,8 +22,7 @@ dependencies { testImplementation(projectTests(":compiler:tests-common")) testImplementation(commonDependency("org.jetbrains.kotlin:kotlin-reflect")) { isTransitive = false } - testCompileOnly(project(":kotlin-test:kotlin-test-jvm")) - testCompileOnly(project(":kotlin-test:kotlin-test-junit")) + testCompileOnly(kotlinTest("junit")) testRuntimeOnly(project(":core:descriptors.runtime")) diff --git a/compiler/incremental-compilation-impl/build.gradle.kts b/compiler/incremental-compilation-impl/build.gradle.kts index 79954ff2598..128d513cd95 100644 --- a/compiler/incremental-compilation-impl/build.gradle.kts +++ b/compiler/incremental-compilation-impl/build.gradle.kts @@ -23,7 +23,7 @@ dependencies { compileOnly(intellijCore()) testImplementation(libs.junit4) - testApi(project(":kotlin-test:kotlin-test-junit")) + testApi(kotlinTest("junit")) testApi(kotlinStdlib()) testApi(projectTests(":kotlin-build-common")) testApi(projectTests(":compiler:tests-common")) diff --git a/compiler/tests-common/build.gradle.kts b/compiler/tests-common/build.gradle.kts index f64cf02c806..a82b1bc9b58 100644 --- a/compiler/tests-common/build.gradle.kts +++ b/compiler/tests-common/build.gradle.kts @@ -51,7 +51,7 @@ dependencies { testCompileOnly(project(":plugins:android-extensions-compiler")) testApi(projectTests(":generators:test-generator")) testApi(projectTests(":compiler:tests-compiler-utils")) - testApi(project(":kotlin-test:kotlin-test-jvm")) + testApi(kotlinTest()) testApi(project(":kotlin-scripting-compiler-impl")) testApi(projectTests(":compiler:test-infrastructure-utils")) testApi(libs.junit4) // for ComparisonFailure diff --git a/kotlin-native/Interop/StubGenerator/build.gradle.kts b/kotlin-native/Interop/StubGenerator/build.gradle.kts index cc1247c679c..e4e064d023f 100644 --- a/kotlin-native/Interop/StubGenerator/build.gradle.kts +++ b/kotlin-native/Interop/StubGenerator/build.gradle.kts @@ -39,8 +39,7 @@ dependencies { implementation(project(":compiler:util")) implementation(project(":compiler:ir.serialization.common")) - testImplementation(kotlin("test-junit")) - testImplementation(project(":kotlin-test:kotlin-test-junit")) + testImplementation(kotlinTest("junit")) } tasks { diff --git a/kotlin-native/endorsedLibraries/kotlinx.cli/build.gradle.kts b/kotlin-native/endorsedLibraries/kotlinx.cli/build.gradle.kts index 7460341d7c6..48fa4a403e1 100644 --- a/kotlin-native/endorsedLibraries/kotlinx.cli/build.gradle.kts +++ b/kotlin-native/endorsedLibraries/kotlinx.cli/build.gradle.kts @@ -15,8 +15,7 @@ kotlin { commonTest { dependencies { // projectOrFiles is required for the performance project that includes kotlinx.cli compositely - projectOrFiles(project, ":kotlin-test:kotlin-test-common")?.let { implementation(it) } - projectOrFiles(project, ":kotlin-test:kotlin-test-annotations-common")?.let { implementation(it) } + projectOrFiles(project, ":kotlin-test")?.let { implementation(it) } } kotlin.srcDir("src/tests") } @@ -30,7 +29,7 @@ kotlin { // JVM-specific tests and their dependencies: compilations["test"].defaultSourceSet { dependencies { - implementation(project(":kotlin-test:kotlin-test-junit")) + implementation(kotlinTest("junit")) } } diff --git a/kotlin-native/klib/build.gradle b/kotlin-native/klib/build.gradle index b6d13b56c16..cd397a3839b 100644 --- a/kotlin-native/klib/build.gradle +++ b/kotlin-native/klib/build.gradle @@ -24,7 +24,7 @@ dependencies { implementation project(path: ':kotlin-native:backend.native', configuration: 'cli_bcApiElements') implementation project(":kotlin-native:utilities:basic-utils") testImplementation libs.junit4 - testImplementation project(":kotlin-test:kotlin-test-junit") + testImplementation RepoDependencies.kotlinTest(project, "junit") } test { diff --git a/kotlin-native/performance/build.gradle b/kotlin-native/performance/build.gradle index a957fb65685..b25c6d2cf04 100644 --- a/kotlin-native/performance/build.gradle +++ b/kotlin-native/performance/build.gradle @@ -47,11 +47,9 @@ def platformManager = new PlatformManager(DistributionKt.buildDistribution(Utils def kotlinDist = null if (hasProperty("kotlin_dist")) { kotlinDist = file(findProperty("kotlin_dist")) - ext["notationMapping"] = [':kotlin-stdlib-common' : project.file("${kotlinDist}/kotlinc/lib/kotlin-stdlib.jar").absolutePath, - ':kotlin-test:kotlin-test-common' : project.file("${kotlinDist}/kotlinc/lib/kotlin-test.jar").absolutePath, - ':kotlin-test:kotlin-test-annotations-common': project.file("${kotlinDist}/kotlinc/lib/kotlin-test.jar").absolutePath, - ':kotlin-test:kotlin-test-junit' : project.file("${kotlinDist}/kotlinc/lib/kotlin-test-junit.jar").absolutePath, - ':kotlin-stdlib-jdk8' : project.file("${kotlinDist}/kotlinc/lib/kotlin-stdlib-jdk8.jar").absolutePath] + ext["notationMapping"] = [':kotlin-stdlib-common' : project.file("${kotlinDist}/kotlinc/lib/kotlin-stdlib.jar").absolutePath, + ':kotlin-test' : project.file("${kotlinDist}/kotlinc/lib/kotlin-test.jar").absolutePath, + ':kotlin-stdlib-jdk8' : project.file("${kotlinDist}/kotlinc/lib/kotlin-stdlib-jdk8.jar").absolutePath] ext.targetList = [] } diff --git a/kotlin-native/prepare/kotlin-native-compiler-embeddable/build.gradle.kts b/kotlin-native/prepare/kotlin-native-compiler-embeddable/build.gradle.kts index 8b6fccef813..9ed40ba330a 100644 --- a/kotlin-native/prepare/kotlin-native-compiler-embeddable/build.gradle.kts +++ b/kotlin-native/prepare/kotlin-native-compiler-embeddable/build.gradle.kts @@ -56,7 +56,7 @@ dependencies { kotlinNativeJavadoc(project(":kotlin-native:backend.native")) testImplementation(libs.junit4) - testImplementation(project(":kotlin-test:kotlin-test-junit")) + testImplementation(kotlinTest("junit")) } val compiler = embeddableCompiler("kotlin-native-compiler-embeddable") { diff --git a/libraries/examples/kotlin-gradle-subplugin-example/build.gradle b/libraries/examples/kotlin-gradle-subplugin-example/build.gradle index e3a67e0f19d..b808c0e1e1c 100644 --- a/libraries/examples/kotlin-gradle-subplugin-example/build.gradle +++ b/libraries/examples/kotlin-gradle-subplugin-example/build.gradle @@ -17,8 +17,6 @@ dependencies { // Use this dependency instead when building apart from the other modules: // compile "org.jetbrains.kotlin:kotlin-gradle-plugin-api:$kotlin_version" - api project(':kotlin-test:kotlin-test-junit') - compileOnly RepoDependencies.kotlinStdlib(project) compileOnly project(':compiler') compileOnly project(':compiler:plugin-api') diff --git a/libraries/kotlinx-metadata/jvm/build.gradle.kts b/libraries/kotlinx-metadata/jvm/build.gradle.kts index 2e24f9624f9..dbeefc1a0ed 100644 --- a/libraries/kotlinx-metadata/jvm/build.gradle.kts +++ b/libraries/kotlinx-metadata/jvm/build.gradle.kts @@ -44,7 +44,7 @@ dependencies { embedded(project(":core:metadata")) embedded(project(":core:metadata.jvm")) embedded(protobufLite()) - testImplementation(project(":kotlin-test:kotlin-test-junit")) + testImplementation(kotlinTest("junit")) testImplementation(libs.junit4) testImplementation(commonDependency("org.jetbrains.intellij.deps:asm-all")) testImplementation(commonDependency("org.jetbrains.kotlin:kotlin-reflect")) { isTransitive = false } diff --git a/libraries/scripting/jvm-host-test/build.gradle.kts b/libraries/scripting/jvm-host-test/build.gradle.kts index c4212c18841..e87c55ba101 100644 --- a/libraries/scripting/jvm-host-test/build.gradle.kts +++ b/libraries/scripting/jvm-host-test/build.gradle.kts @@ -25,8 +25,7 @@ dependencies { testRuntimeOnly(commonDependency("org.jetbrains.intellij.deps", "trove4j")) embeddableTestRuntime(project(":kotlin-scripting-jvm-host")) - embeddableTestRuntime(project(":kotlin-test:kotlin-test-jvm")) - embeddableTestRuntime(project(":kotlin-test:kotlin-test-junit")) + embeddableTestRuntime(kotlinTest("junit")) embeddableTestRuntime(projectTests(":compiler:tests-common")) { isTransitive = false } embeddableTestRuntime(testSourceSet.output) } diff --git a/libraries/tools/binary-compatibility-validator/build.gradle b/libraries/tools/binary-compatibility-validator/build.gradle index ad654476266..71b9bbc049d 100644 --- a/libraries/tools/binary-compatibility-validator/build.gradle +++ b/libraries/tools/binary-compatibility-validator/build.gradle @@ -8,7 +8,7 @@ dependencies { api("org.jetbrains.kotlinx:binary-compatibility-validator:0.13.0") api("org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.7.0") - testApi project(':kotlin-test:kotlin-test-junit') + testApi RepoDependencies.kotlinTest(project, "junit") testArtifacts project(':kotlin-stdlib') testArtifacts project(':kotlin-stdlib-jdk7') diff --git a/libraries/tools/jdk-api-validator/build.gradle.kts b/libraries/tools/jdk-api-validator/build.gradle.kts index 10c28b246e5..e33b24f1d4e 100644 --- a/libraries/tools/jdk-api-validator/build.gradle.kts +++ b/libraries/tools/jdk-api-validator/build.gradle.kts @@ -18,7 +18,7 @@ dependencies { implementation("org.codehaus.mojo:animal-sniffer:1.21") implementation(kotlinStdlib()) - testImplementation(project(":kotlin-test:kotlin-test-junit")) + testImplementation(kotlinTest("junit")) testArtifacts(project(":kotlin-reflect")) diff --git a/libraries/tools/kotlin-gradle-build-metrics/build.gradle.kts b/libraries/tools/kotlin-gradle-build-metrics/build.gradle.kts index f761a650ad7..81a2f737d01 100644 --- a/libraries/tools/kotlin-gradle-build-metrics/build.gradle.kts +++ b/libraries/tools/kotlin-gradle-build-metrics/build.gradle.kts @@ -17,7 +17,7 @@ extensions.extraProperties["kotlin.stdlib.default.dependency"] = "false" dependencies { compileOnly(kotlinStdlib()) - testImplementation(project(":kotlin-test:kotlin-test-junit")) + testImplementation(kotlinTest("junit")) testImplementation(libs.junit4) } diff --git a/libraries/tools/kotlin-gradle-plugin-idea-proto/build.gradle.kts b/libraries/tools/kotlin-gradle-plugin-idea-proto/build.gradle.kts index 9fc4acd8992..f805f347950 100644 --- a/libraries/tools/kotlin-gradle-plugin-idea-proto/build.gradle.kts +++ b/libraries/tools/kotlin-gradle-plugin-idea-proto/build.gradle.kts @@ -25,7 +25,7 @@ dependencies { api(project(":kotlin-gradle-plugin-idea")) embedded("com.google.protobuf:protobuf-java:3.21.9") embedded("com.google.protobuf:protobuf-kotlin:3.21.9") - testImplementation(project(":kotlin-test:kotlin-test-junit")) + testImplementation(kotlinTest("junit")) testImplementation(kotlin("reflect")) testImplementation(testFixtures(project(":kotlin-gradle-plugin-idea"))) } diff --git a/libraries/tools/kotlin-gradle-plugin-idea/build.gradle.kts b/libraries/tools/kotlin-gradle-plugin-idea/build.gradle.kts index 3cb69cf7a46..37ecef94256 100644 --- a/libraries/tools/kotlin-gradle-plugin-idea/build.gradle.kts +++ b/libraries/tools/kotlin-gradle-plugin-idea/build.gradle.kts @@ -30,7 +30,7 @@ dependencies { testImplementation(gradleKotlinDsl()) testImplementation(project(":kotlin-gradle-plugin")) testImplementation(project(":kotlin-gradle-plugin-idea-proto")) - testImplementation(project(":kotlin-test:kotlin-test-junit")) + testImplementation(kotlinTest("junit")) testImplementation("org.reflections:reflections:0.10.2") { because("Tests on the object graph are performed. This library will find implementations of interfaces at runtime") @@ -40,7 +40,7 @@ dependencies { testFixturesImplementation(gradleKotlinDsl()) testFixturesImplementation(project(":kotlin-tooling-core")) testFixturesImplementation(project(":kotlin-gradle-plugin-idea-proto")) - testFixturesImplementation(project(":kotlin-test:kotlin-test-junit")) + testFixturesImplementation(kotlinTest()) // no test annotations, only assertions are needed } diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/build.gradle.kts b/libraries/tools/kotlin-gradle-plugin-integration-tests/build.gradle.kts index 2dce94ef7cb..835d43b1984 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/build.gradle.kts +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/build.gradle.kts @@ -63,7 +63,7 @@ dependencies { testImplementation(project(":kotlin-tooling-metadata")) testImplementation(kotlinGradlePluginTest) testImplementation(project(":kotlin-gradle-subplugin-example")) - testImplementation(project(":kotlin-test:kotlin-test-jvm")) + testImplementation(kotlinTest("junit")) testImplementation(project(":kotlin-util-klib")) testImplementation(project(":native:kotlin-native-utils")) @@ -100,9 +100,6 @@ dependencies { testRuntimeOnly(project(":compiler:tests-mutes")) - // Workaround for missing transitive import of the common(project `kotlin-test-common` - // for `kotlin-test-jvm` into the IDE: - testCompileOnly(project(":kotlin-test:kotlin-test-common")) { isTransitive = false } testCompileOnly(commonDependency("org.jetbrains.intellij.deps:asm-all")) } diff --git a/libraries/tools/kotlin-gradle-plugin/build.gradle.kts b/libraries/tools/kotlin-gradle-plugin/build.gradle.kts index dcdfc0153f5..1647dab2144 100644 --- a/libraries/tools/kotlin-gradle-plugin/build.gradle.kts +++ b/libraries/tools/kotlin-gradle-plugin/build.gradle.kts @@ -120,7 +120,7 @@ dependencies { testImplementation(commonDependency("org.jetbrains.teamcity:serviceMessages")) testImplementation(projectTests(":kotlin-build-common")) testImplementation(project(":kotlin-compiler-runner")) - testImplementation(project(":kotlin-test:kotlin-test-junit")) + testImplementation(kotlinTest("junit")) testImplementation(libs.junit4) testImplementation(project(":kotlin-gradle-statistics")) testImplementation(project(":kotlin-tooling-metadata")) diff --git a/libraries/tools/kotlin-gradle-statistics/build.gradle.kts b/libraries/tools/kotlin-gradle-statistics/build.gradle.kts index f761a650ad7..81a2f737d01 100644 --- a/libraries/tools/kotlin-gradle-statistics/build.gradle.kts +++ b/libraries/tools/kotlin-gradle-statistics/build.gradle.kts @@ -17,7 +17,7 @@ extensions.extraProperties["kotlin.stdlib.default.dependency"] = "false" dependencies { compileOnly(kotlinStdlib()) - testImplementation(project(":kotlin-test:kotlin-test-junit")) + testImplementation(kotlinTest("junit")) testImplementation(libs.junit4) } diff --git a/libraries/tools/kotlin-tooling-core/build.gradle.kts b/libraries/tools/kotlin-tooling-core/build.gradle.kts index 7b305f2cdc9..e9e475a1349 100644 --- a/libraries/tools/kotlin-tooling-core/build.gradle.kts +++ b/libraries/tools/kotlin-tooling-core/build.gradle.kts @@ -12,7 +12,7 @@ configureKotlinCompileTasksGradleCompatibility() dependencies { api(platform(project(":kotlin-gradle-plugins-bom"))) compileOnly(kotlinStdlib()) - testImplementation(project(":kotlin-test:kotlin-test-junit")) + testImplementation(kotlinTest("junit")) } tasks { diff --git a/libraries/tools/kotlin-tooling-metadata/build.gradle.kts b/libraries/tools/kotlin-tooling-metadata/build.gradle.kts index e0c6285f12b..da7bab5c637 100644 --- a/libraries/tools/kotlin-tooling-metadata/build.gradle.kts +++ b/libraries/tools/kotlin-tooling-metadata/build.gradle.kts @@ -12,5 +12,5 @@ configureKotlinCompileTasksGradleCompatibility() dependencies { implementation(kotlinStdlib()) implementation(commonDependency("com.google.code.gson:gson")) - testImplementation(project(":kotlin-test:kotlin-test-junit")) + testImplementation(kotlinTest("junit")) } diff --git a/native/commonizer-api/build.gradle.kts b/native/commonizer-api/build.gradle.kts index d6b85b54feb..82034d54006 100644 --- a/native/commonizer-api/build.gradle.kts +++ b/native/commonizer-api/build.gradle.kts @@ -12,7 +12,7 @@ publish() dependencies { implementation(kotlinStdlib()) implementation(project(":native:kotlin-native-utils")) - testImplementation(project(":kotlin-test::kotlin-test-junit")) + testImplementation(kotlinTest("junit")) testImplementation(libs.junit4) testImplementation(projectTests(":compiler:tests-common")) testRuntimeOnly(project(":native:kotlin-klib-commonizer")) diff --git a/plugins/android-extensions/android-extensions-compiler/build.gradle.kts b/plugins/android-extensions/android-extensions-compiler/build.gradle.kts index fb0a1a0e4d5..aa202b6fc35 100644 --- a/plugins/android-extensions/android-extensions-compiler/build.gradle.kts +++ b/plugins/android-extensions/android-extensions-compiler/build.gradle.kts @@ -36,7 +36,7 @@ dependencies { testApi(project(":compiler:cli")) testApi(project(":kotlin-android-extensions-runtime")) testApi(projectTests(":compiler:tests-common")) - testApi(project(":kotlin-test:kotlin-test-jvm")) + testApi(kotlinTest("junit")) testImplementation(libs.junit4) robolectricDependency("org.robolectric:android-all:5.0.2_r3-robolectric-r0") diff --git a/plugins/atomicfu/atomicfu-compiler/build.gradle.kts b/plugins/atomicfu/atomicfu-compiler/build.gradle.kts index 451f61d73ab..5f5ed1eb5fb 100644 --- a/plugins/atomicfu/atomicfu-compiler/build.gradle.kts +++ b/plugins/atomicfu/atomicfu-compiler/build.gradle.kts @@ -84,7 +84,7 @@ dependencies { testImplementation(projectTests(":js:js.tests")) testImplementation(libs.junit4) - testApi(project(":kotlin-test:kotlin-test-jvm")) + testApi(kotlinTest()) // Dependencies for Kotlin/Native test infra: if (!kotlinBuildProperties.isInIdeaSync) { diff --git a/plugins/parcelize/parcelize-compiler/build.gradle.kts b/plugins/parcelize/parcelize-compiler/build.gradle.kts index e99da753507..eb1f12fc856 100644 --- a/plugins/parcelize/parcelize-compiler/build.gradle.kts +++ b/plugins/parcelize/parcelize-compiler/build.gradle.kts @@ -34,7 +34,7 @@ dependencies { testApi(project(":compiler:cli")) testApi(project(":plugins:parcelize:parcelize-runtime")) testApi(project(":kotlin-android-extensions-runtime")) - testApi(project(":kotlin-test:kotlin-test-jvm")) + testApi(kotlinTest()) testApi(projectTests(":compiler:tests-common-new")) testApi(projectTests(":compiler:test-infrastructure")) diff --git a/prepare/compiler-client-embeddable/build.gradle.kts b/prepare/compiler-client-embeddable/build.gradle.kts index d5088310f1c..7d2aa631913 100644 --- a/prepare/compiler-client-embeddable/build.gradle.kts +++ b/prepare/compiler-client-embeddable/build.gradle.kts @@ -22,8 +22,7 @@ dependencies { testApi(project(":daemon-common")) testApi(project(":kotlin-daemon-client")) testImplementation(libs.junit4) - testApi(project(":kotlin-test:kotlin-test-jvm")) - testApi(project(":kotlin-test:kotlin-test-junit")) + testApi(kotlinTest("junit")) testCompilerClasspath(project(":kotlin-compiler")) testCompilerClasspath(commonDependency("org.jetbrains.intellij.deps", "trove4j")) testCompilerClasspath(project(":kotlin-scripting-compiler")) diff --git a/prepare/compiler-embeddable/build.gradle.kts b/prepare/compiler-embeddable/build.gradle.kts index f82c300566a..b8e9c5344ce 100644 --- a/prepare/compiler-embeddable/build.gradle.kts +++ b/prepare/compiler-embeddable/build.gradle.kts @@ -23,7 +23,7 @@ dependencies { runtimeOnly(project(":kotlin-daemon-embeddable")) runtimeOnly(commonDependency("org.jetbrains.intellij.deps", "trove4j")) testImplementation(libs.junit4) - testApi(project(":kotlin-test:kotlin-test-junit")) + testApi(kotlinTest("junit")) testCompilationClasspath(kotlinStdlib()) } diff --git a/repo/artifacts-tests/build.gradle.kts b/repo/artifacts-tests/build.gradle.kts index 1bdef287f96..fae9dc4d560 100644 --- a/repo/artifacts-tests/build.gradle.kts +++ b/repo/artifacts-tests/build.gradle.kts @@ -4,7 +4,7 @@ plugins { dependencies { testImplementation(kotlinStdlib("jdk8")) - testImplementation(project(":kotlin-test:kotlin-test-junit5")) + testImplementation(kotlinTest("junit5")) testApi(platform(libs.junit.bom)) testImplementation(libs.junit.jupiter.api) testRuntimeOnly(libs.junit.jupiter.engine) diff --git a/repo/artifacts-tests/src/test/resources/org/jetbrains/kotlin/kotlin-gradle-plugin-idea/kotlin-gradle-plugin-idea.pom b/repo/artifacts-tests/src/test/resources/org/jetbrains/kotlin/kotlin-gradle-plugin-idea/kotlin-gradle-plugin-idea.pom index 365a7972d30..fbe851013b5 100644 --- a/repo/artifacts-tests/src/test/resources/org/jetbrains/kotlin/kotlin-gradle-plugin-idea/kotlin-gradle-plugin-idea.pom +++ b/repo/artifacts-tests/src/test/resources/org/jetbrains/kotlin/kotlin-gradle-plugin-idea/kotlin-gradle-plugin-idea.pom @@ -52,7 +52,7 @@ org.jetbrains.kotlin - kotlin-test-junit + kotlin-test ArtifactsTest.version runtime true diff --git a/repo/gradle-build-conventions/buildsrc-compat/src/main/kotlin/repoDependencies.kt b/repo/gradle-build-conventions/buildsrc-compat/src/main/kotlin/repoDependencies.kt index d69c7b2cef4..1fff13bbd0c 100644 --- a/repo/gradle-build-conventions/buildsrc-compat/src/main/kotlin/repoDependencies.kt +++ b/repo/gradle-build-conventions/buildsrc-compat/src/main/kotlin/repoDependencies.kt @@ -74,7 +74,9 @@ fun Project.kotlinStdlib(suffix: String? = null, classifier: String? = null): An */ @JvmOverloads fun Project.kotlinTest(suffix: String? = null, classifier: String? = null): Any { - return run { + return if (kotlinBuildProperties.isJpsBuildEnabled) { + kotlinDep(listOfNotNull("test", suffix?.lowercase()).joinToString("-"), bootstrapKotlinVersion, classifier) + } else { val elementsType = when (classifier) { null -> "Runtime" "sources" -> "Sources" diff --git a/wasm/wasm.ir/build.gradle.kts b/wasm/wasm.ir/build.gradle.kts index 3bad93eaa91..7c8130981e3 100644 --- a/wasm/wasm.ir/build.gradle.kts +++ b/wasm/wasm.ir/build.gradle.kts @@ -55,8 +55,7 @@ dependencies { implementation(kotlinStdlib()) implementation(kotlinxCollectionsImmutable()) testImplementation(libs.junit4) - testCompileOnly(project(":kotlin-test:kotlin-test-jvm")) - testCompileOnly(project(":kotlin-test:kotlin-test-junit")) + testCompileOnly(kotlinTest("junit")) testImplementation(projectTests(":compiler:tests-common")) testImplementation(commonDependency("org.jetbrains.kotlinx", "kotlinx-serialization-json"))