From c6a2d85c871d7bac2f24a7f3e2bfaf32bdf23186 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Mon, 31 May 2021 11:49:37 +0300 Subject: [PATCH] [Build] Remove incorrect dependency `intellijDep()` includes jars with JUnit3 and JUnit4. JUnit5 runner which is used in compiler tests sees old junit on classpath and checks if this version can be ran using Vintage test engine. Looks like recent changes in platform changed order of this jars on classpath, so now jar with JUnit3 is closer than JUnit4 (and they have same classes inside), so version checker from JUnit5 observes JUnit3 and fails with error of incompatible versions. Since old JUnits are not needed at all in those modules now only required jars from intellijDep are included --- compiler/fir/analysis-tests/build.gradle.kts | 1 - compiler/fir/fir2ir/build.gradle.kts | 31 +++++++++++++++++--- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/compiler/fir/analysis-tests/build.gradle.kts b/compiler/fir/analysis-tests/build.gradle.kts index 46a15239c0e..61155026b66 100644 --- a/compiler/fir/analysis-tests/build.gradle.kts +++ b/compiler/fir/analysis-tests/build.gradle.kts @@ -13,7 +13,6 @@ plugins { dependencies { compileOnly(intellijCoreDep()) { includeJars("intellij-core", "guava", rootProject = rootProject) } - testApi(intellijDep()) testApi(projectTests(":compiler:test-infrastructure")) testApi(projectTests(":compiler:test-infrastructure-utils")) testApi(projectTests(":compiler:tests-compiler-utils")) diff --git a/compiler/fir/fir2ir/build.gradle.kts b/compiler/fir/fir2ir/build.gradle.kts index 4f7650d24b2..e2954203e82 100644 --- a/compiler/fir/fir2ir/build.gradle.kts +++ b/compiler/fir/fir2ir/build.gradle.kts @@ -17,10 +17,6 @@ dependencies { compileOnly(intellijCoreDep()) { includeJars("intellij-core") } - testCompileOnly(intellijDep()) - - testRuntimeOnly(intellijDep()) - testCompileOnly(project(":kotlin-test:kotlin-test-jvm")) testCompileOnly(project(":kotlin-test:kotlin-test-junit")) testApi(projectTests(":compiler:test-infrastructure")) @@ -39,6 +35,33 @@ dependencies { testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") } testRuntimeOnly(intellijCoreDep()) { includeJars("intellij-core") } + + testRuntimeOnly(intellijDep()) { + includeJars( + "jps-model", + "extensions", + "util", + "platform-api", + "platform-impl", + "idea", + "guava", + "trove4j", + "asm-all", + "log4j", + "jdom", + "streamex", + "bootstrap", + "jna", + rootProject = rootProject + ) + } + + Platform[202] { + testRuntimeOnly(intellijDep()) { includeJars("intellij-deps-fastutil-8.3.1-1") } + } + Platform[203].orHigher { + testRuntimeOnly(intellijDep()) { includeJars("intellij-deps-fastutil-8.3.1-3") } + } } val generationRoot = projectDir.resolve("tests-gen")