diff --git a/compiler/cli/build.gradle.kts b/compiler/cli/build.gradle.kts index d2db0982247..d3ac9770a8c 100644 --- a/compiler/cli/build.gradle.kts +++ b/compiler/cli/build.gradle.kts @@ -30,7 +30,7 @@ dependencies { compile(project(":kotlin-util-io")) compile(project(":compiler:ir.serialization.common")) - compile(toolsJar()) + compileOnly(toolsJar()) compileOnly(intellijCoreDep()) { includeJars("intellij-core") } compileOnly(intellijDep()) { includeIntellijCoreJarDependencies(project) } diff --git a/compiler/tests-common/build.gradle.kts b/compiler/tests-common/build.gradle.kts index ddae588b9e7..ba6086479c8 100644 --- a/compiler/tests-common/build.gradle.kts +++ b/compiler/tests-common/build.gradle.kts @@ -38,11 +38,12 @@ dependencies { testCompileOnly(project(":plugins:android-extensions-compiler")) testCompile(project(":kotlin-test:kotlin-test-jvm")) testCompile(projectTests(":compiler:tests-common-jvm6")) - testCompileOnly(project(":kotlin-reflect-api")) testCompile(project(":kotlin-scripting-compiler-impl")) testCompile(commonDep("junit:junit")) testCompile(androidDxJar()) { isTransitive = false } testCompile(commonDep("com.android.tools:r8")) + testCompileOnly(project(":kotlin-reflect-api")) + testCompileOnly(toolsJar()) testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") } Platform[193].orLower { testCompile(intellijDep()) { includeJars("openapi", "picocontainer", rootProject = rootProject) } diff --git a/compiler/tests-java8/build.gradle.kts b/compiler/tests-java8/build.gradle.kts index f0eefc9e18c..da8c7ef9a34 100644 --- a/compiler/tests-java8/build.gradle.kts +++ b/compiler/tests-java8/build.gradle.kts @@ -11,6 +11,7 @@ dependencies { testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") } testCompile(projectTests(":generators:test-generator")) testRuntime(project(":kotlin-reflect")) + testRuntimeOnly(toolsJar()) testRuntime(intellijDep()) Platform[192].orHigher { testRuntimeOnly(intellijPluginDep("java")) diff --git a/idea/build.gradle.kts b/idea/build.gradle.kts index f003025088b..855e70e5e9c 100644 --- a/idea/build.gradle.kts +++ b/idea/build.gradle.kts @@ -97,6 +97,7 @@ dependencies { compileOnly(intellijPluginDep("java-i18n")) compileOnly(intellijPluginDep("gradle")) + testCompileOnly(toolsJar()) testCompileOnly(project(":kotlin-reflect-api")) // TODO: fix import (workaround for jps build) testCompile(project(":kotlin-test:kotlin-test-junit")) testCompile(projectTests(":compiler:tests-common")) @@ -109,8 +110,8 @@ dependencies { testCompile(commonDep("junit:junit")) testCompileOnly(intellijPluginDep("coverage")) + testRuntimeOnly(toolsJar()) testRuntime(project(":native:kotlin-native-utils")) { isTransitive = false } - testRuntime(commonDep("org.jetbrains", "markdown")) testRuntime(project(":plugins:kapt3-idea")) { isTransitive = false } testRuntime(project(":kotlin-reflect")) diff --git a/idea/idea-gradle-native/build.gradle.kts b/idea/idea-gradle-native/build.gradle.kts index ae655db0325..7ae91230a3d 100644 --- a/idea/idea-gradle-native/build.gradle.kts +++ b/idea/idea-gradle-native/build.gradle.kts @@ -40,6 +40,7 @@ dependencies { compileOnly(intellijPluginDep("java")) } + testRuntimeOnly(toolsJar()) testRuntime(project(":kotlin-reflect")) testRuntime(project(":idea:idea-jvm")) testRuntime(project(":idea:idea-android")) diff --git a/idea/idea-gradle/build.gradle.kts b/idea/idea-gradle/build.gradle.kts index 36f58ab4dc3..9d9259a2f5e 100644 --- a/idea/idea-gradle/build.gradle.kts +++ b/idea/idea-gradle/build.gradle.kts @@ -53,6 +53,7 @@ dependencies { testRuntime(project(":native:kotlin-native-utils")) { isTransitive = false } testRuntime(project(":idea:idea-new-project-wizard")) + testRuntimeOnly(toolsJar()) testRuntime(project(":kotlin-reflect")) testRuntime(project(":idea:idea-jvm")) testRuntime(project(":idea:idea-android")) diff --git a/idea/idea-jvm/build.gradle.kts b/idea/idea-jvm/build.gradle.kts index 1a320c509cf..6fedc43fa83 100644 --- a/idea/idea-jvm/build.gradle.kts +++ b/idea/idea-jvm/build.gradle.kts @@ -9,6 +9,8 @@ dependencies { compile(project(":compiler:light-classes")) compile(project(":compiler:frontend.java")) compile(project(":compiler:backend.jvm")) + + compileOnly(toolsJar()) compileOnly(intellijDep()) compileOnly(commonDep("com.google.code.findbugs", "jsr305")) diff --git a/idea/idea-maven/build.gradle.kts b/idea/idea-maven/build.gradle.kts index 086c2a238d0..301201406d4 100644 --- a/idea/idea-maven/build.gradle.kts +++ b/idea/idea-maven/build.gradle.kts @@ -45,6 +45,7 @@ dependencies { testRuntime(project(":native:frontend.native")) { isTransitive = false } testRuntime(project(":native:kotlin-native-utils")) { isTransitive = false } + testRuntimeOnly(toolsJar()) testRuntime(project(":kotlin-reflect")) testRuntime(project(":idea:idea-jvm")) testRuntime(project(":idea:idea-android")) diff --git a/idea/jvm-debugger/eval4j/build.gradle.kts b/idea/jvm-debugger/eval4j/build.gradle.kts index c11ccf19208..7e96914b99d 100644 --- a/idea/jvm-debugger/eval4j/build.gradle.kts +++ b/idea/jvm-debugger/eval4j/build.gradle.kts @@ -6,8 +6,11 @@ plugins { dependencies { compile(kotlinStdlib()) compile(project(":compiler:backend")) - compile(toolsJar()) + + compileOnly(toolsJar()) compileOnly(intellijCoreDep()) { includeJars("intellij-core", "asm-all", rootProject = rootProject) } + + testCompileOnly(toolsJar()) testCompile(project(":kotlin-test:kotlin-test-junit")) testCompile(commonDep("junit:junit")) testCompile(intellijDep()) { includeJars("asm-all", rootProject = rootProject) } diff --git a/idea/jvm-debugger/jvm-debugger-core/build.gradle.kts b/idea/jvm-debugger/jvm-debugger-core/build.gradle.kts index cf6d7e1e8f9..025847cdce3 100644 --- a/idea/jvm-debugger/jvm-debugger-core/build.gradle.kts +++ b/idea/jvm-debugger/jvm-debugger-core/build.gradle.kts @@ -10,8 +10,8 @@ dependencies { compile(project(":idea:idea-core")) compile(project(":idea:ide-common")) compile(project(":idea:jvm-debugger:jvm-debugger-util")) - compile(toolsJar()) + compileOnly(toolsJar()) compileOnly(intellijDep()) Platform[192].orHigher { diff --git a/idea/jvm-debugger/jvm-debugger-coroutine/build.gradle.kts b/idea/jvm-debugger/jvm-debugger-coroutine/build.gradle.kts index cae70c883be..ad1756c169b 100644 --- a/idea/jvm-debugger/jvm-debugger-coroutine/build.gradle.kts +++ b/idea/jvm-debugger/jvm-debugger-coroutine/build.gradle.kts @@ -6,6 +6,7 @@ plugins { dependencies { compile(project(":idea:jvm-debugger:jvm-debugger-core")) + compileOnly(toolsJar()) compileOnly(intellijDep()) Platform[192].orHigher { diff --git a/idea/jvm-debugger/jvm-debugger-evaluation/build.gradle.kts b/idea/jvm-debugger/jvm-debugger-evaluation/build.gradle.kts index b53ef6ebe7b..11276b4fd8f 100644 --- a/idea/jvm-debugger/jvm-debugger-evaluation/build.gradle.kts +++ b/idea/jvm-debugger/jvm-debugger-evaluation/build.gradle.kts @@ -9,7 +9,8 @@ dependencies { compile(project(":idea:idea-core")) compile(project(":idea:idea-j2k")) compile(project(":idea:jvm-debugger:jvm-debugger-util")) - compile(toolsJar()) + + compileOnly(toolsJar()) Platform[192].orHigher { compileOnly(intellijPluginDep("java")) } diff --git a/idea/jvm-debugger/jvm-debugger-sequence/build.gradle.kts b/idea/jvm-debugger/jvm-debugger-sequence/build.gradle.kts index 03ba33bb324..e40f00bbd00 100644 --- a/idea/jvm-debugger/jvm-debugger-sequence/build.gradle.kts +++ b/idea/jvm-debugger/jvm-debugger-sequence/build.gradle.kts @@ -6,8 +6,8 @@ plugins { dependencies { compile(project(":compiler:backend")) compile(project(":idea:ide-common")) - compile(toolsJar()) + compileOnly(toolsJar()) compileOnly(intellijDep()) Platform[192].orHigher { compileOnly(intellijPluginDep("java")) diff --git a/idea/jvm-debugger/jvm-debugger-util/build.gradle.kts b/idea/jvm-debugger/jvm-debugger-util/build.gradle.kts index 6aa41550415..c75661e3e85 100644 --- a/idea/jvm-debugger/jvm-debugger-util/build.gradle.kts +++ b/idea/jvm-debugger/jvm-debugger-util/build.gradle.kts @@ -11,8 +11,8 @@ dependencies { // TODO: get rid of this compile(project(":idea:jvm-debugger:eval4j")) - compile(toolsJar()) - + compileOnly(toolsJar()) + Platform[192].orHigher { compileOnly(intellijPluginDep("java")) } diff --git a/idea/scripting-support/build.gradle.kts b/idea/scripting-support/build.gradle.kts index 6c00894da9e..c278b254b2c 100644 --- a/idea/scripting-support/build.gradle.kts +++ b/idea/scripting-support/build.gradle.kts @@ -34,6 +34,7 @@ dependencies { testRuntime(intellijPluginDep("java")) } + testRuntimeOnly(toolsJar()) testRuntime(project(":kotlin-reflect")) testCompileOnly(intellijDep()) diff --git a/j2k/build.gradle.kts b/j2k/build.gradle.kts index cccc10582da..d4360d1e6a0 100644 --- a/j2k/build.gradle.kts +++ b/j2k/build.gradle.kts @@ -32,6 +32,7 @@ dependencies { testCompile(project(":idea:idea-native")) { isTransitive = false } testCompile(project(":idea:idea-gradle-native")) { isTransitive = false } + testRuntimeOnly(toolsJar()) testRuntime(project(":native:frontend.native")) { isTransitive = false } testRuntime(project(":native:kotlin-native-utils")) { isTransitive = false } testRuntime(project(":plugins:kapt3-idea")) { isTransitive = false } diff --git a/jps-plugin/build.gradle.kts b/jps-plugin/build.gradle.kts index cc33028f21c..fa47a71a2f4 100644 --- a/jps-plugin/build.gradle.kts +++ b/jps-plugin/build.gradle.kts @@ -48,6 +48,7 @@ dependencies { testRuntimeOnly(intellijPluginDep("java")) } + testRuntimeOnly(toolsJar()) testRuntime(project(":kotlin-reflect")) testRuntime(project(":kotlin-script-runtime")) } diff --git a/nj2k/build.gradle.kts b/nj2k/build.gradle.kts index 4f95fdacea6..8da9340de12 100644 --- a/nj2k/build.gradle.kts +++ b/nj2k/build.gradle.kts @@ -35,6 +35,7 @@ dependencies { testCompileOnly(intellijDep()) + testRuntimeOnly(toolsJar()) testRuntime(project(":idea:idea-jvm")) testRuntime(project(":sam-with-receiver-ide-plugin")) testRuntime(project(":allopen-ide-plugin")) diff --git a/plugins/kapt3/kapt3-base/build.gradle.kts b/plugins/kapt3/kapt3-base/build.gradle.kts index e33fcefa383..450a64ce60b 100644 --- a/plugins/kapt3/kapt3-base/build.gradle.kts +++ b/plugins/kapt3/kapt3-base/build.gradle.kts @@ -5,8 +5,10 @@ plugins { dependencies { compile(kotlinStdlib()) - compile(toolsJar()) + compileOnly(toolsJar()) + testCompile(commonDep("junit:junit")) + testCompileOnly(toolsJar()) } sourceSets { diff --git a/plugins/kapt3/kapt3-compiler/build.gradle.kts b/plugins/kapt3/kapt3-compiler/build.gradle.kts index 5d9141b5a6a..f7e7cde4a21 100644 --- a/plugins/kapt3/kapt3-compiler/build.gradle.kts +++ b/plugins/kapt3/kapt3-compiler/build.gradle.kts @@ -26,6 +26,8 @@ dependencies { compile(project(":compiler:frontend")) compile(project(":compiler:frontend.java")) compile(project(":compiler:plugin-api")) + + compileOnly(toolsJar()) compileOnly(project(":kotlin-annotation-processing-cli")) compileOnly(project(":kotlin-annotation-processing-base")) compileOnly(project(":kotlin-annotation-processing-runtime")) @@ -37,6 +39,8 @@ dependencies { testCompile(projectTests(":kotlin-annotation-processing-base")) testCompile(commonDep("junit:junit")) testCompile(project(":kotlin-annotation-processing-runtime")) + testCompileOnly(toolsJar()) + testRuntimeOnly(toolsJar()) embedded(project(":kotlin-annotation-processing-runtime")) { isTransitive = false } embedded(project(":kotlin-annotation-processing-cli")) { isTransitive = false } diff --git a/plugins/uast-kotlin/build.gradle.kts b/plugins/uast-kotlin/build.gradle.kts index 795398a3147..afb8b674252 100644 --- a/plugins/uast-kotlin/build.gradle.kts +++ b/plugins/uast-kotlin/build.gradle.kts @@ -38,6 +38,7 @@ dependencies { testCompile(project(":idea:idea-native")) { isTransitive = false } testCompile(project(":idea:idea-gradle-native")) { isTransitive = false } + testRuntimeOnly(toolsJar()) testRuntime(project(":native:frontend.native")) { isTransitive = false } testRuntime(project(":native:kotlin-native-utils")) { isTransitive = false } testRuntime(project(":kotlin-reflect"))