[Build] Get rid of the testApiJUnit5 method
#KTI-1349 In Progress
This commit is contained in:
committed by
Space Team
parent
53fde520d5
commit
6f96be0b76
@@ -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"))
|
||||
}
|
||||
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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<VersionCatalogsExtension>().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"
|
||||
|
||||
Reference in New Issue
Block a user