[Build] Add jUnit dependencies in testApiJUnit5 to the implementation configuration

Adding these dependencies to the `api` configuration pollutes classpath for each dependant modules even if it doesn't need them. Instead, the dependencies should be declared more granularly if they're required
#KTI-1349 In Progress
This commit is contained in:
Alexander.Likhachev
2023-08-23 14:04:23 +02:00
committed by Space Team
parent 0ecbb64c64
commit 53fde520d5
45 changed files with 121 additions and 55 deletions
+2 -2
View File
@@ -17,7 +17,7 @@ dependencies {
testApi(kotlinStdlib())
testApi(projectTests(":compiler:tests-common"))
testApi(libs.junit4)
testImplementation(libs.junit4)
testApi(projectTests(":compiler:test-infrastructure"))
testApi(projectTests(":compiler:test-infrastructure-utils"))
testApi(projectTests(":compiler:tests-compiler-utils"))
@@ -29,7 +29,7 @@ dependencies {
testRuntimeOnly(intellijCore())
testRuntimeOnly(commonDependency("org.jetbrains.intellij.deps.jna:jna"))
testApi(libs.junit.platform.launcher)
testImplementation(libs.junit.platform.launcher)
}
sourceSets {
+1 -1
View File
@@ -16,7 +16,7 @@ dependencies {
testApi(kotlinStdlib())
testApi(libs.junit4)
testImplementation(libs.junit4)
testCompileOnly(project(":kotlin-test:kotlin-test-jvm"))
testCompileOnly(project(":kotlin-test:kotlin-test-junit"))
testApi(projectTests(":compiler:tests-common"))
+1 -1
View File
@@ -37,7 +37,7 @@ dependencies {
testApi(project(":compiler:backend"))
testApi(project(":compiler:cli"))
testApi(projectTests(":compiler:tests-common"))
testApi(libs.junit4)
testImplementation(libs.junit4)
}
sourceSets {
+1 -1
View File
@@ -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(libs.junit4)
testImplementation(libs.junit4)
testCompileOnly(intellijCore())
testRuntimeOnly(intellijCore())
@@ -13,7 +13,7 @@ plugins {
dependencies {
compileOnly(intellijCore())
testApi(libs.junit4)
testImplementation(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(libs.junit4)
testImplementation(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 {
api(project(":compiler:build-tools:kotlin-build-tools-api"))
compileOnly(intellijCore())
testApi(libs.junit4)
testImplementation(libs.junit4)
testApi(project(":kotlin-test:kotlin-test-junit"))
testApi(kotlinStdlib())
testApi(projectTests(":kotlin-build-common"))
@@ -10,10 +10,8 @@ import org.jetbrains.kotlin.incremental.classpathDiff.ClasspathSnapshotTestCommo
import org.jetbrains.kotlin.incremental.classpathDiff.ClasspathSnapshotTestCommon.SourceFile.JavaSourceFile
import org.jetbrains.kotlin.incremental.classpathDiff.ClasspathSnapshotTestCommon.SourceFile.KotlinSourceFile
import org.jetbrains.kotlin.incremental.classpathDiff.ClasspathSnapshotTestCommon.TestSourceFile
import org.junit.Assert.assertEquals
import org.junit.Assert.*
import org.junit.Test
import org.junit.jupiter.api.Assertions.assertFalse
import org.junit.jupiter.api.Assertions.assertTrue
import java.io.File
private val testDataDir =
@@ -11,8 +11,8 @@ dependencies {
testApi(projectTests(":compiler:tests-common-new"))
testApiJUnit5()
testApi(libs.junit.platform.runner)
testApi(libs.junit.platform.suite.api)
testImplementation(libs.junit.platform.runner)
testImplementation(libs.junit.platform.suite.api)
runtimeOnly(libs.junit.vintage.engine)
testImplementation(intellijCore())
+1
View File
@@ -10,6 +10,7 @@ dependencies {
implementation(project(":compiler:ir.serialization.common"))
compileOnly(commonDependency("org.jetbrains.intellij.deps.fastutil:intellij-deps-fastutil"))
testApiJUnit5()
testImplementation(libs.junit.jupyter.params)
testImplementation(intellijCore())
testImplementation(commonDependency("org.jetbrains.kotlin:kotlin-reflect")) { isTransitive = false }
testImplementation(projectTests(":compiler:tests-common-new"))