From 6f96be0b761456bbf2f1213da32308c74e435c9d Mon Sep 17 00:00:00 2001 From: "Alexander.Likhachev" Date: Wed, 23 Aug 2023 18:44:47 +0200 Subject: [PATCH] [Build] Get rid of the `testApiJUnit5` method #KTI-1349 In Progress --- analysis/analysis-api-fe10/build.gradle.kts | 4 ++- analysis/analysis-api-fir/build.gradle.kts | 4 ++- .../build.gradle.kts | 4 ++- .../analysis-api-impl-base/build.gradle.kts | 4 ++- .../analysis-api-standalone/build.gradle.kts | 4 ++- .../analysis-test-framework/build.gradle.kts | 4 ++- analysis/low-level-api-fir/build.gradle.kts | 4 ++- build-common/build.gradle.kts | 4 ++- .../kotlin-build-tools-api/build.gradle.kts | 4 ++- compiler/fir/analysis-tests/build.gradle.kts | 4 ++- compiler/fir/fir2ir/build.gradle.kts | 4 ++- compiler/tests-common-new/build.gradle.kts | 5 ++- compiler/tests-common/build.gradle.kts | 4 ++- compiler/tests-different-jdk/build.gradle.kts | 4 ++- .../build.gradle.kts | 4 ++- compiler/tests-java8/build.gradle.kts | 2 ++ compiler/tests-spec/build.gradle.kts | 5 ++- compiler/util-klib-abi/build.gradle.kts | 4 ++- compiler/util/build.gradle.kts | 2 ++ compiler/visualizer/build.gradle.kts | 4 ++- core/descriptors.runtime/build.gradle.kts | 2 ++ .../analysis-api-generator/build.gradle.kts | 4 ++- generators/build.gradle.kts | 4 ++- generators/test-generator/build.gradle.kts | 4 ++- js/js.tests/build.gradle.kts | 4 ++- .../build.gradle.kts | 4 ++- native/native.tests/build.gradle.kts | 4 ++- native/utils/build.gradle.kts | 4 ++- plugins/allopen/build.gradle.kts | 4 ++- .../atomicfu-compiler/build.gradle.kts | 4 ++- plugins/fir-plugin-prototype/build.gradle.kts | 4 ++- plugins/imports-dumper/build.gradle.kts | 2 ++ plugins/kapt3/kapt3-base/build.gradle.kts | 4 ++- plugins/kapt3/kapt3-cli/build.gradle.kts | 4 ++- plugins/kapt3/kapt3-compiler/build.gradle.kts | 4 ++- plugins/kapt4/build.gradle.kts | 4 ++- .../kotlinx-serialization/build.gradle.kts | 4 ++- plugins/noarg/build.gradle.kts | 4 ++- .../parcelize-compiler/build.gradle.kts | 4 ++- plugins/sam-with-receiver/build.gradle.kts | 4 ++- repo/artifacts-tests/build.gradle.kts | 4 ++- repo/codebase-tests/build.gradle.kts | 2 ++ .../src/main/kotlin/repoDependencies.kt | 32 ------------------- wasm/wasm.tests/build.gradle.kts | 2 +- 44 files changed, 124 insertions(+), 70 deletions(-) diff --git a/analysis/analysis-api-fe10/build.gradle.kts b/analysis/analysis-api-fe10/build.gradle.kts index 94b697f046d..ab621c6fbda 100644 --- a/analysis/analysis-api-fe10/build.gradle.kts +++ b/analysis/analysis-api-fe10/build.gradle.kts @@ -18,7 +18,9 @@ dependencies { implementation(project(":compiler:backend.jvm")) implementation(project(":compiler:backend.jvm.entrypoint")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testImplementation(project(":analysis:analysis-api-providers")) testImplementation(project(":analysis:analysis-api-standalone:analysis-api-standalone-base")) testImplementation(projectTests(":compiler:tests-common")) diff --git a/analysis/analysis-api-fir/build.gradle.kts b/analysis/analysis-api-fir/build.gradle.kts index 247af117bf9..123e3e67194 100644 --- a/analysis/analysis-api-fir/build.gradle.kts +++ b/analysis/analysis-api-fir/build.gradle.kts @@ -48,7 +48,9 @@ dependencies { testApi(projectTests(":analysis:analysis-test-framework")) testImplementation(toolsJar()) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testImplementation(project(":analysis:symbol-light-classes")) } diff --git a/analysis/analysis-api-impl-barebone/build.gradle.kts b/analysis/analysis-api-impl-barebone/build.gradle.kts index 5de5a586d8a..65e0dcb0c35 100644 --- a/analysis/analysis-api-impl-barebone/build.gradle.kts +++ b/analysis/analysis-api-impl-barebone/build.gradle.kts @@ -9,7 +9,9 @@ dependencies { api(project(":analysis:project-structure")) api(intellijCore()) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testImplementation(project(":kotlin-test:kotlin-test-junit")) testImplementation(projectTests(":compiler:tests-common")) testApi(projectTests(":compiler:test-infrastructure-utils")) diff --git a/analysis/analysis-api-impl-base/build.gradle.kts b/analysis/analysis-api-impl-base/build.gradle.kts index 8d844132a70..30a63529af3 100644 --- a/analysis/analysis-api-impl-base/build.gradle.kts +++ b/analysis/analysis-api-impl-base/build.gradle.kts @@ -13,7 +13,9 @@ dependencies { api(intellijCore()) implementation(project(":analysis:analysis-internal-utils")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testImplementation(project(":kotlin-test:kotlin-test-junit")) testImplementation(project(":analysis:analysis-api")) testImplementation(project(":analysis:analysis-api-standalone:analysis-api-standalone-base")) diff --git a/analysis/analysis-api-standalone/build.gradle.kts b/analysis/analysis-api-standalone/build.gradle.kts index 86dfef53677..e700858f77a 100644 --- a/analysis/analysis-api-standalone/build.gradle.kts +++ b/analysis/analysis-api-standalone/build.gradle.kts @@ -22,7 +22,9 @@ dependencies { testImplementation(project(":kotlin-test:kotlin-test-junit")) testImplementation(toolsJar()) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) } kotlin { diff --git a/analysis/analysis-test-framework/build.gradle.kts b/analysis/analysis-test-framework/build.gradle.kts index d452097cea7..665ba64dbda 100644 --- a/analysis/analysis-test-framework/build.gradle.kts +++ b/analysis/analysis-test-framework/build.gradle.kts @@ -6,7 +6,9 @@ plugins { dependencies { testImplementation(kotlinStdlib()) testImplementation(intellijCore()) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testImplementation(project(":kotlin-test:kotlin-test-junit")) testImplementation(project(":analysis:analysis-internal-utils")) diff --git a/analysis/low-level-api-fir/build.gradle.kts b/analysis/low-level-api-fir/build.gradle.kts index dd25be19caf..b4248a16b43 100644 --- a/analysis/low-level-api-fir/build.gradle.kts +++ b/analysis/low-level-api-fir/build.gradle.kts @@ -50,7 +50,9 @@ dependencies { testImplementation(projectTests(":analysis:analysis-test-framework")) testImplementation(projectTests(":analysis:analysis-api-impl-base")) testImplementation(project(":kotlin-test:kotlin-test-junit")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testImplementation(project(":analysis:symbol-light-classes")) testRuntimeOnly(project(":core:descriptors.runtime")) diff --git a/build-common/build.gradle.kts b/build-common/build.gradle.kts index a39b3cfa3b2..bc267b73429 100644 --- a/build-common/build.gradle.kts +++ b/build-common/build.gradle.kts @@ -23,7 +23,9 @@ dependencies { testCompileOnly(project(":compiler:cli-common")) testApi(projectTests(":compiler:tests-common")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testImplementation(libs.junit.jupyter.params) testImplementation(libs.junit4) testApi(protobufFull()) diff --git a/compiler/build-tools/kotlin-build-tools-api/build.gradle.kts b/compiler/build-tools/kotlin-build-tools-api/build.gradle.kts index af48bb31dc3..ffc6349252e 100644 --- a/compiler/build-tools/kotlin-build-tools-api/build.gradle.kts +++ b/compiler/build-tools/kotlin-build-tools-api/build.gradle.kts @@ -10,7 +10,9 @@ configureKotlinCompileTasksGradleCompatibility() dependencies { compileOnly(kotlinStdlib()) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testImplementation(kotlinStdlib()) } diff --git a/compiler/fir/analysis-tests/build.gradle.kts b/compiler/fir/analysis-tests/build.gradle.kts index 999058ac095..1aa63834359 100644 --- a/compiler/fir/analysis-tests/build.gradle.kts +++ b/compiler/fir/analysis-tests/build.gradle.kts @@ -26,7 +26,9 @@ dependencies { testApi(project(":compiler:fir:entrypoint")) testApi(project(":compiler:frontend")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testRuntimeOnly(project(":core:descriptors.runtime")) testRuntimeOnly(project(":compiler:fir:fir2ir:jvm-backend")) diff --git a/compiler/fir/fir2ir/build.gradle.kts b/compiler/fir/fir2ir/build.gradle.kts index 848f95a86f7..7f0645ab456 100644 --- a/compiler/fir/fir2ir/build.gradle.kts +++ b/compiler/fir/fir2ir/build.gradle.kts @@ -29,7 +29,9 @@ dependencies { testApi(projectTests(":compiler:tests-common-new")) testApi(projectTests(":compiler:fir:analysis-tests")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testRuntimeOnly(project(":core:deserialization")) testRuntimeOnly(project(":core:descriptors.runtime")) diff --git a/compiler/tests-common-new/build.gradle.kts b/compiler/tests-common-new/build.gradle.kts index b9385efe77a..2d08e549cc5 100644 --- a/compiler/tests-common-new/build.gradle.kts +++ b/compiler/tests-common-new/build.gradle.kts @@ -18,7 +18,10 @@ dependencies { testImplementation(projectTests(":generators:test-generator")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) + testApi(libs.junit.platform.launcher) testApi(projectTests(":compiler:test-infrastructure")) testApi(projectTests(":compiler:test-infrastructure-utils")) testApi(projectTests(":compiler:tests-compiler-utils")) diff --git a/compiler/tests-common/build.gradle.kts b/compiler/tests-common/build.gradle.kts index aa47cb94ac1..a94becdfd58 100644 --- a/compiler/tests-common/build.gradle.kts +++ b/compiler/tests-common/build.gradle.kts @@ -81,7 +81,9 @@ dependencies { testImplementation(commonDependency("org.jetbrains.intellij.deps:log4j")) testImplementation(commonDependency("org.jetbrains.intellij.deps:jdom")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) } optInToExperimentalCompilerApi() diff --git a/compiler/tests-different-jdk/build.gradle.kts b/compiler/tests-different-jdk/build.gradle.kts index 3e0b3f620cc..1fcc8828236 100644 --- a/compiler/tests-different-jdk/build.gradle.kts +++ b/compiler/tests-different-jdk/build.gradle.kts @@ -10,7 +10,9 @@ dependencies { testApi(projectTests(":compiler:tests-compiler-utils")) testApi(projectTests(":compiler:tests-common-new")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testImplementation(libs.junit.platform.runner) testImplementation(libs.junit.platform.suite.api) runtimeOnly(libs.junit.vintage.engine) diff --git a/compiler/tests-for-compiler-generator/build.gradle.kts b/compiler/tests-for-compiler-generator/build.gradle.kts index 232c6207250..b2dba530723 100644 --- a/compiler/tests-for-compiler-generator/build.gradle.kts +++ b/compiler/tests-for-compiler-generator/build.gradle.kts @@ -6,7 +6,9 @@ plugins { dependencies { testImplementation(kotlinStdlib()) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testImplementation(projectTests(":compiler:tests-common")) testImplementation(projectTests(":compiler:test-infrastructure")) testImplementation(projectTests(":compiler:tests-common-new")) diff --git a/compiler/tests-java8/build.gradle.kts b/compiler/tests-java8/build.gradle.kts index 3f2ac0e2934..969a8d0efcb 100644 --- a/compiler/tests-java8/build.gradle.kts +++ b/compiler/tests-java8/build.gradle.kts @@ -9,6 +9,8 @@ dependencies { testApi(project(":kotlin-scripting-compiler")) testApi(projectTests(":compiler:tests-common")) testImplementation(intellijCore()) + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit4) testApi(projectTests(":generators:test-generator")) testRuntimeOnly(toolsJar()) } diff --git a/compiler/tests-spec/build.gradle.kts b/compiler/tests-spec/build.gradle.kts index d85d2f56c41..c1ae15d9f00 100644 --- a/compiler/tests-spec/build.gradle.kts +++ b/compiler/tests-spec/build.gradle.kts @@ -16,9 +16,12 @@ dependencies { testRuntimeOnly(project(":core:descriptors.runtime")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testImplementation(libs.junit.jupyter.params) runtimeOnly(libs.junit.vintage.engine) + testImplementation(libs.junit4) } sourceSets { diff --git a/compiler/util-klib-abi/build.gradle.kts b/compiler/util-klib-abi/build.gradle.kts index 931927a6539..97386b5fea9 100644 --- a/compiler/util-klib-abi/build.gradle.kts +++ b/compiler/util-klib-abi/build.gradle.kts @@ -9,7 +9,9 @@ dependencies { implementation(project(":core:compiler.common")) implementation(project(":compiler:ir.serialization.common")) compileOnly(commonDependency("org.jetbrains.intellij.deps.fastutil:intellij-deps-fastutil")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testImplementation(libs.junit.jupyter.params) testImplementation(intellijCore()) testImplementation(commonDependency("org.jetbrains.kotlin:kotlin-reflect")) { isTransitive = false } diff --git a/compiler/util/build.gradle.kts b/compiler/util/build.gradle.kts index 52159eb0af7..51ca8cc2e24 100644 --- a/compiler/util/build.gradle.kts +++ b/compiler/util/build.gradle.kts @@ -16,6 +16,8 @@ dependencies { testImplementation(projectTests(":compiler:tests-common")) testImplementation(intellijCore()) + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit4) } sourceSets { diff --git a/compiler/visualizer/build.gradle.kts b/compiler/visualizer/build.gradle.kts index bd3e9ca87b7..ef34445fcef 100644 --- a/compiler/visualizer/build.gradle.kts +++ b/compiler/visualizer/build.gradle.kts @@ -11,7 +11,9 @@ dependencies { testImplementation(project(":compiler:visualizer:render-psi")) testImplementation(project(":compiler:visualizer:render-fir")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testApi(projectTests(":compiler:tests-compiler-utils")) testApi(projectTests(":compiler:tests-common-new")) diff --git a/core/descriptors.runtime/build.gradle.kts b/core/descriptors.runtime/build.gradle.kts index f2ef005968f..60982cb05f4 100644 --- a/core/descriptors.runtime/build.gradle.kts +++ b/core/descriptors.runtime/build.gradle.kts @@ -16,6 +16,8 @@ dependencies { testApi(projectTests(":generators:test-generator")) testApi(intellijCore()) + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit4) } sourceSets { diff --git a/generators/analysis-api-generator/build.gradle.kts b/generators/analysis-api-generator/build.gradle.kts index 9dd7d0f4281..718cee86e21 100644 --- a/generators/analysis-api-generator/build.gradle.kts +++ b/generators/analysis-api-generator/build.gradle.kts @@ -25,7 +25,9 @@ dependencies { testImplementation(projectTests(":analysis:symbol-light-classes")) testImplementation(projectTests(":analysis:decompiled:native")) testImplementation(intellijCore()) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) } val generateFrontendApiTests by generator("org.jetbrains.kotlin.generators.tests.analysis.api.GenerateAnalysisApiTestsKt") diff --git a/generators/build.gradle.kts b/generators/build.gradle.kts index 4f725aa0ede..9801851bafd 100644 --- a/generators/build.gradle.kts +++ b/generators/build.gradle.kts @@ -79,7 +79,9 @@ dependencies { testImplementation(projectTests(":js:js.tests")) testImplementation(project(":kotlin-gradle-compiler-types")) testImplementation(project(":jps:jps-common")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) if (Ide.IJ()) { testCompileOnly(jpsBuildTest()) diff --git a/generators/test-generator/build.gradle.kts b/generators/test-generator/build.gradle.kts index 55b4d63e4a9..2ee9543c83a 100644 --- a/generators/test-generator/build.gradle.kts +++ b/generators/test-generator/build.gradle.kts @@ -9,7 +9,9 @@ dependencies { testApi(projectTests(":compiler:test-infrastructure-utils")) testApi(kotlinStdlib()) testImplementation(libs.junit4) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testApi(project(":generators")) testImplementation(commonDependency("org.jetbrains.kotlin:kotlin-reflect")) { isTransitive = false } diff --git a/js/js.tests/build.gradle.kts b/js/js.tests/build.gradle.kts index e61545128a0..d6cba8560a8 100644 --- a/js/js.tests/build.gradle.kts +++ b/js/js.tests/build.gradle.kts @@ -33,7 +33,9 @@ val testJsRuntime by configurations.creating { } dependencies { - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testRuntimeOnly(libs.junit.vintage.engine) testApi(protobufFull()) 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 2cf4514d23c..b9019fdd63f 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/build.gradle.kts +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/build.gradle.kts @@ -96,7 +96,9 @@ dependencies { testImplementation(gradleApi()) testImplementation(gradleTestKit()) testImplementation(commonDependency("com.google.code.gson:gson")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testRuntimeOnly(libs.junit.vintage.engine) testImplementation(libs.junit.jupyter.params) diff --git a/native/native.tests/build.gradle.kts b/native/native.tests/build.gradle.kts index 36b677c0dbd..e53725fe3c8 100644 --- a/native/native.tests/build.gradle.kts +++ b/native/native.tests/build.gradle.kts @@ -18,7 +18,9 @@ dependencies { testImplementation(project(":native:executors")) testImplementation(project(":kotlin-util-klib-abi")) testImplementation(projectTests(":kotlin-util-klib-abi")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testImplementation(commonDependency("org.jetbrains.kotlinx", "kotlinx-metadata-klib")) testImplementation(commonDependency("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { isTransitive = false } diff --git a/native/utils/build.gradle.kts b/native/utils/build.gradle.kts index fe5867dae88..f8aa02510a2 100644 --- a/native/utils/build.gradle.kts +++ b/native/utils/build.gradle.kts @@ -14,7 +14,9 @@ dependencies { testImplementation(libs.junit4) testImplementation(kotlinStdlib()) testImplementation(commonDependency("org.jetbrains.kotlin:kotlin-reflect")) { isTransitive = false } - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) } sourceSets { diff --git a/plugins/allopen/build.gradle.kts b/plugins/allopen/build.gradle.kts index 0896184e68e..401b72f006f 100644 --- a/plugins/allopen/build.gradle.kts +++ b/plugins/allopen/build.gradle.kts @@ -23,7 +23,9 @@ dependencies { testRuntimeOnly(commonDependency("org.codehaus.woodstox:stax2-api")) testRuntimeOnly(commonDependency("com.fasterxml:aalto-xml")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testImplementation(projectTests(":compiler:tests-common-new")) testImplementation(projectTests(":compiler:test-infrastructure")) testImplementation(projectTests(":compiler:test-infrastructure-utils")) diff --git a/plugins/atomicfu/atomicfu-compiler/build.gradle.kts b/plugins/atomicfu/atomicfu-compiler/build.gradle.kts index 982d5b09833..cf1204eab17 100644 --- a/plugins/atomicfu/atomicfu-compiler/build.gradle.kts +++ b/plugins/atomicfu/atomicfu-compiler/build.gradle.kts @@ -102,7 +102,9 @@ dependencies { testImplementation(projectTests(":compiler:test-infrastructure")) testCompileOnly("org.jetbrains.kotlinx:atomicfu:0.21.0") - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testRuntimeOnly(kotlinStdlib()) testRuntimeOnly(project(":kotlin-preloader")) // it's required for ant tests diff --git a/plugins/fir-plugin-prototype/build.gradle.kts b/plugins/fir-plugin-prototype/build.gradle.kts index 5b567f86a3d..600644d18b6 100644 --- a/plugins/fir-plugin-prototype/build.gradle.kts +++ b/plugins/fir-plugin-prototype/build.gradle.kts @@ -19,7 +19,9 @@ dependencies { compileOnly(intellijCore()) compileOnly(commonDependency("org.jetbrains.intellij.deps:asm-all")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testApi(projectTests(":compiler:tests-common-new")) testApi(projectTests(":compiler:test-infrastructure")) testApi(projectTests(":compiler:test-infrastructure-utils")) diff --git a/plugins/imports-dumper/build.gradle.kts b/plugins/imports-dumper/build.gradle.kts index c4a906c21fe..074986b4d21 100644 --- a/plugins/imports-dumper/build.gradle.kts +++ b/plugins/imports-dumper/build.gradle.kts @@ -18,6 +18,8 @@ dependencies { testApi(projectTests(":compiler:tests-common")) testRuntimeOnly(intellijCore()) testRuntimeOnly("org.jetbrains.kotlinx", "kotlinx-serialization-runtime", kotlinxSerializationVersion) + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit4) embedded("org.jetbrains.kotlinx", "kotlinx-serialization-runtime", kotlinxSerializationVersion) { isTransitive = false } } diff --git a/plugins/kapt3/kapt3-base/build.gradle.kts b/plugins/kapt3/kapt3-base/build.gradle.kts index a7ca7a1a3e3..fe89aa94867 100644 --- a/plugins/kapt3/kapt3-base/build.gradle.kts +++ b/plugins/kapt3/kapt3-base/build.gradle.kts @@ -7,7 +7,9 @@ dependencies { api(kotlinStdlib()) compileOnly(toolsJarApi()) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testCompileOnly(toolsJarApi()) testRuntimeOnly(toolsJar()) } diff --git a/plugins/kapt3/kapt3-cli/build.gradle.kts b/plugins/kapt3/kapt3-cli/build.gradle.kts index 9a4e7e6146e..0b6e4a3cb0c 100644 --- a/plugins/kapt3/kapt3-cli/build.gradle.kts +++ b/plugins/kapt3/kapt3-cli/build.gradle.kts @@ -11,7 +11,9 @@ dependencies { testImplementation(intellijCore()) testApi(projectTests(":compiler:test-infrastructure-utils")) testApi(projectTests(":compiler:tests-common-new")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) } sourceSets { diff --git a/plugins/kapt3/kapt3-compiler/build.gradle.kts b/plugins/kapt3/kapt3-compiler/build.gradle.kts index 5eba8729eb9..c9864272004 100644 --- a/plugins/kapt3/kapt3-compiler/build.gradle.kts +++ b/plugins/kapt3/kapt3-compiler/build.gradle.kts @@ -27,7 +27,9 @@ dependencies { testRuntimeOnly(commonDependency("org.codehaus.woodstox:stax2-api")) testRuntimeOnly(commonDependency("com.fasterxml:aalto-xml")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testApi(projectTests(":compiler:tests-common-new")) testApi(projectTests(":compiler:test-infrastructure")) testApi(projectTests(":compiler:test-infrastructure-utils")) diff --git a/plugins/kapt4/build.gradle.kts b/plugins/kapt4/build.gradle.kts index f6ed61caa90..10946986684 100644 --- a/plugins/kapt4/build.gradle.kts +++ b/plugins/kapt4/build.gradle.kts @@ -34,7 +34,9 @@ dependencies { embedded(project(":analysis:low-level-api-fir")) { isTransitive = false } embedded(project(":analysis:symbol-light-classes")) { isTransitive = false } - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testApi(projectTests(":kotlin-annotation-processing-compiler")) testImplementation(project(":analysis:analysis-api-standalone")) testRuntimeOnly(toolsJar()) diff --git a/plugins/kotlinx-serialization/build.gradle.kts b/plugins/kotlinx-serialization/build.gradle.kts index 1735428bf8d..97bff24a82f 100644 --- a/plugins/kotlinx-serialization/build.gradle.kts +++ b/plugins/kotlinx-serialization/build.gradle.kts @@ -40,7 +40,9 @@ dependencies { testApi(project(":compiler:fir:plugin-utils")) testImplementation(projectTests(":generators:test-generator")) testImplementation(projectTests(":js:js.tests")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testImplementation(project(":kotlinx-serialization-compiler-plugin.common")) testImplementation(project(":kotlinx-serialization-compiler-plugin.k1")) diff --git a/plugins/noarg/build.gradle.kts b/plugins/noarg/build.gradle.kts index 2c4e7819bb6..00d78f46633 100644 --- a/plugins/noarg/build.gradle.kts +++ b/plugins/noarg/build.gradle.kts @@ -16,7 +16,9 @@ dependencies { testApi(project(":compiler:cli")) testApi(project(":kotlin-noarg-compiler-plugin.cli")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testApi(projectTests(":compiler:tests-common-new")) testApi(projectTests(":compiler:test-infrastructure")) testApi(projectTests(":compiler:test-infrastructure-utils")) diff --git a/plugins/parcelize/parcelize-compiler/build.gradle.kts b/plugins/parcelize/parcelize-compiler/build.gradle.kts index 8625b22b289..5fab0fa0ff8 100644 --- a/plugins/parcelize/parcelize-compiler/build.gradle.kts +++ b/plugins/parcelize/parcelize-compiler/build.gradle.kts @@ -19,7 +19,9 @@ dependencies { embedded(project(":plugins:parcelize:parcelize-compiler:parcelize.backend")) { isTransitive = false } embedded(project(":plugins:parcelize:parcelize-compiler:parcelize.cli")) { isTransitive = false } - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testApi(intellijCore()) diff --git a/plugins/sam-with-receiver/build.gradle.kts b/plugins/sam-with-receiver/build.gradle.kts index 27f8e5bd778..edd2eef0148 100644 --- a/plugins/sam-with-receiver/build.gradle.kts +++ b/plugins/sam-with-receiver/build.gradle.kts @@ -17,7 +17,9 @@ dependencies { testCompileOnly(project(":kotlin-compiler")) testImplementation(project(":kotlin-scripting-jvm-host-unshaded")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testRuntimeOnly(libs.junit.vintage.engine) testApi(projectTests(":compiler:tests-common-new")) diff --git a/repo/artifacts-tests/build.gradle.kts b/repo/artifacts-tests/build.gradle.kts index 43098010a26..b1d8bb69f7a 100644 --- a/repo/artifacts-tests/build.gradle.kts +++ b/repo/artifacts-tests/build.gradle.kts @@ -8,7 +8,9 @@ plugins { dependencies { testImplementation(kotlinStdlib("jdk8")) testImplementation(project(":kotlin-test:kotlin-test-junit5")) - testApiJUnit5() + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit.jupyter.api) + testRuntimeOnly(libs.junit.jupyter.engine) testImplementation(projectTests(":compiler:tests-common-new")) } diff --git a/repo/codebase-tests/build.gradle.kts b/repo/codebase-tests/build.gradle.kts index 73a8e0655ec..70cce07456d 100644 --- a/repo/codebase-tests/build.gradle.kts +++ b/repo/codebase-tests/build.gradle.kts @@ -10,6 +10,8 @@ dependencies { testImplementation(libs.jackson.dataformat.xml) testImplementation(libs.jackson.module.kotlin) testImplementation("com.fasterxml.woodstox:woodstox-core:6.5.1") + testApi(platform(libs.junit.bom)) + testImplementation(libs.junit4) testImplementation("org.eclipse.jgit:org.eclipse.jgit:5.13.0.202109080827-r") } 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 e3b76b4f4c8..ad653212357 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 @@ -14,15 +14,12 @@ import org.gradle.api.file.FileCollection import org.gradle.internal.jvm.Jvm import org.gradle.kotlin.dsl.closureOf import org.gradle.kotlin.dsl.extra -import org.gradle.kotlin.dsl.getByType import org.gradle.kotlin.dsl.project import java.io.File private val Project.isEAPIntellij get() = rootProject.extra["versions.intellijSdk"].toString().contains("-EAP-") private val Project.isNightlyIntellij get() = rootProject.extra["versions.intellijSdk"].toString().endsWith("SNAPSHOT") && !isEAPIntellij -private val Project.libsVersionCatalog get() = extensions.getByType().named("libs") - val Project.intellijRepo get() = when { @@ -192,35 +189,6 @@ fun DependencyHandler.jpsLikeModuleDependency(moduleName: String, scope: JpsDepS } } - -fun Project.testApiJUnit5() { - with(dependencies) { - val libsVersionCatalog = libsVersionCatalog - testApi(platform(libsVersionCatalog.findLibrary("junit-bom").orElseThrow { GradleException("No version for `junit-bom`") })) - testImplementation(libsVersionCatalog.findLibrary("junit-jupyter-api").orElseThrow { GradleException("No version for `junit-jupyter-api`") }) - testRuntimeOnly( - libsVersionCatalog.findLibrary("junit-jupyter-engine").orElseThrow { GradleException("No version for `junit-jupyter-engine`") }) - testImplementation( - libsVersionCatalog.findLibrary("junit-platform-commons") - .orElseThrow { GradleException("No version for `junit-platform-commons`") }) - testImplementation( - libsVersionCatalog.findLibrary("junit-platform-launcher") - .orElseThrow { GradleException("No version for `junit-platform-launcher`") }) - } -} - -private fun DependencyHandler.testApi(dependencyNotation: Any) { - add("testApi", dependencyNotation) -} - -private fun DependencyHandler.testImplementation(dependencyNotation: Any) { - add("testImplementation", dependencyNotation) -} - -private fun DependencyHandler.testRuntimeOnly(dependencyNotation: Any) { - add("testRuntimeOnly", dependencyNotation) -} - val Project.protobufRelocatedVersion: String get() = findProperty("versions.protobuf-relocated") as String fun Project.protobufLite(): String = "org.jetbrains.kotlin:protobuf-lite:$protobufRelocatedVersion" fun Project.protobufFull(): String = "org.jetbrains.kotlin:protobuf-relocated:$protobufRelocatedVersion" diff --git a/wasm/wasm.tests/build.gradle.kts b/wasm/wasm.tests/build.gradle.kts index 1c4c614d665..a24725a93e8 100644 --- a/wasm/wasm.tests/build.gradle.kts +++ b/wasm/wasm.tests/build.gradle.kts @@ -61,10 +61,10 @@ val jsShell by configurations.creating { } dependencies { - testImplementation(libs.junit4) testApi(projectTests(":compiler:tests-common")) testApi(projectTests(":compiler:tests-common-new")) testApi(intellijCore()) + testApi(platform(libs.junit.bom)) testImplementation(libs.junit.jupyter.api) testRuntimeOnly(libs.junit.jupyter.engine)