diff --git a/analysis/low-level-api-fir/build.gradle.kts b/analysis/low-level-api-fir/build.gradle.kts index 87d8cfc4f50..bd9b0408d89 100644 --- a/analysis/low-level-api-fir/build.gradle.kts +++ b/analysis/low-level-api-fir/build.gradle.kts @@ -35,22 +35,17 @@ dependencies { testApi(project(":kotlin-reflect")) testImplementation(project(":analysis:symbol-light-classes")) - testRuntimeOnly(intellijDep()) { + testApi(intellijDep()) { includeJars( "jps-model", - "extensions", - "util", "platform-api", "platform-impl", - "idea", "guava", "trove4j", "asm-all", "log4j", "jdom", "streamex", - "bootstrap", - "jna", rootProject = rootProject ) } diff --git a/compiler/build.gradle.kts b/compiler/build.gradle.kts index 9e7eed1c8a9..46d130c3ecf 100644 --- a/compiler/build.gradle.kts +++ b/compiler/build.gradle.kts @@ -12,7 +12,7 @@ val otherCompilerModules = compilerModules.filter { it != path } val antLauncherJar by configurations.creating dependencies { - testImplementation(intellijDep()) // Should come before compiler, because of "progarded" stuff needed for tests + testImplementation(intellijDep()) { includeJars("platform-impl", rootProject = rootProject) } // Should come before compiler, because of "progarded" stuff needed for tests testApi(project(":kotlin-script-runtime")) testApi(project(":kotlin-test:kotlin-test-jvm")) @@ -37,7 +37,15 @@ dependencies { testCompileOnly(project(it)) } testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") } - testCompileOnly(intellijDep()) { includeJars("idea", "idea_rt", "util", "asm-all", rootProject = rootProject) } + + testRuntimeOnly(intellijDep()) { + includeJars( + "jps-model", + "streamex", + "idea_rt", + rootProject = rootProject + ) + } testRuntimeOnly(intellijPluginDep("java")) diff --git a/compiler/fir/analysis-tests/build.gradle.kts b/compiler/fir/analysis-tests/build.gradle.kts index 0b81eb42172..9d1c109346d 100644 --- a/compiler/fir/analysis-tests/build.gradle.kts +++ b/compiler/fir/analysis-tests/build.gradle.kts @@ -33,10 +33,9 @@ dependencies { testImplementation(intellijCoreDep()) { includeJars("intellij-core") } testRuntimeOnly(intellijDep()) { - includeJars("jna", rootProject = rootProject) + includeJars("intellij-deps-fastutil-8.4.1-4", "jps-model", "streamex", "jna", rootProject = rootProject) } - testRuntimeOnly(intellijDep()) { includeJars("intellij-deps-fastutil-8.4.1-4") } testRuntimeOnly(toolsJar()) } diff --git a/compiler/fir/analysis-tests/legacy-fir-tests/build.gradle.kts b/compiler/fir/analysis-tests/legacy-fir-tests/build.gradle.kts index 0f3003c503c..c28c64d8ede 100644 --- a/compiler/fir/analysis-tests/legacy-fir-tests/build.gradle.kts +++ b/compiler/fir/analysis-tests/legacy-fir-tests/build.gradle.kts @@ -13,8 +13,6 @@ plugins { dependencies { compileOnly(intellijCoreDep()) { includeJars("intellij-core", "guava", rootProject = rootProject) } - testApi(intellijDep()) - testApi(commonDep("junit:junit")) testCompileOnly(project(":kotlin-test:kotlin-test-jvm")) testCompileOnly(project(":kotlin-test:kotlin-test-junit")) @@ -30,6 +28,7 @@ dependencies { testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") } testRuntimeOnly(intellijCoreDep()) { includeJars("intellij-core") } + testRuntimeOnly(intellijDep()) { includeJars("idea_rt", "streamex", "jps-model", rootProject = rootProject) } } val generationRoot = projectDir.resolve("tests-gen") diff --git a/compiler/fir/fir2ir/build.gradle.kts b/compiler/fir/fir2ir/build.gradle.kts index f3ba1fbdc67..2e356d45789 100644 --- a/compiler/fir/fir2ir/build.gradle.kts +++ b/compiler/fir/fir2ir/build.gradle.kts @@ -43,7 +43,7 @@ dependencies { includeJars("jna", rootProject = rootProject) } - testRuntimeOnly(intellijDep()) { includeJars("intellij-deps-fastutil-8.4.1-4") } + testRuntimeOnly(intellijDep()) { includeJars("intellij-deps-fastutil-8.4.1-4", "jps-model", "streamex", rootProject = rootProject) } } val generationRoot = projectDir.resolve("tests-gen") diff --git a/compiler/fir/modularized-tests/build.gradle.kts b/compiler/fir/modularized-tests/build.gradle.kts index f8b6526eee9..de6a0c08a0b 100644 --- a/compiler/fir/modularized-tests/build.gradle.kts +++ b/compiler/fir/modularized-tests/build.gradle.kts @@ -15,14 +15,14 @@ repositories { } dependencies { - testCompileOnly(intellijDep()) { + testApi(intellijCoreDep()) { includeJars("intellij-core")} + testApi(intellijDep()) { includeJars("extensions", "idea_rt", "util", "asm-all", "jna", rootProject = rootProject) } testCompileOnly(intellijPluginDep("java")) { includeJars("java-api") } testRuntimeOnly("xerces:xercesImpl:2.12.0") - testRuntimeOnly(intellijDep()) testRuntimeOnly(intellijPluginDep("java")) testApi(commonDep("junit:junit")) diff --git a/compiler/fir/raw-fir/light-tree2fir/build.gradle.kts b/compiler/fir/raw-fir/light-tree2fir/build.gradle.kts index 7839f8fe0bd..39c48f71d5a 100644 --- a/compiler/fir/raw-fir/light-tree2fir/build.gradle.kts +++ b/compiler/fir/raw-fir/light-tree2fir/build.gradle.kts @@ -23,7 +23,6 @@ dependencies { compileOnly(intellijCoreDep()) { includeJars("intellij-core", "guava", rootProject = rootProject) } - testImplementation(intellijDep()) testImplementation(commonDep("junit:junit")) testImplementation(projectTests(":compiler:tests-common")) testImplementation(projectTests(":compiler:fir:raw-fir:psi2fir")) diff --git a/compiler/fir/raw-fir/psi2fir/build.gradle.kts b/compiler/fir/raw-fir/psi2fir/build.gradle.kts index 881ec8a0643..1dff3a6dbeb 100644 --- a/compiler/fir/raw-fir/psi2fir/build.gradle.kts +++ b/compiler/fir/raw-fir/psi2fir/build.gradle.kts @@ -17,7 +17,7 @@ dependencies { compileOnly(intellijCoreDep()) { includeJars("intellij-core", "guava", rootProject = rootProject) } - testImplementation(intellijDep()) + testImplementation(intellijDep()) { includeJars("platform-api", rootProject = rootProject) } testImplementation(commonDep("junit:junit")) testImplementation(projectTests(":compiler:tests-common")) diff --git a/compiler/incremental-compilation-impl/build.gradle.kts b/compiler/incremental-compilation-impl/build.gradle.kts index 9eaa1e087ee..db2680b86be 100644 --- a/compiler/incremental-compilation-impl/build.gradle.kts +++ b/compiler/incremental-compilation-impl/build.gradle.kts @@ -26,7 +26,7 @@ dependencies { testApi(intellijDep()) { includeJars("log4j", "jdom") } testRuntimeOnly(project(":kotlin-reflect")) testRuntimeOnly(project(":core:descriptors.runtime")) - testRuntimeOnly(intellijDep()) { includeJars("lz4-java", "jna", rootProject = rootProject) } + testRuntimeOnly(intellijDep()) { includeJars("lz4-java", "jna", "idea_rt", rootProject = rootProject) } } sourceSets { diff --git a/compiler/tests-common-new/build.gradle.kts b/compiler/tests-common-new/build.gradle.kts index 0ccfcbebc98..15f19930cce 100644 --- a/compiler/tests-common-new/build.gradle.kts +++ b/compiler/tests-common-new/build.gradle.kts @@ -25,11 +25,22 @@ dependencies { testApi(projectTests(":compiler:tests-compiler-utils")) testApi(projectTests(":compiler:tests-common-jvm6")) - testRuntimeOnly(intellijDep()) { - includeJars("jna", rootProject = rootProject) + /* + * Actually those dependencies are needed only at runtime, but they + * declared as Api dependencies to propagate them to all modules + * which depend on current one + */ + testApi(intellijDep()) { + includeJars( + "intellij-deps-fastutil-8.4.1-4", + "idea_rt", + "jps-model", + "platform-impl", + "streamex", + "jna", + rootProject = rootProject + ) } - - testRuntimeOnly(intellijDep()) { includeJars("intellij-deps-fastutil-8.4.1-4") } testRuntimeOnly(toolsJar()) } diff --git a/compiler/tests-common/build.gradle.kts b/compiler/tests-common/build.gradle.kts index 044de56f3e1..ecb9528ba14 100644 --- a/compiler/tests-common/build.gradle.kts +++ b/compiler/tests-common/build.gradle.kts @@ -56,20 +56,33 @@ dependencies { testCompileOnly(project(":kotlin-reflect-api")) testCompileOnly(toolsJar()) testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") } - testApi(intellijDep()) { includeJars("intellij-deps-fastutil-8.4.1-4") } + + /* + * Actually those dependencies are needed only at runtime, but they + * declared as Api dependencies to propagate them to all modules + * which depend on current one + */ testApi(intellijDep()) { + includeJars( + "intellij-deps-fastutil-8.4.1-4", + "idea_rt", + "jps-model", + "platform-impl", + "streamex", + "jna", + rootProject = rootProject + ) + } + testImplementation(intellijDep()) { includeJars( "guava", "trove4j", "asm-all", "log4j", "jdom", - "jna", rootProject = rootProject ) - isTransitive = false } - testApiJUnit5() } diff --git a/compiler/tests-compiler-utils/build.gradle.kts b/compiler/tests-compiler-utils/build.gradle.kts index f2be92ed6c5..c89bb071ef1 100644 --- a/compiler/tests-compiler-utils/build.gradle.kts +++ b/compiler/tests-compiler-utils/build.gradle.kts @@ -31,20 +31,11 @@ dependencies { testApi(intellijDep()) { includeJars( - "jps-model", - "extensions", - "util", - "platform-api", - "platform-impl", - "idea", - "idea_rt", "guava", "trove4j", "asm-all", "log4j", "jdom", - "streamex", - "bootstrap", rootProject = rootProject ) isTransitive = false diff --git a/compiler/tests-for-compiler-generator/build.gradle.kts b/compiler/tests-for-compiler-generator/build.gradle.kts index df4fb78dd2a..842c87f57e9 100644 --- a/compiler/tests-for-compiler-generator/build.gradle.kts +++ b/compiler/tests-for-compiler-generator/build.gradle.kts @@ -4,7 +4,6 @@ plugins { } dependencies { - testRuntimeOnly(intellijDep()) // Should come before compiler, because of "progarded" stuff needed for tests testImplementation(kotlinStdlib()) testApiJUnit5() diff --git a/compiler/tests-java8/build.gradle.kts b/compiler/tests-java8/build.gradle.kts index 0e4160ff7f0..7a4c1ae19f9 100644 --- a/compiler/tests-java8/build.gradle.kts +++ b/compiler/tests-java8/build.gradle.kts @@ -8,11 +8,10 @@ plugins { dependencies { testApi(project(":kotlin-scripting-compiler")) testApi(projectTests(":compiler:tests-common")) - testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") } + testImplementation(intellijCoreDep()) { includeJars("intellij-core") } testApi(projectTests(":generators:test-generator")) testRuntimeOnly(project(":kotlin-reflect")) testRuntimeOnly(toolsJar()) - testRuntimeOnly(intellijDep()) testRuntimeOnly(intellijPluginDep("java")) if (isIdeaActive) testRuntimeOnly(files("${rootProject.projectDir}/dist/kotlinc/lib/kotlin-reflect.jar")) } diff --git a/compiler/tests-spec/build.gradle.kts b/compiler/tests-spec/build.gradle.kts index a01d463c12b..ba951048a66 100644 --- a/compiler/tests-spec/build.gradle.kts +++ b/compiler/tests-spec/build.gradle.kts @@ -9,12 +9,13 @@ dependencies { testImplementation(projectTests(":compiler:tests-common-new")) testApi(intellijDep()) { - includeJars("groovy", "groovy-xml", rootProject = rootProject) - } - testApi(intellijDep()) { - includeJars("gson", rootProject = rootProject) + includeJars("gson", "groovy", "groovy-xml", rootProject = rootProject) } testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") } + testRuntimeOnly(intellijDep()) { + includeJars("streamex", rootProject = rootProject) + } + testRuntimeOnly(intellijPluginDep("java")) api("org.jsoup:jsoup:1.14.2") if (isIdeaActive) testRuntimeOnly(files("${rootProject.projectDir}/dist/kotlinc/lib/kotlin-reflect.jar")) diff --git a/core/descriptors.runtime/build.gradle.kts b/core/descriptors.runtime/build.gradle.kts index 2c57c958079..4177413dad8 100644 --- a/core/descriptors.runtime/build.gradle.kts +++ b/core/descriptors.runtime/build.gradle.kts @@ -25,8 +25,8 @@ dependencies { testApi(projectTests(":compiler:tests-common")) testApi(projectTests(":generators:test-generator")) - testRuntimeOnly(intellijCoreDep()) { includeJars("intellij-core") } - testRuntimeOnly(intellijDep()) { includeJars("platform-concurrency") } + testApi(intellijCoreDep()) { includeJars("intellij-core") } + testRuntimeOnly(intellijDep()) { includeJars("platform-concurrency", "idea_rt", rootProject = rootProject) } testRuntimeOnly(jpsStandalone()) { includeJars("jps-model") } } diff --git a/libraries/tools/kotlinp/build.gradle.kts b/libraries/tools/kotlinp/build.gradle.kts index b2bf9f941f0..6d0721cf402 100644 --- a/libraries/tools/kotlinp/build.gradle.kts +++ b/libraries/tools/kotlinp/build.gradle.kts @@ -28,9 +28,9 @@ dependencies { testRuntimeOnly(project(":kotlinx-metadata-jvm")) - testRuntimeOnly(intellijCoreDep()) { includeJars("intellij-core") } + testApi(intellijCoreDep()) { includeJars("intellij-core") } - testRuntimeOnly(intellijDep()) { includeJars("platform-concurrency", "platform-objectSerializer") } + testRuntimeOnly(intellijDep()) { includeJars("platform-concurrency", "platform-objectSerializer", "idea_rt") } shadows(project(":kotlinx-metadata-jvm")) shadows("org.jetbrains.intellij.deps:asm-all:$kotlinpAsmVersion") diff --git a/native/commonizer/build.gradle.kts b/native/commonizer/build.gradle.kts index 554a3a34368..c88776f8f43 100644 --- a/native/commonizer/build.gradle.kts +++ b/native/commonizer/build.gradle.kts @@ -40,6 +40,10 @@ dependencies { testImplementation(project(":kotlinx-metadata-klib")) { isTransitive = false } testImplementation(project(":kotlinx-metadata")) { isTransitive = false } testImplementation(project(":native:kotlin-klib-commonizer-api")) + testApi(intellijCoreDep()) { includeJars("intellij-core")} +// testRuntimeOnly(intellijDep()) { +// includeJars("idea_rt", rootProject = rootProject) +// } } val runCommonizer by tasks.registering(JavaExec::class) { diff --git a/plugins/allopen/allopen-cli/build.gradle.kts b/plugins/allopen/allopen-cli/build.gradle.kts index 547b99cad66..5a253d67de8 100644 --- a/plugins/allopen/allopen-cli/build.gradle.kts +++ b/plugins/allopen/allopen-cli/build.gradle.kts @@ -18,7 +18,7 @@ dependencies { testApi(projectTests(":compiler:tests-common")) testApi(commonDep("junit:junit")) - testRuntimeOnly(intellijCoreDep()) { includeJars("intellij-core") } + testApi(intellijCoreDep()) { includeJars("intellij-core") } } sourceSets { diff --git a/plugins/jvm-abi-gen/build.gradle.kts b/plugins/jvm-abi-gen/build.gradle.kts index e1f438f6f67..822db33f0e0 100644 --- a/plugins/jvm-abi-gen/build.gradle.kts +++ b/plugins/jvm-abi-gen/build.gradle.kts @@ -38,6 +38,7 @@ dependencies { compileOnly(intellijCoreDep()) { includeJars("intellij-core", "asm-all", rootProject = rootProject) } + testApi(intellijDep()) { includeJars("platform-impl", rootProject = rootProject) } testRuntimeOnly(intellijCoreDep()) { includeJars("intellij-core") } testRuntimeOnly(project(":kotlin-compiler")) @@ -70,4 +71,4 @@ projectTest(parallel = true) { dependsOn(shadowJar) } -testsJar() \ No newline at end of file +testsJar() diff --git a/plugins/noarg/noarg-cli/build.gradle.kts b/plugins/noarg/noarg-cli/build.gradle.kts index 71e68eda1c1..de4d1624254 100644 --- a/plugins/noarg/noarg-cli/build.gradle.kts +++ b/plugins/noarg/noarg-cli/build.gradle.kts @@ -21,8 +21,7 @@ dependencies { testApi(project(":compiler:cli")) testApi(projectTests(":compiler:tests-common")) testApi(commonDep("junit:junit")) - - testRuntimeOnly(intellijCoreDep()) { includeJars("intellij-core") } + testApi(intellijCoreDep()) { includeJars("intellij-core")} } sourceSets {