diff --git a/build-common/build.gradle.kts b/build-common/build.gradle.kts index b9dd0921f9b..8797ef72a46 100644 --- a/build-common/build.gradle.kts +++ b/build-common/build.gradle.kts @@ -23,7 +23,8 @@ dependencies { testCompileOnly(project(":compiler:cli-common")) testApi(projectTests(":compiler:tests-common")) - testApiJUnit5(jupiterParams = true) + testApiJUnit5() + testImplementation(libs.junit.jupyter.params) testApi(libs.junit4) testApi(protobufFull()) testApi(kotlinStdlib()) diff --git a/compiler/tests-different-jdk/build.gradle.kts b/compiler/tests-different-jdk/build.gradle.kts index b4f41d32800..1b3b9fcde84 100644 --- a/compiler/tests-different-jdk/build.gradle.kts +++ b/compiler/tests-different-jdk/build.gradle.kts @@ -10,7 +10,10 @@ dependencies { testApi(projectTests(":compiler:tests-compiler-utils")) testApi(projectTests(":compiler:tests-common-new")) - testApiJUnit5(vintageEngine = true, runner = true, suiteApi = true) + testApiJUnit5() + testApi(libs.junit.platform.runner) + testApi(libs.junit.platform.suite.api) + runtimeOnly(libs.junit.vintage.engine) testImplementation(intellijCore()) } diff --git a/compiler/tests-spec/build.gradle.kts b/compiler/tests-spec/build.gradle.kts index 7244cd5470f..d85d2f56c41 100644 --- a/compiler/tests-spec/build.gradle.kts +++ b/compiler/tests-spec/build.gradle.kts @@ -16,7 +16,9 @@ dependencies { testRuntimeOnly(project(":core:descriptors.runtime")) - testApiJUnit5(vintageEngine = true, jupiterParams = true) + testApiJUnit5() + testImplementation(libs.junit.jupyter.params) + runtimeOnly(libs.junit.vintage.engine) } sourceSets { diff --git a/js/js.tests/build.gradle.kts b/js/js.tests/build.gradle.kts index 3ab6f841e83..477c619c981 100644 --- a/js/js.tests/build.gradle.kts +++ b/js/js.tests/build.gradle.kts @@ -33,7 +33,8 @@ val testJsRuntime by configurations.creating { } dependencies { - testApiJUnit5(vintageEngine = true) + testApiJUnit5() + testRuntimeOnly(libs.junit.vintage.engine) testApi(protobufFull()) testApi(projectTests(":compiler:tests-common")) 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 5e28962011f..2cf4514d23c 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(vintageEngine = true, jupiterParams = true) + testApiJUnit5() + testRuntimeOnly(libs.junit.vintage.engine) + testImplementation(libs.junit.jupyter.params) testRuntimeOnly(project(":compiler:tests-mutes")) diff --git a/plugins/sam-with-receiver/build.gradle.kts b/plugins/sam-with-receiver/build.gradle.kts index e020fb91a58..27f8e5bd778 100644 --- a/plugins/sam-with-receiver/build.gradle.kts +++ b/plugins/sam-with-receiver/build.gradle.kts @@ -17,7 +17,8 @@ dependencies { testCompileOnly(project(":kotlin-compiler")) testImplementation(project(":kotlin-scripting-jvm-host-unshaded")) - testApiJUnit5(vintageEngine = true) + testApiJUnit5() + testRuntimeOnly(libs.junit.vintage.engine) testApi(projectTests(":compiler:tests-common-new")) testApi(projectTests(":compiler:test-infrastructure")) 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 e4f8fe7bad1..b4ef268c0a3 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 @@ -193,45 +193,19 @@ fun DependencyHandler.jpsLikeModuleDependency(moduleName: String, scope: JpsDepS } -fun Project.testApiJUnit5( - vintageEngine: Boolean = false, - runner: Boolean = false, - suiteApi: Boolean = false, - jupiterParams: Boolean = false -) { +fun Project.testApiJUnit5() { with(dependencies) { val libsVersionCatalog = libsVersionCatalog testApi(platform(libsVersionCatalog.findLibrary("junit-bom").orElseThrow { GradleException("No version for `junit-bom`") })) testApi(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`") }) - if (vintageEngine) { - testRuntimeOnly( - libsVersionCatalog.findLibrary("junit-vintage-engine") - .orElseThrow { GradleException("No version for `junit-vintage-engine`") }) - } - - if (jupiterParams) { - testApi( - libsVersionCatalog.findLibrary("junit-jupyter-params") - .orElseThrow { GradleException("No version for `junit-jupyter-params`") }) - } - + testRuntimeOnly( + libsVersionCatalog.findLibrary("junit-jupyter-engine").orElseThrow { GradleException("No version for `junit-jupyter-engine`") }) testApi( libsVersionCatalog.findLibrary("junit-platform-commons") .orElseThrow { GradleException("No version for `junit-platform-commons`") }) testApi( libsVersionCatalog.findLibrary("junit-platform-launcher") .orElseThrow { GradleException("No version for `junit-platform-launcher`") }) - if (runner) { - testApi( - libsVersionCatalog.findLibrary("junit-platform-runner") - .orElseThrow { GradleException("No version for `junit-platform-runner`") }) - } - if (suiteApi) { - testApi( - libsVersionCatalog.findLibrary("junit-platform-suite-api") - .orElseThrow { GradleException("No version for `junit-platform-suite-api`") }) - } } }