diff --git a/compiler/android-tests/build.gradle.kts b/compiler/android-tests/build.gradle.kts index dcc872df07f..7db11c8c6c0 100644 --- a/compiler/android-tests/build.gradle.kts +++ b/compiler/android-tests/build.gradle.kts @@ -3,6 +3,10 @@ apply { plugin("kotlin") } jvmTarget = "1.6" +configureIntellijPlugin { + setExtraDependencies("jps-standalone", "jps-build-test") +} + dependencies { compile(project(":compiler:util")) compile(project(":compiler:cli")) @@ -10,18 +14,22 @@ dependencies { compile(project(":compiler:backend")) compile(projectTests(":compiler:tests-common")) compile(commonDep("junit:junit")) - compile(ideaSdkDeps("openapi")) testCompile(project(":compiler:incremental-compilation-impl")) testCompile(project(":core:descriptors")) testCompile(project(":core:descriptors.jvm")) testCompile(project(":compiler:frontend.java")) testCompile(projectTests(":jps-plugin")) - testCompile(ideaSdkDeps("jps-model.jar", subdir = "jps")) - testCompile(ideaSdkDeps("groovy-all")) - testCompile(ideaSdkDeps("idea", "idea_rt")) - testCompile(ideaSdkDeps("jps-build-test", subdir = "jps/test")) - testCompile(ideaSdkDeps("jps-builders")) + testCompile(commonDep("junit:junit")) +} + +afterEvaluate { + dependencies { + compile(intellij { include("openapi.jar") }) + testCompile(intellij { include("idea.jar", "idea-rt.jar", "groovy-all.jar", "jps-builders.jar") }) + testCompile(intellijExtra("jps-standalone") { include("jps-model.jar") }) + testCompile(intellijExtra("jps-build-test")) + } } sourceSets { diff --git a/compiler/build.gradle.kts b/compiler/build.gradle.kts index eeb562f52dd..51aba27db13 100644 --- a/compiler/build.gradle.kts +++ b/compiler/build.gradle.kts @@ -6,6 +6,10 @@ apply { plugin("kotlin") } jvmTarget = "1.6" +configureIntellijPlugin { + setExtraDependencies("intellij-core") +} + val compilerModules: Array by rootProject.extra val otherCompilerModules = compilerModules.filter { it != path } @@ -54,18 +58,23 @@ dependencies { otherCompilerModules.forEach { testCompileOnly(project(it)) } - testCompile(ideaSdkDeps("openapi", "idea", "util", "asm-all", "commons-httpclient-3.1-patched")) testRuntime(projectDist(":kotlin-reflect")) testRuntime(projectDist(":kotlin-daemon-client")) testRuntime(preloadedDeps("dx", subdir = "android-5.0/lib")) - testRuntime(ideaSdkCoreDeps("*.jar")) - testRuntime(ideaSdkDeps("*.jar")) testRuntime(files("${System.getProperty("java.home")}/../lib/tools.jar")) testJvm6ServerRuntime(projectTests(":compiler:tests-common-jvm6")) } +afterEvaluate { + dependencies { + testCompile(intellij { include("openapi.jar", "idea.jar", "util.jar", "asm-all.jar", "commons-httpclient-3.1-patched.jar") }) + testRuntime(intellijCoreJar()) + testRuntime(intellij()) + } +} + sourceSets { "main" {} "test" { diff --git a/compiler/conditional-preprocessor/build.gradle.kts b/compiler/conditional-preprocessor/build.gradle.kts index 0872fa4f77b..3c8ef41e332 100644 --- a/compiler/conditional-preprocessor/build.gradle.kts +++ b/compiler/conditional-preprocessor/build.gradle.kts @@ -3,17 +3,27 @@ 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(ideaSdkCoreDeps(*(rootProject.extra["ideaCoreSdkJars"] as Array))) compile(commonDep("org.fusesource.jansi", "jansi")) compile(commonDep("org.jline", "jline")) } +afterEvaluate { + dependencies { + compile(intellijCoreJar()) + compile(intellijCoreJarDependencies()) + } +} + sourceSets { "main" { projectDefault() } "test" {} diff --git a/compiler/container/build.gradle.kts b/compiler/container/build.gradle.kts index 0dfded4c2f4..40337ab1042 100644 --- a/compiler/container/build.gradle.kts +++ b/compiler/container/build.gradle.kts @@ -3,16 +3,25 @@ apply { plugin("kotlin") } jvmTarget = "1.6" +configureIntellijPlugin { + setExtraDependencies("intellij-core") +} + dependencies { compile(project(":core:util.runtime")) compile(commonDep("javax.inject")) - compile(ideaSdkCoreDeps("intellij-core")) compileOnly(project(":kotlin-stdlib")) testCompile(project(":kotlin-stdlib")) testCompile(projectDist(":kotlin-test:kotlin-test-jvm")) testCompile(projectDist(":kotlin-test:kotlin-test-junit")) testCompile(commonDep("junit:junit")) - testRuntime(ideaSdkCoreDeps("trove4j", "intellij-core")) +} + +afterEvaluate { + dependencies { + compile(intellijCoreJar()) + testRuntime(intellij { include("trove4j.jar") }) + } } sourceSets { diff --git a/compiler/tests-java8/build.gradle.kts b/compiler/tests-java8/build.gradle.kts index d6d076d3e15..ed8a9384e84 100644 --- a/compiler/tests-java8/build.gradle.kts +++ b/compiler/tests-java8/build.gradle.kts @@ -2,6 +2,10 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile apply { plugin("kotlin") } +configureIntellijPlugin { + setExtraDependencies("intellij-core") +} + dependencies { testCompile(projectTests(":compiler:tests-common")) testCompile(projectTests(":generators:test-generator")) diff --git a/j2k/build.gradle.kts b/j2k/build.gradle.kts index 0c918939ee6..395a45a62c7 100644 --- a/j2k/build.gradle.kts +++ b/j2k/build.gradle.kts @@ -1,9 +1,25 @@ apply { plugin("kotlin") } -//plugins { -// kotlin("jvm") -//} +val usedIntellijPlugins = arrayOf( + "properties", + "gradle", + "Groovy", + "coverage", + "maven", + "android", + "junit", + "testng", + "IntelliLang", + "testng", + "copyright", + "properties", + "java-i18n", + "java-decompiler") + +configureIntellijPlugin { + setPlugins(*usedIntellijPlugins) +} dependencies { compile(projectDist(":kotlin-stdlib")) @@ -11,7 +27,6 @@ dependencies { compile(project(":compiler:frontend.java")) compile(project(":compiler:light-classes")) compile(project(":compiler:util")) -// compile(ideaSdkCoreDeps("intellij-core", "util")) testCompile(project(":idea")) testCompile(project(":idea:idea-test-framework")) testCompile(project(":compiler:light-classes")) @@ -24,21 +39,13 @@ dependencies { testRuntime(project(":allopen-ide-plugin")) testRuntime(project(":noarg-ide-plugin")) testRuntime(project(":plugins:kapt3-idea")) { isTransitive = false } - testRuntime(ideaSdkDeps("*.jar")) - testRuntime(ideaPluginDeps("*.jar", plugin = "properties")) - testRuntime(ideaPluginDeps("*.jar", plugin = "gradle")) - testRuntime(ideaPluginDeps("*.jar", plugin = "Groovy")) - testRuntime(ideaPluginDeps("*.jar", plugin = "coverage")) - testRuntime(ideaPluginDeps("*.jar", plugin = "maven")) - testRuntime(ideaPluginDeps("*.jar", plugin = "android")) - testRuntime(ideaPluginDeps("*.jar", plugin = "junit")) - testRuntime(ideaPluginDeps("*.jar", plugin = "testng")) - testRuntime(ideaPluginDeps("*.jar", plugin = "IntelliLang")) - testRuntime(ideaPluginDeps("*.jar", plugin = "testng")) - testRuntime(ideaPluginDeps("*.jar", plugin = "copyright")) - testRuntime(ideaPluginDeps("*.jar", plugin = "properties")) - testRuntime(ideaPluginDeps("*.jar", plugin = "java-i18n")) - testRuntime(ideaPluginDeps("*.jar", plugin = "java-decompiler")) +} + +afterEvaluate { + dependencies { + testRuntime(intellij()) + testRuntime(intellijPlugins(*usedIntellijPlugins)) + } } sourceSets {