diff --git a/plugins/allopen/allopen-cli/build.gradle.kts b/plugins/allopen/allopen-cli/build.gradle.kts index 72a3a486c60..ac9158bed14 100644 --- a/plugins/allopen/allopen-cli/build.gradle.kts +++ b/plugins/allopen/allopen-cli/build.gradle.kts @@ -3,8 +3,11 @@ description = "Kotlin AllOpen Compiler Plugin" apply { plugin("kotlin") } +configureIntellijPlugin { + setExtraDependencies("intellij-core") +} + dependencies { - compileOnly(ideaSdkCoreDeps("intellij-core")) compileOnly(project(":compiler:plugin-api")) compileOnly(project(":compiler:frontend")) runtime(projectRuntimeJar(":kotlin-compiler")) @@ -19,6 +22,12 @@ dependencies { testRuntime(ideaSdkDeps("*.jar")) } +afterEvaluate { + dependencies { + compileOnly(intellijCoreJar()) + } +} + sourceSets { "main" { projectDefault() } "test" { projectDefault() } diff --git a/plugins/android-extensions/android-extensions-compiler/build.gradle.kts b/plugins/android-extensions/android-extensions-compiler/build.gradle.kts index 23b57c1dfd6..15e2a62c2d7 100644 --- a/plugins/android-extensions/android-extensions-compiler/build.gradle.kts +++ b/plugins/android-extensions/android-extensions-compiler/build.gradle.kts @@ -3,8 +3,11 @@ description = "Kotlin Android Extensions Compiler" apply { plugin("kotlin") } +configureIntellijPlugin { + setExtraDependencies("intellij-core") +} + dependencies { - compile(ideaSdkCoreDeps("intellij-core")) compile(project(":compiler:util")) compile(project(":compiler:plugin-api")) compile(project(":compiler:frontend")) @@ -23,6 +26,12 @@ dependencies { testCompile(project(":kotlin-android-extensions-runtime")) } +afterEvaluate { + dependencies { + compile(intellijCoreJar()) + } +} + sourceSets { "main" { projectDefault() } "test" { projectDefault() } diff --git a/plugins/android-extensions/android-extensions-jps/build.gradle.kts b/plugins/android-extensions/android-extensions-jps/build.gradle.kts index 3133c304397..1d4de9c82f3 100644 --- a/plugins/android-extensions/android-extensions-jps/build.gradle.kts +++ b/plugins/android-extensions/android-extensions-jps/build.gradle.kts @@ -1,6 +1,10 @@ apply { plugin("kotlin") } +configureIntellijPlugin { + setPlugins("android") +} + dependencies { compile(project(":compiler:util")) compile(project(":jps-plugin")) @@ -9,15 +13,21 @@ dependencies { testCompile(projectTests(":jps-plugin")) testCompile(project(":compiler:tests-common")) - testCompileOnly(ideaSdkDeps("jps-build-test", subdir = "jps/test")) - testRuntime(ideaPluginDeps("*.jar", plugin = "android")) testCompile(commonDep("junit:junit")) testCompile(projectDist(":kotlin-test:kotlin-test-jvm")) testCompile(projectTests(":kotlin-build-common")) - testRuntime(ideaSdkCoreDeps("*.jar")) - testRuntime(ideaSdkDeps("*.jar")) - testRuntime(ideaSdkDeps("*.jar", subdir = "jps/test")) - testRuntime(ideaSdkDeps("*.jar", subdir = "jps")) +} + +afterEvaluate { + dependencies { + compile(intellijPlugin("android") { include("**/android-jps-plugin.jar") }) + testCompileOnly(intellijExtra("jps-build-test") { include("jps-build-test.jar") } ) + testRuntime(intellijPlugin("android")) + testRuntime(intellijCoreJar()) + testRuntime(intellij()) + testRuntime(intellijExtra("jps-build-test")) + testRuntime(intellijExtra("jps-standalone")) + } } sourceSets { diff --git a/plugins/annotation-based-compiler-plugins-ide-support/build.gradle.kts b/plugins/annotation-based-compiler-plugins-ide-support/build.gradle.kts index 65790228530..6db767cb9bb 100644 --- a/plugins/annotation-based-compiler-plugins-ide-support/build.gradle.kts +++ b/plugins/annotation-based-compiler-plugins-ide-support/build.gradle.kts @@ -3,6 +3,10 @@ apply { plugin("kotlin") } jvmTarget = "1.6" +configureIntellijPlugin { + setPlugins("gradle", "maven") +} + dependencies { compile(project(":compiler:util")) compile(project(":compiler:frontend")) @@ -11,9 +15,14 @@ dependencies { compile(project(":idea:idea-jps-common")) compile(project(":idea:idea-gradle")) compile(project(":idea:idea-maven")) - compileOnly(ideaPluginDeps("maven", "maven-server-api", plugin = "maven")) - compileOnly(ideaPluginDeps("gradle-tooling-api", "gradle", plugin = "gradle")) - compileOnly(ideaSdkDeps("openapi", "idea")) +} + +afterEvaluate { + dependencies { + compileOnly(intellijPlugin("maven") { include("maven.jar", "maven-server-api.jar") }) + compileOnly(intellijPlugin("gradle") { include("gradle-tooling-api-*.jar", "gradle.jar") }) + compileOnly(intellij { include("openapi.jar", "idea.jar") }) + } } sourceSets { diff --git a/plugins/kapt3/kapt3-compiler/build.gradle.kts b/plugins/kapt3/kapt3-compiler/build.gradle.kts index bd06e86ed2f..cece19822af 100644 --- a/plugins/kapt3/kapt3-compiler/build.gradle.kts +++ b/plugins/kapt3/kapt3-compiler/build.gradle.kts @@ -3,6 +3,8 @@ description = "Annotation Processor for Kotlin" apply { plugin("kotlin") } +configureIntellijPlugin() + dependencies { compile(project(":compiler:util")) compile(project(":compiler:cli")) @@ -13,14 +15,19 @@ dependencies { testCompile(project(":compiler:tests-common")) testCompile(projectTests(":compiler:tests-common")) - testCompile(ideaSdkDeps("idea", "idea_rt", "openapi")) - + compileOnly(project(":kotlin-annotation-processing-runtime")) testCompile(commonDep("junit:junit")) testCompile(project(":kotlin-annotation-processing-runtime")) } +afterEvaluate { + dependencies { + testCompile(intellij { include("idea.jar", "idea_rt.jar", "openapi.jar") }) + } +} + sourceSets { "main" { projectDefault() } "test" { projectDefault() } diff --git a/plugins/kapt3/kapt3-idea/build.gradle.kts b/plugins/kapt3/kapt3-idea/build.gradle.kts index e824a90a41d..70d4cbb3ccf 100644 --- a/plugins/kapt3/kapt3-idea/build.gradle.kts +++ b/plugins/kapt3/kapt3-idea/build.gradle.kts @@ -3,15 +3,24 @@ apply { plugin("kotlin") } jvmTarget = "1.6" +configureIntellijPlugin { + setPlugins("android", "gradle") +} + dependencies { compile(projectDist(":kotlin-stdlib")) compile(project(":compiler:frontend")) compile(project(":idea")) { isTransitive = false } compile(project(":idea:kotlin-gradle-tooling")) compile(project(":kotlin-annotation-processing")) - compile(ideaSdkDeps("openapi", "external-system-rt")) - compile(ideaPluginDeps("gradle-core", "gradle-tooling-api", "gradle", plugin = "gradle")) - compile(ideaPluginDeps("android", "android-common", "sdklib", "sdk-common", "sdk-tools", plugin = "android")) +} + +afterEvaluate { + dependencies { + compile(intellij { include("openapi.jar", "external-system-rt.jar") }) + compile(intellijPlugin("gradle") { include("gradle-core-*.jar", "gradle-tooling-api-*.jar", "gradle.jar") }) + compile(intellijPlugin("android") { include("android.jar", "android-common.jar", "sdklib.jar", "sdk-common.jar", "sdk-tools.jar") }) + } } sourceSets { diff --git a/plugins/lint/build.gradle.kts b/plugins/lint/build.gradle.kts index 9b8c6aa965e..c0203d9e268 100644 --- a/plugins/lint/build.gradle.kts +++ b/plugins/lint/build.gradle.kts @@ -4,15 +4,28 @@ apply { plugin("java") } +configureIntellijPlugin { + setExtraDependencies("intellij-core") + setPlugins("android") +} + dependencies { compile(project(":compiler:frontend")) compile(project(":idea")) compile(project(":idea:idea-core")) compile(project(":idea:idea-android")) compile(project(":plugins:uast-kotlin")) - compile(ideaPluginDeps("android", "android-common", "sdk-common", "sdklib", "sdk-tools", "repository", "lombok-ast", "kxml2", plugin = "android")) - compile(ideaSdkCoreDeps("intellij-core", "util")) - compile(ideaSdkDeps("guava")) +} + +afterEvaluate { + dependencies { + compile(intellijCoreJar()) + compile(intellij { include("util.jar", "guava-*.jar") }) + compile(intellijPlugin("android") { + include("android.jar", "android-common.jar", "sdklib.jar", "sdk-common.jar", "sdk-tools.jar", + "repository.jar", "lombok-ast-*.jar") + }) + } } sourceSets { diff --git a/plugins/source-sections/source-sections-compiler/build.gradle.kts b/plugins/source-sections/source-sections-compiler/build.gradle.kts index 8da0233579d..b8664e58428 100644 --- a/plugins/source-sections/source-sections-compiler/build.gradle.kts +++ b/plugins/source-sections/source-sections-compiler/build.gradle.kts @@ -3,6 +3,8 @@ description = "Kotlin SourceSections Compiler Plugin" apply { plugin("kotlin") } +configureIntellijPlugin() + dependencies { compileOnly(project(":compiler:frontend")) compileOnly(project(":compiler:frontend.script")) @@ -17,11 +19,16 @@ dependencies { testCompile(project(":compiler:daemon-common")) testCompile(project(":kotlin-daemon-client")) testCompile(projectTests(":compiler:tests-common")) - testCompile(ideaSdkDeps("idea", "idea_rt", "openapi")) testCompile(commonDep("junit:junit")) testRuntime(projectDist(":kotlin-reflect")) } +afterEvaluate { + dependencies { + testCompile(intellij { include("idea.jar", "idea_rt.jar", "openapi.jar") }) + } +} + sourceSets { "main" { projectDefault() } "test" { projectDefault() } diff --git a/prepare/android-extensions-compiler-gradle/build.gradle.kts b/prepare/android-extensions-compiler-gradle/build.gradle.kts index 4f8e5c8c491..9bb2ab2330c 100644 --- a/prepare/android-extensions-compiler-gradle/build.gradle.kts +++ b/prepare/android-extensions-compiler-gradle/build.gradle.kts @@ -5,8 +5,11 @@ description = "Kotlin Android Extensions Compiler" apply { plugin("kotlin") } +configureIntellijPlugin { + setExtraDependencies("intellij-core") +} + dependencies { - compileOnly(ideaSdkCoreDeps("intellij-core")) compileOnly(project(":compiler:util")) compileOnly(project(":compiler:plugin-api")) compileOnly(project(":compiler:frontend")) @@ -17,6 +20,11 @@ dependencies { compileOnly(commonDep("com.google.android", "android")) } +afterEvaluate { + dependencies { + compileOnly(intellijCoreJar()) + } +} sourceSets { "main" { projectDefault() }