diff --git a/build.gradle.kts b/build.gradle.kts index 27654d86c5f..dd018fc3890 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -143,7 +143,7 @@ extra["markdownParserRepo"] = "https://teamcity.jetbrains.com/guestAuth/reposito extra["IntellijCoreDependencies"] = listOf("annotations.jar", "asm-all.jar", - "guava-*.jar", + "guava-21.0.jar", "jdom.jar", "jna.jar", "log4j.jar", diff --git a/buildSrc/src/main/kotlin/intellijPluginHelpers.kt b/buildSrc/src/main/kotlin/intellijPluginHelpers.kt index b625894cd78..62a63ef2d07 100644 --- a/buildSrc/src/main/kotlin/intellijPluginHelpers.kt +++ b/buildSrc/src/main/kotlin/intellijPluginHelpers.kt @@ -30,7 +30,10 @@ fun Project.intellijCoreDep() = intellijDep("intellij-core") fun ModuleDependency.includeJars(vararg names: String) { names.forEach { - artifact { name = it; extension = "jar" } + artifact { + name = it.removeSuffix(".jar") + extension = "jar" + } } } diff --git a/compiler/android-tests/build.gradle.kts b/compiler/android-tests/build.gradle.kts index b4c4e57f30a..49d36b03985 100644 --- a/compiler/android-tests/build.gradle.kts +++ b/compiler/android-tests/build.gradle.kts @@ -3,10 +3,6 @@ apply { plugin("kotlin") } jvmTarget = "1.6" -configureIntellijPlugin { - setExtraDependencies("jps-standalone", "jps-build-test") -} - dependencies { compile(project(":compiler:util")) compile(project(":compiler:cli")) @@ -14,6 +10,7 @@ dependencies { compile(project(":compiler:backend")) compile(projectTests(":compiler:tests-common")) compile(commonDep("junit:junit")) + compileOnly(intellijDep()) { includeJars("openapi") } testCompile(project(":compiler:incremental-compilation-impl")) testCompile(project(":core:descriptors")) @@ -21,15 +18,9 @@ dependencies { testCompile(project(":compiler:frontend.java")) testCompile(projectTests(":jps-plugin")) testCompile(commonDep("junit:junit")) -} - -afterEvaluate { - dependencies { - compileOnly(intellij { include("openapi.jar") }) - testCompile(intellij { include("openapi.jar", "idea.jar", "idea_rt.jar", "groovy-all-*.jar", "jps-builders.jar") }) - testCompile(intellijExtra("jps-standalone") { include("jps-model.jar") }) - testCompile(intellijExtra("jps-build-test")) - } + testCompile(intellijDep()) { includeJars("openapi", "idea", "idea_rt", "groovy-all-2.4.6", "jps-builders") } + testCompile(intellijDep("jps-standalone")) { includeJars("jps-model") } + testCompile(intellijDep("jps-build-test")) } sourceSets { diff --git a/compiler/backend-common/build.gradle.kts b/compiler/backend-common/build.gradle.kts index d38f5c62990..4004ff38820 100644 --- a/compiler/backend-common/build.gradle.kts +++ b/compiler/backend-common/build.gradle.kts @@ -3,22 +3,13 @@ apply { plugin("kotlin") } jvmTarget = "1.6" -configureIntellijPlugin { - setExtraDependencies("intellij-core") -} - dependencies { compile(project(":core:descriptors")) compile(project(":core:descriptors.jvm")) compile(project(":compiler:util")) compile(project(":compiler:frontend")) compile(project(":compiler:ir.tree")) -} - -afterEvaluate { - dependencies { - compileOnly(intellijCoreJar()) - } + compileOnly(intellijCoreDep()) { includeJars("intellij-core") } } sourceSets { diff --git a/compiler/backend/build.gradle.kts b/compiler/backend/build.gradle.kts index 82fd96a7292..f493bbc5036 100644 --- a/compiler/backend/build.gradle.kts +++ b/compiler/backend/build.gradle.kts @@ -3,10 +3,6 @@ apply { plugin("kotlin") } jvmTarget = "1.6" -configureIntellijPlugin { - setExtraDependencies("intellij-core") -} - dependencies { compile(project(":compiler:util")) compile(project(":compiler:backend-common")) @@ -15,13 +11,8 @@ dependencies { compile(project(":compiler:ir.tree")) compile(project(":compiler:ir.psi2ir")) compile(project(":compiler:serialization")) -} - -afterEvaluate { - dependencies { - compileOnly(intellijCoreJar()) - compileOnly(intellij { include("annotations.jar", "asm-all.jar", "trove4j.jar", "guava-*.jar") }) - } + compileOnly(intellijCoreDep()) { includeJars("intellij-core") } + compileOnly(intellijDep()) { includeJars("annotations", "asm-all", "trove4j", "guava-21.0") } } sourceSets { diff --git a/compiler/build.gradle.kts b/compiler/build.gradle.kts index f90842d6ced..3d97c224cbf 100644 --- a/compiler/build.gradle.kts +++ b/compiler/build.gradle.kts @@ -6,14 +6,6 @@ apply { plugin("kotlin") } jvmTarget = "1.6" -repositories { - androidDxJarRepo(project) -} - -configureIntellijPlugin { - setExtraDependencies("intellij-core") -} - val compilerModules: Array by rootProject.extra val otherCompilerModules = compilerModules.filter { it != path } @@ -63,11 +55,14 @@ dependencies { otherCompilerModules.forEach { testCompileOnly(project(it)) } + testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") } + testCompileOnly(intellijDep()) { includeJars("openapi", "idea", "idea_rt", "util", "asm-all") } testRuntime(projectDist(":kotlin-reflect")) testRuntime(projectDist(":kotlin-daemon-client")) testRuntime(androidDxJar()) testRuntime(files(toolsJar())) + testRuntime(intellijDep()) testJvm6ServerRuntime(projectTests(":compiler:tests-common-jvm6")) @@ -75,15 +70,6 @@ dependencies { antLauncherJar(files(toolsJar())) } -afterEvaluate { - dependencies { - testCompileOnly(intellijCoreJar()) - testCompileOnly(intellij { include("openapi.jar", "idea.jar", "idea_rt.jar", "util.jar", "asm-all.jar", - "commons-httpclient-3.1-patched.jar") }) - testRuntime(intellij()) - } -} - sourceSets { "main" {} "test" { diff --git a/compiler/cli/build.gradle.kts b/compiler/cli/build.gradle.kts index 7f4278bda17..defd1e4afb5 100644 --- a/compiler/cli/build.gradle.kts +++ b/compiler/cli/build.gradle.kts @@ -3,10 +3,6 @@ apply { plugin("kotlin") } jvmTarget = "1.8" -configureIntellijPlugin { - setExtraDependencies("intellij-core") -} - dependencies { compile(project(":compiler:util")) compile(project(":compiler:cli-common")) @@ -24,6 +20,8 @@ dependencies { compile(commonDep("org.fusesource.jansi", "jansi")) compile(commonDep("org.jline", "jline")) compile(files("${System.getProperty("java.home")}/../lib/tools.jar")) + compileOnly(intellijCoreDep()) { includeJars("intellij-core") } + compileOnly(intellijDep()) { includeIntellijCoreJarDependencies(project) } testCompile(project(":compiler:backend")) testCompile(project(":compiler:cli")) @@ -32,13 +30,6 @@ dependencies { testCompile(commonDep("junit:junit")) } -afterEvaluate { - dependencies { - compileOnly(intellijCoreJar()) - compileOnly(intellijCoreJarDependencies()) - } -} - sourceSets { "main" { projectDefault() diff --git a/compiler/cli/cli-common/build.gradle.kts b/compiler/cli/cli-common/build.gradle.kts index d9dbf66727f..8b11e3bf7a4 100644 --- a/compiler/cli/cli-common/build.gradle.kts +++ b/compiler/cli/cli-common/build.gradle.kts @@ -3,23 +3,14 @@ apply { plugin("kotlin") } jvmTarget = "1.6" -configureIntellijPlugin { - setExtraDependencies("intellij-core") -} - dependencies { compile(project(":core:util.runtime")) compile(project(":compiler:frontend")) compile(project(":compiler:frontend.java")) compile(project(":compiler:frontend.script")) compileOnly(project(":kotlin-reflect-api")) -} - -afterEvaluate { - dependencies { - compileOnly(intellijCoreJar()) - compileOnly(intellijCoreJarDependencies()) - } + compileOnly(intellijCoreDep()) { includeJars("intellij-core") } + compileOnly(intellijDep()) { includeIntellijCoreJarDependencies(project) } } sourceSets { diff --git a/compiler/compiler-runner/build.gradle.kts b/compiler/compiler-runner/build.gradle.kts index 66a5e3adb3b..f2a60bcc605 100644 --- a/compiler/compiler-runner/build.gradle.kts +++ b/compiler/compiler-runner/build.gradle.kts @@ -7,10 +7,6 @@ apply { plugin("kotlin") } jvmTarget = "1.6" -configureIntellijPlugin { - setExtraDependencies("intellij-core") -} - dependencies { compile(project(":kotlin-build-common")) compileOnly(project(":compiler:cli-common")) @@ -19,15 +15,10 @@ dependencies { compileOnly(project(":compiler:daemon-common")) compile(project(":kotlin-daemon-client")) compileOnly(project(":compiler:util")) + compileOnly(intellijCoreDep()) { includeJars("intellij-core") } runtimeOnly(projectRuntimeJar(":kotlin-compiler-embeddable")) } -afterEvaluate { - dependencies { - compileOnly(intellijCoreJar()) - } -} - sourceSets { "main" { projectDefault() } "test" {} diff --git a/compiler/conditional-preprocessor/build.gradle.kts b/compiler/conditional-preprocessor/build.gradle.kts index d7e0d44ca48..9edc1b64e16 100644 --- a/compiler/conditional-preprocessor/build.gradle.kts +++ b/compiler/conditional-preprocessor/build.gradle.kts @@ -3,10 +3,6 @@ apply { plugin("kotlin") } jvmTarget = "1.6" -configureIntellijPlugin { - setExtraDependencies("intellij-core") -} - dependencies { val compile by configurations compile(project(":compiler:cli")) @@ -15,13 +11,8 @@ dependencies { compile(project(":kotlin-build-common")) compile(commonDep("org.fusesource.jansi", "jansi")) compile(commonDep("org.jline", "jline")) -} - -afterEvaluate { - dependencies { - compileOnly(intellijCoreJar()) - compileOnly(intellijCoreJarDependencies()) - } + compileOnly(intellijCoreDep()) { includeJars("intellij-core") } + compileOnly(intellijDep()) { includeIntellijCoreJarDependencies(project) } } sourceSets { diff --git a/compiler/container/build.gradle.kts b/compiler/container/build.gradle.kts index 5aac27b5d72..13403aaa58c 100644 --- a/compiler/container/build.gradle.kts +++ b/compiler/container/build.gradle.kts @@ -3,26 +3,17 @@ apply { plugin("kotlin") } jvmTarget = "1.6" -configureIntellijPlugin { - setExtraDependencies("intellij-core") -} - dependencies { compile(project(":core:util.runtime")) compile(commonDep("javax.inject")) compileOnly(project(":kotlin-stdlib")) + compileOnly(intellijCoreDep()) { includeJars("intellij-core") } testCompile(project(":kotlin-stdlib")) testCompile(projectDist(":kotlin-test:kotlin-test-jvm")) testCompile(projectDist(":kotlin-test:kotlin-test-junit")) testCompile(commonDep("junit:junit")) -} - -afterEvaluate { - dependencies { - compileOnly(intellijCoreJar()) - testCompile(intellijCoreJar()) - testRuntime(intellij { include("trove4j.jar") }) - } + testCompile(intellijCoreDep()) { includeJars("intellij-core") } + testRuntime(intellijDep()) { includeJars("trove4j") } } sourceSets { diff --git a/compiler/daemon/build.gradle.kts b/compiler/daemon/build.gradle.kts index d7e0d44ca48..e82e6234d26 100644 --- a/compiler/daemon/build.gradle.kts +++ b/compiler/daemon/build.gradle.kts @@ -3,25 +3,15 @@ apply { plugin("kotlin") } jvmTarget = "1.6" -configureIntellijPlugin { - setExtraDependencies("intellij-core") -} - dependencies { - val compile by configurations compile(project(":compiler:cli")) compile(project(":compiler:daemon-common")) compile(project(":compiler:incremental-compilation-impl")) compile(project(":kotlin-build-common")) compile(commonDep("org.fusesource.jansi", "jansi")) compile(commonDep("org.jline", "jline")) -} - -afterEvaluate { - dependencies { - compileOnly(intellijCoreJar()) - compileOnly(intellijCoreJarDependencies()) - } + compileOnly(intellijCoreDep()) { includeJars("intellij-core") } + compileOnly(intellijDep()) { includeIntellijCoreJarDependencies(project) } } sourceSets { diff --git a/compiler/daemon/daemon-common/build.gradle.kts b/compiler/daemon/daemon-common/build.gradle.kts index 4cd23a40ed9..103e13746c0 100644 --- a/compiler/daemon/daemon-common/build.gradle.kts +++ b/compiler/daemon/daemon-common/build.gradle.kts @@ -3,23 +3,14 @@ apply { plugin("kotlin") } jvmTarget = "1.6" -configureIntellijPlugin { - setExtraDependencies("intellij-core") -} - dependencies { compile(project(":core:descriptors")) compile(project(":core:descriptors.jvm")) compile(project(":compiler:util")) compile(project(":compiler:cli-common")) compile(project(":kotlin-stdlib")) -} - -afterEvaluate { - dependencies { - compileOnly(intellijCoreJar()) - compileOnly(intellijCoreJarDependencies()) - } + compileOnly(intellijCoreDep()) { includeJars("intellij-core") } + compileOnly(intellijDep()) { includeIntellijCoreJarDependencies(project) } } sourceSets { diff --git a/compiler/frontend.java/build.gradle.kts b/compiler/frontend.java/build.gradle.kts index b5888fdbf31..32a338bb4e2 100644 --- a/compiler/frontend.java/build.gradle.kts +++ b/compiler/frontend.java/build.gradle.kts @@ -3,22 +3,13 @@ apply { plugin("kotlin") } jvmTarget = "1.6" -configureIntellijPlugin { - setExtraDependencies("intellij-core") -} - dependencies { compile(project(":core:descriptors")) compile(project(":core:descriptors.jvm")) compile(project(":compiler:util")) compile(project(":compiler:frontend")) -} - -afterEvaluate { - dependencies { - compileOnly(intellijCoreJar()) - compileOnly(intellij { include("annotations.jar", "asm-all.jar", "trove4j.jar", "guava-*.jar") }) - } + compileOnly(intellijCoreDep()) { includeJars("intellij-core") } + compileOnly(intellijDep()) { includeJars("annotations", "asm-all", "trove4j", "guava-21.0") } } sourceSets { diff --git a/compiler/frontend.script/build.gradle.kts b/compiler/frontend.script/build.gradle.kts index 50af8c7cdbb..423de9565c1 100644 --- a/compiler/frontend.script/build.gradle.kts +++ b/compiler/frontend.script/build.gradle.kts @@ -3,22 +3,13 @@ apply { plugin("kotlin") } jvmTarget = "1.6" -configureIntellijPlugin { - setExtraDependencies("intellij-core") -} - dependencies { compile(project(":compiler:util")) compile(project(":compiler:frontend")) compile(projectDist(":kotlin-stdlib")) compile(projectDist(":kotlin-reflect-api")) compile(commonDep("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { isTransitive = false } -} - -afterEvaluate { - dependencies { - compileOnly(intellijCoreJar()) - } + compileOnly(intellijCoreDep()) { includeJars("intellij-core") } } sourceSets { diff --git a/compiler/frontend/build.gradle.kts b/compiler/frontend/build.gradle.kts index 1aacbd7218e..8036d540a03 100644 --- a/compiler/frontend/build.gradle.kts +++ b/compiler/frontend/build.gradle.kts @@ -3,10 +3,6 @@ apply { plugin("kotlin") } jvmTarget = "1.6" -configureIntellijPlugin { - setExtraDependencies("intellij-core") -} - val jflexPath by configurations.creating dependencies { @@ -17,16 +13,11 @@ dependencies { compile(project(":compiler:resolution")) compile(projectDist(":kotlin-script-runtime")) compile(commonDep("io.javaslang","javaslang")) + compileOnly(intellijCoreDep()) { includeJars("intellij-core") } + compileOnly(intellijDep()) { includeJars("annotations", "trove4j", "guava-21.0") } jflexPath(commonDep("org.jetbrains.intellij.deps.jflex", "jflex")) } -afterEvaluate { - dependencies { - compileOnly(intellijCoreJar()) - compileOnly(intellij { include("annotations.jar", "trove4j.jar", "guava-*.jar") }) - } -} - sourceSets { "main" { projectDefault() } "test" {} diff --git a/compiler/incremental-compilation-impl/build.gradle.kts b/compiler/incremental-compilation-impl/build.gradle.kts index 178ec34691d..7d234ab6bcd 100644 --- a/compiler/incremental-compilation-impl/build.gradle.kts +++ b/compiler/incremental-compilation-impl/build.gradle.kts @@ -3,10 +3,6 @@ apply { plugin("kotlin") } jvmTarget = "1.6" -configureIntellijPlugin { - setExtraDependencies("intellij-core") -} - dependencies { compile(project(":core:descriptors")) compile(project(":core:descriptors.jvm")) @@ -16,20 +12,16 @@ dependencies { compile(project(":compiler:frontend.java")) compile(project(":compiler:cli")) compile(project(":kotlin-build-common")) + compileOnly(intellijCoreDep()) { includeJars("intellij-core") } + compileOnly(intellijDep()) { includeJars("annotations.jar") } + testCompile(commonDep("junit:junit")) testCompile(projectDist(":kotlin-test:kotlin-test-junit")) testCompile(projectDist(":kotlin-stdlib")) testCompile(projectTests(":kotlin-build-common")) testCompile(projectTests(":compiler:tests-common")) -} - -afterEvaluate { - dependencies { - compileOnly(intellijCoreJar()) - compileOnly(intellij { include("annotations.jar") }) - testCompile(intellijCoreJar()) - testCompile(intellij { include("annotations.jar") }) - } + testCompile(intellijCoreDep()) { includeJars("intellij-core") } + testCompile(intellijDep()) { includeJars("annotations.jar") } } sourceSets { diff --git a/compiler/ir/ir.psi2ir/build.gradle.kts b/compiler/ir/ir.psi2ir/build.gradle.kts index b46646641f2..28e41af9b81 100644 --- a/compiler/ir/ir.psi2ir/build.gradle.kts +++ b/compiler/ir/ir.psi2ir/build.gradle.kts @@ -2,21 +2,12 @@ apply { plugin("kotlin") } jvmTarget = "1.6" -configureIntellijPlugin { - setExtraDependencies("intellij-core") -} - dependencies { compile(project(":compiler:util")) compile(project(":compiler:frontend")) compile(project(":compiler:backend-common")) compile(project(":compiler:ir.tree")) -} - -afterEvaluate { - dependencies { - compileOnly(intellijCoreJar()) - } + compileOnly(intellijCoreDep()) { includeJars("intellij-core") } } sourceSets { diff --git a/compiler/light-classes/build.gradle.kts b/compiler/light-classes/build.gradle.kts index 35a6287f75f..cb6c8ce89e1 100644 --- a/compiler/light-classes/build.gradle.kts +++ b/compiler/light-classes/build.gradle.kts @@ -3,22 +3,13 @@ apply { plugin("kotlin") } jvmTarget = "1.6" -configureIntellijPlugin { - setExtraDependencies("intellij-core") -} - dependencies { compile(project(":compiler:util")) compile(project(":compiler:backend")) compile(project(":compiler:frontend")) compile(project(":compiler:frontend.java")) -} - -afterEvaluate { - dependencies { - compileOnly(intellijCoreJar()) - compileOnly(intellij { include("annotations.jar", "asm-all.jar", "trove4j.jar", "guava-*.jar") }) - } + compileOnly(intellijCoreDep()) { includeJars("intellij-core") } + compileOnly(intellijDep()) { includeJars("annotations", "asm-all", "trove4j", "guava-21.0") } } sourceSets { diff --git a/compiler/plugin-api/build.gradle.kts b/compiler/plugin-api/build.gradle.kts index 1d5a309ff0a..ab9a89c0c18 100644 --- a/compiler/plugin-api/build.gradle.kts +++ b/compiler/plugin-api/build.gradle.kts @@ -3,19 +3,10 @@ apply { plugin("kotlin") } jvmTarget = "1.6" -configureIntellijPlugin { - setExtraDependencies("intellij-core") -} - dependencies { compile(project(":compiler:util")) compile(project(":compiler:frontend")) -} - -afterEvaluate { - dependencies { - compileOnly(intellijCoreJar()) - } + compileOnly(intellijCoreDep()) { includeJars("intellij-core") } } sourceSets { diff --git a/compiler/preloader/build.gradle.kts b/compiler/preloader/build.gradle.kts index 98b5864bc00..4476f196388 100644 --- a/compiler/preloader/build.gradle.kts +++ b/compiler/preloader/build.gradle.kts @@ -5,12 +5,8 @@ apply { plugin("kotlin") } jvmTarget = "1.6" -configureIntellijPlugin() - -afterEvaluate { - dependencies { - compileOnly(intellij { include("asm-all.jar") }) - } +dependencies { + compileOnly(intellijDep()) { includeJars("asm-all") } } sourceSets { diff --git a/compiler/resolution/build.gradle.kts b/compiler/resolution/build.gradle.kts index bc207c9a037..0f2468ddb83 100644 --- a/compiler/resolution/build.gradle.kts +++ b/compiler/resolution/build.gradle.kts @@ -3,17 +3,10 @@ apply { plugin("kotlin") } jvmTarget = "1.6" -configureIntellijPlugin() - dependencies { compile(project(":compiler:util")) compile(project(":core:descriptors")) -} - -afterEvaluate { - dependencies { - compileOnly(intellij { include("trove4j.jar") }) - } + compileOnly(intellijDep()) { includeJars("trove4j") } } sourceSets { diff --git a/compiler/tests-java8/build.gradle.kts b/compiler/tests-java8/build.gradle.kts index 24ac024fe18..5ca48c856fb 100644 --- a/compiler/tests-java8/build.gradle.kts +++ b/compiler/tests-java8/build.gradle.kts @@ -2,21 +2,13 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile apply { plugin("kotlin") } -configureIntellijPlugin { - setExtraDependencies("intellij-core") -} - dependencies { testCompile(projectTests(":compiler:tests-common")) + testCompile(projectTests(":compiler")) + testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") } testCompile(projectTests(":generators:test-generator")) testRuntime(projectDist(":kotlin-reflect")) -} - -afterEvaluate { - dependencies { - testCompileOnly(intellijCoreJar()) - testRuntime(intellij()) - } + testRuntime(intellijDep()) } sourceSets {