[Build] Move JUnit dependencies into the version catalog
The `kotlin-test` dependencies are left untouched as changing them affects publications, thus these versions are independent from the used inside our build #KTI-1349 In Progress
This commit is contained in:
committed by
Space Team
parent
9d43945b19
commit
357d12fc8e
@@ -23,7 +23,7 @@ dependencies {
|
||||
|
||||
testCompileOnly(project(":compiler:cli-common"))
|
||||
testApi(projectTests(":compiler:tests-common"))
|
||||
testApi(commonDependency("junit:junit"))
|
||||
testApi(libs.junit4)
|
||||
testApi(protobufFull())
|
||||
testApi(kotlinStdlib())
|
||||
testImplementation(project(":compiler:build-tools:kotlin-build-statistics"))
|
||||
|
||||
@@ -17,21 +17,19 @@ dependencies {
|
||||
|
||||
testApi(kotlinStdlib())
|
||||
testApi(projectTests(":compiler:tests-common"))
|
||||
testApi(commonDependency("junit:junit"))
|
||||
testApi(libs.junit4)
|
||||
testApi(projectTests(":compiler:test-infrastructure"))
|
||||
testApi(projectTests(":compiler:test-infrastructure-utils"))
|
||||
testApi(projectTests(":compiler:tests-compiler-utils"))
|
||||
testApi(projectTests(":compiler:tests-common-new"))
|
||||
|
||||
testApi(commonDependency("junit:junit"))
|
||||
|
||||
testApi(jpsModel())
|
||||
testApi(jpsBuildTest())
|
||||
|
||||
testRuntimeOnly(intellijCore())
|
||||
testRuntimeOnly(commonDependency("org.jetbrains.intellij.deps.jna:jna"))
|
||||
|
||||
testApi("org.junit.platform:junit-platform-launcher:${commonDependencyVersion("org.junit.platform", "")}")
|
||||
testApi(libs.junit.platform.launcher)
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
@@ -16,7 +16,7 @@ dependencies {
|
||||
|
||||
testApi(kotlinStdlib())
|
||||
|
||||
testApi(commonDependency("junit:junit"))
|
||||
testApi(libs.junit4)
|
||||
testCompileOnly(project(":kotlin-test:kotlin-test-jvm"))
|
||||
testCompileOnly(project(":kotlin-test:kotlin-test-junit"))
|
||||
testApi(projectTests(":compiler:tests-common"))
|
||||
|
||||
@@ -37,7 +37,7 @@ dependencies {
|
||||
testApi(project(":compiler:backend"))
|
||||
testApi(project(":compiler:cli"))
|
||||
testApi(projectTests(":compiler:tests-common"))
|
||||
testApi(commonDependency("junit:junit"))
|
||||
testApi(libs.junit4)
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
@@ -12,7 +12,7 @@ dependencies {
|
||||
testCompileOnly("org.jetbrains:annotations:13.0")
|
||||
testApi(project(":kotlin-test:kotlin-test-jvm"))
|
||||
testApi(project(":kotlin-test:kotlin-test-junit"))
|
||||
testApi(commonDependency("junit:junit"))
|
||||
testApi(libs.junit4)
|
||||
testCompileOnly(intellijCore())
|
||||
|
||||
testRuntimeOnly(intellijCore())
|
||||
|
||||
@@ -10,7 +10,7 @@ dependencies {
|
||||
testImplementation(project(":kotlin-test:kotlin-test-jvm"))
|
||||
testImplementation(project(":kotlin-daemon"))
|
||||
testImplementation(project(":kotlin-daemon-client"))
|
||||
testImplementation(commonDependency("junit:junit"))
|
||||
testImplementation(libs.junit4)
|
||||
testImplementation(projectTests(":compiler:tests-common"))
|
||||
testImplementation(intellijCore())
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ plugins {
|
||||
dependencies {
|
||||
compileOnly(intellijCore())
|
||||
|
||||
testApi(commonDependency("junit:junit"))
|
||||
testApi(libs.junit4)
|
||||
testCompileOnly(project(":kotlin-test:kotlin-test-jvm"))
|
||||
testCompileOnly(project(":kotlin-test:kotlin-test-junit"))
|
||||
testApi(projectTests(":compiler:tests-common"))
|
||||
|
||||
@@ -18,7 +18,7 @@ dependencies {
|
||||
testRuntimeOnly("xerces:xercesImpl:2.12.0")
|
||||
testRuntimeOnly(commonDependency("commons-lang:commons-lang"))
|
||||
|
||||
testApi(commonDependency("junit:junit"))
|
||||
testApi(libs.junit4)
|
||||
testCompileOnly(project(":kotlin-test:kotlin-test-jvm"))
|
||||
testCompileOnly(project(":kotlin-test:kotlin-test-junit"))
|
||||
testApi(projectTests(":compiler:tests-common"))
|
||||
|
||||
@@ -22,7 +22,7 @@ dependencies {
|
||||
compileOnly(intellijCore())
|
||||
compileOnly(libs.guava)
|
||||
|
||||
testImplementation(commonDependency("junit:junit"))
|
||||
testImplementation(libs.junit4)
|
||||
testImplementation(projectTests(":compiler:tests-common"))
|
||||
testImplementation(projectTests(":compiler:fir:raw-fir:psi2fir"))
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ dependencies {
|
||||
compileOnly(intellijCore())
|
||||
compileOnly(libs.guava)
|
||||
|
||||
testImplementation(commonDependency("junit:junit"))
|
||||
testImplementation(libs.junit4)
|
||||
testImplementation(projectTests(":compiler:tests-common"))
|
||||
testImplementation(commonDependency("org.jetbrains.kotlin:kotlin-reflect")) { isTransitive = false }
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ dependencies {
|
||||
api(project(":compiler:build-tools:kotlin-build-tools-api"))
|
||||
compileOnly(intellijCore())
|
||||
|
||||
testApi(commonDependency("junit:junit"))
|
||||
testApi(libs.junit4)
|
||||
testApi(project(":kotlin-test:kotlin-test-junit"))
|
||||
testApi(kotlinStdlib())
|
||||
testApi(projectTests(":kotlin-build-common"))
|
||||
|
||||
@@ -53,7 +53,7 @@ dependencies {
|
||||
testApi(project(":kotlin-test:kotlin-test-jvm"))
|
||||
testApi(project(":kotlin-scripting-compiler-impl"))
|
||||
testApi(projectTests(":compiler:test-infrastructure-utils"))
|
||||
testApi(commonDependency("junit:junit"))
|
||||
testApi(libs.junit4)
|
||||
testApi(commonDependency("com.android.tools:r8"))
|
||||
testApi(project(":analysis:analysis-internal-utils"))
|
||||
testCompileOnly(commonDependency("org.jetbrains.kotlin:kotlin-reflect")) { isTransitive = false }
|
||||
|
||||
@@ -5,7 +5,7 @@ plugins {
|
||||
|
||||
dependencies {
|
||||
implementation(kotlinStdlib())
|
||||
testImplementation(commonDependency("junit:junit"))
|
||||
testImplementation(libs.junit4)
|
||||
testImplementation(kotlin("test"))
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ description = "Common klib reader and writer"
|
||||
dependencies {
|
||||
api(kotlinStdlib())
|
||||
api(project(":kotlin-util-io"))
|
||||
testImplementation(commonDependency("junit:junit"))
|
||||
testImplementation(libs.junit4)
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
@@ -8,7 +8,7 @@ dependencies {
|
||||
testApi(project(":core:util.runtime"))
|
||||
testApi(projectTests(":compiler:test-infrastructure-utils"))
|
||||
testApi(kotlinStdlib())
|
||||
testApi(commonDependency("junit:junit"))
|
||||
testApi(libs.junit4)
|
||||
testApiJUnit5()
|
||||
testApi(project(":generators"))
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@ gson = { strictly = "2.8.9" } # should be in sync with version.properties
|
||||
jetbrains-ideaExt = "1.0.1"
|
||||
jackson = "2.15.2"
|
||||
jgit = "6.6.0.202305301015-r"
|
||||
junit4 = "4.13.2"
|
||||
junit5 = "5.9.1"
|
||||
junit-platform = "1.7.0"
|
||||
|
||||
[libraries]
|
||||
dexMemberList = { module = "com.jakewharton.dex:dex-member-list", version.ref = "dexMemberList" }
|
||||
@@ -50,6 +53,15 @@ guava = { module = "com.google.guava:guava", version.ref = "guava" }
|
||||
jetbrains-ideaExt-gradlePlugin = { module = "gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext", version.ref = "jetbrains-ideaExt" }
|
||||
jdom2 = { module = "org.jdom:jdom2", version.ref = "jdom2" }
|
||||
jgit = { module = "org.eclipse.jgit:org.eclipse.jgit", version.ref = "jgit" }
|
||||
junit4 = { module = "junit:junit", version.ref = "junit4" }
|
||||
junit-bom = { module = "org.junit:junit-bom", version.ref = "junit5" }
|
||||
junit-jupyter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit5" }
|
||||
junit-jupyter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit5" }
|
||||
junit-vintage-engine = { module = "org.junit.vintage:junit-vintage-engine", version.ref = "junit5" }
|
||||
junit-platform-commons = { module = "org.junit.platform:junit-platform-commons", version.ref = "junit-platform" }
|
||||
junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher", version.ref = "junit-platform" }
|
||||
junit-platform-runner = { module = "org.junit.platform:junit-platform-runner", version.ref = "junit-platform" }
|
||||
junit-platform-suite-api = { module = "org.junit.platform:junit-platform-suite-api", version.ref = "junit-platform" }
|
||||
|
||||
[plugins]
|
||||
jetbrains-ideaExt = { id = "org.jetbrains.gradle.plugin.idea-ext", version.ref = "jetbrains-ideaExt" }
|
||||
|
||||
@@ -15,10 +15,10 @@ versions.intellij-deps-fastutil=8.5.4-9
|
||||
versions.jdom=2.0.6
|
||||
versions.jna-platform=5.9.0.26
|
||||
versions.jna=5.9.0.26
|
||||
# junit-bom still required yet for compose
|
||||
versions.junit-bom=5.9.1
|
||||
versions.log4j=1.2.17.2
|
||||
versions.lz4-java=1.7.1
|
||||
versions.org.junit.platform=1.7.0
|
||||
versions.oro=2.0.8
|
||||
versions.serviceMessages=2019.1.4
|
||||
versions.stax2-api=4.2.1
|
||||
@@ -34,6 +34,7 @@ versions.javax.inject=1
|
||||
versions.jflex=1.7.0
|
||||
versions.jline=3.3.1
|
||||
versions.jsr305=1.3.9
|
||||
# junit still required yet for compose
|
||||
versions.junit=4.13.2
|
||||
# kotlin-reflect has version which is bundled in minimally supported IDEA
|
||||
versions.kotlin-reflect=1.6.10
|
||||
|
||||
@@ -31,7 +31,7 @@ dependencies {
|
||||
|
||||
testImplementation(project(":compiler:cli-common"))
|
||||
testImplementation(jpsModelSerialization())
|
||||
testImplementation(commonDependency("junit:junit"))
|
||||
testImplementation(libs.junit4)
|
||||
testImplementation(kotlin("test-junit"))
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ dependencies {
|
||||
testApi(project(":js:js.dce"))
|
||||
testApi(project(":js:js.engines"))
|
||||
testApi(project(":compiler:incremental-compilation-impl"))
|
||||
testApi(commonDependency("junit:junit"))
|
||||
testApi(libs.junit4)
|
||||
testApi(projectTests(":kotlin-build-common"))
|
||||
testApi(projectTests(":generators:test-generator"))
|
||||
|
||||
@@ -79,7 +79,7 @@ dependencies {
|
||||
antLauncherJar(commonDependency("org.apache.ant", "ant"))
|
||||
antLauncherJar(toolsJar())
|
||||
|
||||
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:${commonDependencyVersion("org.junit", "junit-bom")}")
|
||||
testRuntimeOnly(libs.junit.vintage.engine)
|
||||
|
||||
testImplementation(commonDependency("org.jetbrains.kotlinx", "kotlinx-serialization-json"))
|
||||
testImplementation(libs.ktor.client.cio)
|
||||
|
||||
@@ -6243,7 +6243,7 @@ dependencies {
|
||||
|
||||
implementation kotlinCompilerModule
|
||||
api project(path: ':kotlin-native:backend.native', configuration: 'cli_bcApiElements')
|
||||
api RepoDependencies.commonDependency(project, "junit")
|
||||
api libs.junit4
|
||||
}
|
||||
|
||||
project.afterEvaluate {
|
||||
|
||||
@@ -19,6 +19,14 @@ plugins {
|
||||
id("kotlin-daemon-config")
|
||||
}
|
||||
|
||||
dependencyResolutionManagement {
|
||||
versionCatalogs {
|
||||
create("libs") {
|
||||
from(files("../../gradle/libs.versions.toml"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildscript {
|
||||
val buildGradlePluginVersion = extra["kotlin.build.gradlePlugin.version"]
|
||||
dependencies {
|
||||
|
||||
@@ -44,7 +44,7 @@ dependencies {
|
||||
implementation project(":kotlin-stdlib")
|
||||
implementation project(path: ':kotlin-native:backend.native', configuration: 'cli_bcApiElements')
|
||||
implementation project(":kotlin-native:utilities:basic-utils")
|
||||
testImplementation RepoDependencies.commonDependency(project, "junit")
|
||||
testImplementation libs.junit4
|
||||
testImplementation project(":kotlin-test:kotlin-test-junit")
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ dependencies {
|
||||
kotlinNativeEmbedded(project(":kotlin-native:klib"))
|
||||
kotlinNativeEmbedded(project(":kotlin-native:endorsedLibraries:kotlinx.cli", "jvmRuntimeElements"))
|
||||
kotlinNativeEmbedded(project(":kotlin-compiler")) { isTransitive = false }
|
||||
testImplementation(commonDependency("junit:junit"))
|
||||
testImplementation(libs.junit4)
|
||||
testImplementation(project(":kotlin-test:kotlin-test-junit"))
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ dependencies {
|
||||
testRuntimeOnly(project(":kotlin-scripting-compiler-embeddable"))
|
||||
testRuntimeOnly(project(":kotlin-scripting-jvm-host"))
|
||||
testRuntimeOnly(libs.guava)
|
||||
testApi(commonDependency("junit"))
|
||||
testApi(libs.junit4)
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
@@ -12,7 +12,7 @@ dependencies {
|
||||
testRuntimeOnly(project(":kotlin-compiler"))
|
||||
testRuntimeOnly(project(":kotlin-scripting-compiler"))
|
||||
|
||||
testApi(commonDependency("junit"))
|
||||
testApi(libs.junit4)
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
@@ -8,7 +8,7 @@ dependencies {
|
||||
api(project(":kotlin-scripting-jvm-host-unshaded"))
|
||||
testRuntimeOnly(project(":kotlin-compiler"))
|
||||
testRuntimeOnly(project(":kotlin-scripting-compiler"))
|
||||
testApi(commonDependency("junit"))
|
||||
testApi(libs.junit4)
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
@@ -45,7 +45,7 @@ dependencies {
|
||||
embedded(project(":core:metadata.jvm"))
|
||||
embedded(protobufLite())
|
||||
testImplementation(project(":kotlin-test:kotlin-test-junit"))
|
||||
testImplementation(commonDependency("junit:junit"))
|
||||
testImplementation(libs.junit4)
|
||||
testImplementation(commonDependency("org.jetbrains.intellij.deps:asm-all"))
|
||||
testImplementation(commonDependency("org.jetbrains.kotlin:kotlin-reflect")) { isTransitive = false }
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ project.updateJvmTarget("1.8")
|
||||
dependencies {
|
||||
api(kotlinStdlib())
|
||||
compileOnly(commonDependency("org.jetbrains.kotlin:kotlin-reflect")) { isTransitive = false }
|
||||
testApi(commonDependency("junit"))
|
||||
testApi(libs.junit4)
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
@@ -39,7 +39,7 @@ dependencies {
|
||||
embedded("org.apache.maven.wagon:wagon-http:3.5.3")
|
||||
embedded("commons-io:commons-io:2.11.0")
|
||||
|
||||
testImplementation(commonDependency("junit"))
|
||||
testImplementation(libs.junit4)
|
||||
testRuntimeOnly("org.slf4j:slf4j-nop:1.7.36")
|
||||
testImplementation(project(":kotlin-scripting-dependencies-maven-all"))
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ dependencies {
|
||||
implementation("commons-io:commons-io:2.11.0")
|
||||
|
||||
testImplementation(projectTests(":kotlin-scripting-dependencies"))
|
||||
testImplementation(commonDependency("junit"))
|
||||
testImplementation(libs.junit4)
|
||||
testRuntimeOnly("org.slf4j:slf4j-nop:1.7.36")
|
||||
testImplementation(commonDependency("org.jetbrains.kotlin:kotlin-reflect")) { isTransitive = false }
|
||||
testImplementation(commonDependency("org.jetbrains.kotlinx", "kotlinx-coroutines-core"))
|
||||
|
||||
@@ -8,7 +8,7 @@ project.updateJvmTarget("1.8")
|
||||
dependencies {
|
||||
api(kotlinStdlib())
|
||||
api(project(":kotlin-scripting-common"))
|
||||
testApi(commonDependency("junit"))
|
||||
testApi(libs.junit4)
|
||||
testImplementation(commonDependency("org.jetbrains.kotlinx", "kotlinx-coroutines-core"))
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ val testJsr223Runtime by configurations.creating {
|
||||
val testCompilationClasspath by configurations.creating
|
||||
|
||||
dependencies {
|
||||
testApi(commonDependency("junit"))
|
||||
testApi(libs.junit4)
|
||||
testCompileOnly(project(":kotlin-scripting-jvm-host-unshaded"))
|
||||
testCompileOnly(project(":compiler:cli"))
|
||||
testCompileOnly(project(":core:util.runtime"))
|
||||
@@ -28,7 +28,7 @@ dependencies {
|
||||
testRuntimeOnly(project(":kotlin-scripting-jsr223-unshaded"))
|
||||
testRuntimeOnly(project(":kotlin-compiler"))
|
||||
|
||||
embeddableTestRuntime(commonDependency("junit"))
|
||||
embeddableTestRuntime(libs.junit4)
|
||||
embeddableTestRuntime(project(":kotlin-scripting-jsr223"))
|
||||
embeddableTestRuntime(project(":kotlin-scripting-compiler-embeddable"))
|
||||
embeddableTestRuntime(testSourceSet.output)
|
||||
|
||||
@@ -11,7 +11,7 @@ val embeddableTestRuntime by configurations.creating {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
allTestsRuntime(commonDependency("junit"))
|
||||
allTestsRuntime(libs.junit4)
|
||||
allTestsRuntime(intellijCore())
|
||||
testApi(project(":kotlin-scripting-jvm-host-unshaded"))
|
||||
testApi(projectTests(":compiler:tests-common"))
|
||||
|
||||
@@ -9,7 +9,7 @@ dependencies {
|
||||
api(project(":kotlin-script-runtime"))
|
||||
api(kotlinStdlib())
|
||||
api(project(":kotlin-scripting-common"))
|
||||
testApi(commonDependency("junit"))
|
||||
testApi(libs.junit4)
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
@@ -16,7 +16,7 @@ dependencies {
|
||||
commonCompileOnly(project(":compiler"))
|
||||
commonCompileOnly(project(":kotlin-assignment-compiler-plugin"))
|
||||
|
||||
testImplementation(commonDependency("junit"))
|
||||
testImplementation(libs.junit4)
|
||||
}
|
||||
|
||||
gradlePlugin {
|
||||
|
||||
@@ -18,7 +18,7 @@ dependencies {
|
||||
compileOnly(kotlinStdlib())
|
||||
|
||||
testImplementation(project(":kotlin-test:kotlin-test-junit"))
|
||||
testImplementation(commonDependency("junit:junit"))
|
||||
testImplementation(libs.junit4)
|
||||
}
|
||||
|
||||
projectTest {
|
||||
|
||||
@@ -141,7 +141,7 @@ dependencies {
|
||||
testImplementation(projectTests(":kotlin-build-common"))
|
||||
testImplementation(project(":kotlin-compiler-runner"))
|
||||
testImplementation(project(":kotlin-test:kotlin-test-junit"))
|
||||
testImplementation(commonDependency("junit:junit"))
|
||||
testImplementation(libs.junit4)
|
||||
testImplementation(project(":kotlin-gradle-statistics"))
|
||||
testImplementation(project(":kotlin-tooling-metadata"))
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ dependencies {
|
||||
compileOnly(kotlinStdlib())
|
||||
|
||||
testImplementation(project(":kotlin-test:kotlin-test-junit"))
|
||||
testImplementation(commonDependency("junit"))
|
||||
testImplementation(libs.junit4)
|
||||
}
|
||||
|
||||
projectTest {
|
||||
|
||||
@@ -12,7 +12,7 @@ dependencies {
|
||||
testCompileOnly(project(":compiler:cli"))
|
||||
testCompileOnly(project(":kotlin-scripting-jvm-host-unshaded"))
|
||||
testApi(kotlinStdlib("jdk8"))
|
||||
testApi(commonDependency("junit"))
|
||||
testApi(libs.junit4)
|
||||
testApi(projectTests(":kotlin-scripting-compiler")) { isTransitive = false }
|
||||
testImplementation(project(":kotlin-compiler-embeddable"))
|
||||
kotlinxSerializationGradlePluginClasspath(project(":kotlinx-serialization-compiler-plugin.embeddable")) { isTransitive = false }
|
||||
|
||||
@@ -17,7 +17,7 @@ dependencies {
|
||||
commonCompileOnly(project(":kotlin-noarg-compiler-plugin"))
|
||||
|
||||
testImplementation(gradleApi())
|
||||
testImplementation(commonDependency("junit"))
|
||||
testImplementation(libs.junit4)
|
||||
}
|
||||
|
||||
gradlePlugin {
|
||||
|
||||
@@ -16,7 +16,7 @@ dependencies {
|
||||
commonCompileOnly(project(":compiler"))
|
||||
commonCompileOnly(project(":kotlin-sam-with-receiver-compiler-plugin"))
|
||||
|
||||
testImplementation(commonDependency("junit"))
|
||||
testImplementation(libs.junit4)
|
||||
}
|
||||
|
||||
gradlePlugin {
|
||||
|
||||
@@ -17,7 +17,7 @@ dependencies {
|
||||
api(project(":kotlin-daemon-client"))
|
||||
testCompileOnly(project(":compiler:cli"))
|
||||
testApi(project(":kotlin-test:kotlin-test-junit"))
|
||||
testApi(commonDependency("junit:junit"))
|
||||
testApi(libs.junit4)
|
||||
testApi(project(":kotlin-scripting-compiler"))
|
||||
testRuntimeOnly(project(":kotlin-compiler"))
|
||||
testApi(intellijCore())
|
||||
@@ -27,7 +27,7 @@ optInToExperimentalCompilerApi()
|
||||
|
||||
configurations.all {
|
||||
resolutionStrategy {
|
||||
force(commonDependency("junit:junit"))
|
||||
force(libs.junit4)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ dependencies {
|
||||
testCompileOnly(project(":kotlinx-metadata"))
|
||||
testCompileOnly(project(":kotlinx-metadata-jvm"))
|
||||
|
||||
testImplementation(commonDependency("junit:junit"))
|
||||
testImplementation(libs.junit4)
|
||||
testImplementation(projectTests(":compiler:tests-common"))
|
||||
testImplementation(projectTests(":generators:test-generator"))
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ dependencies {
|
||||
implementation(kotlinStdlib())
|
||||
implementation(project(":native:kotlin-native-utils"))
|
||||
testImplementation(project(":kotlin-test::kotlin-test-junit"))
|
||||
testImplementation(commonDependency("junit:junit"))
|
||||
testImplementation(libs.junit4)
|
||||
testImplementation(projectTests(":compiler:tests-common"))
|
||||
testRuntimeOnly(project(":native:kotlin-klib-commonizer"))
|
||||
testImplementation(project(":kotlin-gradle-plugin"))
|
||||
|
||||
@@ -38,7 +38,7 @@ dependencies {
|
||||
|
||||
api(kotlinStdlib())
|
||||
|
||||
testImplementation(commonDependency("junit:junit"))
|
||||
testImplementation(libs.junit4)
|
||||
testImplementation(projectTests(":compiler:tests-common"))
|
||||
testImplementation(project(":kotlinx-metadata-klib")) { isTransitive = false }
|
||||
testImplementation(project(":kotlinx-metadata")) { isTransitive = false }
|
||||
|
||||
@@ -11,7 +11,7 @@ dependencies {
|
||||
api(project(":kotlin-util-klib"))
|
||||
api(platform(project(":kotlin-gradle-plugins-bom")))
|
||||
|
||||
testImplementation(commonDependency("junit:junit"))
|
||||
testImplementation(libs.junit4)
|
||||
testImplementation(kotlinStdlib())
|
||||
testImplementation(commonDependency("org.jetbrains.kotlin:kotlin-reflect")) { isTransitive = false }
|
||||
testApiJUnit5()
|
||||
|
||||
@@ -37,7 +37,7 @@ dependencies {
|
||||
testApi(project(":kotlin-android-extensions-runtime"))
|
||||
testApi(projectTests(":compiler:tests-common"))
|
||||
testApi(project(":kotlin-test:kotlin-test-jvm"))
|
||||
testApi(commonDependency("junit:junit"))
|
||||
testApi(libs.junit4)
|
||||
|
||||
robolectricDependency("org.robolectric:android-all:5.0.2_r3-robolectric-r0")
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ dependencies {
|
||||
testApi(projectTests(":compiler:tests-common-new"))
|
||||
|
||||
testImplementation(projectTests(":compiler:tests-common"))
|
||||
testImplementation(commonDependency("junit:junit"))
|
||||
testImplementation(libs.junit4)
|
||||
|
||||
testCompileOnly(project(":kotlin-reflect-api"))
|
||||
testRuntimeOnly(project(":kotlin-reflect"))
|
||||
|
||||
@@ -83,7 +83,7 @@ dependencies {
|
||||
testImplementation(projectTests(":generators:test-generator"))
|
||||
|
||||
testImplementation(projectTests(":js:js.tests"))
|
||||
testApi(commonDependency("junit:junit"))
|
||||
testApi(libs.junit4)
|
||||
testApi(project(":kotlin-test:kotlin-test-jvm"))
|
||||
|
||||
// Dependencies for Kotlin/Native test infra:
|
||||
@@ -147,7 +147,7 @@ dependencies {
|
||||
|
||||
testImplementation("org.jetbrains.kotlinx:atomicfu:0.21.0")
|
||||
|
||||
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.9.1")
|
||||
testRuntimeOnly(libs.junit.vintage.engine)
|
||||
}
|
||||
|
||||
optInToExperimentalCompilerApi()
|
||||
|
||||
@@ -40,7 +40,7 @@ dependencies {
|
||||
compileOnly(intellijCore())
|
||||
compileOnly(commonDependency("org.jetbrains.intellij.deps:asm-all"))
|
||||
|
||||
testImplementation(commonDependency("junit:junit"))
|
||||
testImplementation(libs.junit4)
|
||||
testImplementation(projectTests(":compiler:tests-common"))
|
||||
testImplementation(projectTests(":compiler:incremental-compilation-impl"))
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ dependencies {
|
||||
|
||||
testRuntimeOnly(project(":core:descriptors.runtime"))
|
||||
|
||||
testApi(commonDependency("junit:junit"))
|
||||
testApi(libs.junit4)
|
||||
|
||||
testRuntimeOnly(libs.guava)
|
||||
testRuntimeOnly(commonDependency("org.codehaus.woodstox:stax2-api"))
|
||||
|
||||
@@ -53,7 +53,7 @@ dependencies {
|
||||
testRuntimeOnly(commonDependency("com.fasterxml:aalto-xml"))
|
||||
testRuntimeOnly("com.jetbrains.intellij.platform:util-xml-dom:$intellijVersion") { isTransitive = false }
|
||||
|
||||
testApi(commonDependency("junit:junit"))
|
||||
testApi(libs.junit4)
|
||||
|
||||
robolectricDependency("org.robolectric:android-all:5.0.2_r3-robolectric-r0")
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ dependencies {
|
||||
}
|
||||
|
||||
testRuntimeOnly(files("${rootProject.projectDir}/dist/kotlinc/lib/kotlin-reflect.jar"))
|
||||
testRuntimeOnly(platform(commonDependency("org.junit:junit-bom")))
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter")
|
||||
testRuntimeOnly(platform(libs.junit.bom))
|
||||
testRuntimeOnly(libs.junit.jupyter)
|
||||
|
||||
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
||||
testRuntimeOnly(project(":core:descriptors.runtime"))
|
||||
|
||||
@@ -24,7 +24,7 @@ dependencies {
|
||||
testApi(projectTests(":compiler:test-infrastructure-utils"))
|
||||
|
||||
testImplementation(projectTests(":compiler:tests-common"))
|
||||
testImplementation(commonDependency("junit:junit"))
|
||||
testImplementation(libs.junit4)
|
||||
|
||||
testRuntimeOnly(project(":core:descriptors.runtime"))
|
||||
testRuntimeOnly(project(":compiler:fir:fir-serialization"))
|
||||
|
||||
@@ -32,7 +32,7 @@ dependencies {
|
||||
testApi(project(":compiler:cli-common"))
|
||||
testApi(project(":compiler:frontend.java"))
|
||||
testApi(projectTests(":compiler:tests-common"))
|
||||
testApi(commonDependency("junit:junit"))
|
||||
testApi(libs.junit4)
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
@@ -32,7 +32,7 @@ dependencies {
|
||||
testApi(project(":compiler:cli-common"))
|
||||
testApi(project(":compiler:frontend.java"))
|
||||
testApi(projectTests(":compiler:tests-common"))
|
||||
testApi(commonDependency("junit:junit"))
|
||||
testApi(libs.junit4)
|
||||
|
||||
testImplementation(intellijCore())
|
||||
testImplementation(commonDependency("org.jetbrains.kotlinx", "kotlinx-coroutines-core"))
|
||||
|
||||
@@ -19,7 +19,7 @@ val embeddableTestRuntime by configurations.creating {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
allTestsRuntime(commonDependency("junit"))
|
||||
allTestsRuntime(libs.junit4)
|
||||
testApi(kotlinStdlib("jdk8"))
|
||||
testApi(project(":kotlin-scripting-ide-services-unshaded"))
|
||||
testApi(project(":kotlin-scripting-compiler"))
|
||||
|
||||
@@ -21,7 +21,7 @@ dependencies {
|
||||
testApi(project(":compiler:cli-common"))
|
||||
testApi(project(":daemon-common"))
|
||||
testApi(project(":kotlin-daemon-client"))
|
||||
testApi(commonDependency("junit:junit"))
|
||||
testApi(libs.junit4)
|
||||
testApi(project(":kotlin-test:kotlin-test-jvm"))
|
||||
testApi(project(":kotlin-test:kotlin-test-junit"))
|
||||
testCompilerClasspath(project(":kotlin-compiler"))
|
||||
|
||||
@@ -22,7 +22,7 @@ dependencies {
|
||||
runtimeOnly(commonDependency("org.jetbrains.kotlin:kotlin-reflect")) { isTransitive = false }
|
||||
runtimeOnly(project(":kotlin-daemon-embeddable"))
|
||||
runtimeOnly(commonDependency("org.jetbrains.intellij.deps", "trove4j"))
|
||||
testApi(commonDependency("junit:junit"))
|
||||
testApi(libs.junit4)
|
||||
testApi(project(":kotlin-test:kotlin-test-junit"))
|
||||
testCompilationClasspath(kotlinStdlib())
|
||||
}
|
||||
|
||||
@@ -14,12 +14,15 @@ 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 {
|
||||
@@ -197,39 +200,43 @@ fun Project.testApiJUnit5(
|
||||
jupiterParams: Boolean = false
|
||||
) {
|
||||
with(dependencies) {
|
||||
val platformVersion = commonDependencyVersion("org.junit", "junit-bom")
|
||||
testApi(platform("org.junit:junit-bom:$platformVersion"))
|
||||
testApi("org.junit.jupiter:junit-jupiter")
|
||||
val libsVersionCatalog = libsVersionCatalog
|
||||
testApi(platform(libsVersionCatalog.findLibrary("junit-bom").orElseThrow { GradleException("No version for `junit-bom`") }))
|
||||
testApi(libsVersionCatalog.findLibrary("junit-jupyter").orElseThrow { GradleException("No version for `junit-jupyter`") })
|
||||
if (vintageEngine) {
|
||||
testApi("org.junit.vintage:junit-vintage-engine:$platformVersion")
|
||||
testRuntimeOnly(
|
||||
libsVersionCatalog.findLibrary("junit-vintage-engine")
|
||||
.orElseThrow { GradleException("No version for `junit-vintage-engine`") })
|
||||
}
|
||||
|
||||
if (jupiterParams) {
|
||||
testApi("org.junit.jupiter:junit-jupiter-params:$platformVersion")
|
||||
testApi(
|
||||
libsVersionCatalog.findLibrary("junit-jupyter-params")
|
||||
.orElseThrow { GradleException("No version for `junit-jupyter-params`") })
|
||||
}
|
||||
|
||||
val componentsVersion = commonDependencyVersion("org.junit.platform", "")
|
||||
|
||||
val components = mutableListOf(
|
||||
"org.junit.platform:junit-platform-commons",
|
||||
"org.junit.platform:junit-platform-launcher"
|
||||
)
|
||||
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) {
|
||||
components += "org.junit.platform:junit-platform-runner"
|
||||
testApi(
|
||||
libsVersionCatalog.findLibrary("junit-platform-runner")
|
||||
.orElseThrow { GradleException("No version for `junit-platform-runner`") })
|
||||
}
|
||||
if (suiteApi) {
|
||||
components += "org.junit.platform:junit-platform-suite-api"
|
||||
}
|
||||
|
||||
for (component in components) {
|
||||
testApi("$component:$componentsVersion")
|
||||
testApi(
|
||||
libsVersionCatalog.findLibrary("junit-platform-suite-api")
|
||||
.orElseThrow { GradleException("No version for `junit-platform-suite-api`") })
|
||||
}
|
||||
|
||||
// This dependency is needed only for FileComparisonFailure
|
||||
add("testImplementation", intellijJavaRt())
|
||||
testImplementation(intellijJavaRt())
|
||||
|
||||
// This is needed only for using FileComparisonFailure, which relies on JUnit 3 classes
|
||||
add("testRuntimeOnly", commonDependency("junit:junit"))
|
||||
testRuntimeOnly(libsVersionCatalog.findLibrary("junit4").orElseThrow { GradleException("No version for `junit4`") })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,6 +244,14 @@ 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"
|
||||
|
||||
@@ -54,7 +54,7 @@ dependencies {
|
||||
|
||||
implementation(kotlinStdlib())
|
||||
implementation(kotlinxCollectionsImmutable())
|
||||
testImplementation(commonDependency("junit:junit"))
|
||||
testImplementation(libs.junit4)
|
||||
testCompileOnly(project(":kotlin-test:kotlin-test-jvm"))
|
||||
testCompileOnly(project(":kotlin-test:kotlin-test-junit"))
|
||||
testImplementation(projectTests(":compiler:tests-common"))
|
||||
|
||||
@@ -61,7 +61,7 @@ val jsShell by configurations.creating {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testApi(commonDependency("junit:junit"))
|
||||
testApi(libs.junit4)
|
||||
testApi(projectTests(":compiler:tests-common"))
|
||||
testApi(projectTests(":compiler:tests-common-new"))
|
||||
testApi(intellijCore())
|
||||
|
||||
Reference in New Issue
Block a user