From ba53ba37b09407566f8edc0b1d32be5a86cee993 Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Tue, 25 Sep 2018 20:20:27 +0300 Subject: [PATCH] Replace bunch copies for some of build.gradle.kts files with a DSL --- build.gradle.kts | 2 + .../src/main/kotlin/IdeCompatibilityDsl.kt | 97 +++++++++++++++++++ idea/idea-android/build.gradle.kts | 21 +++- idea/idea-android/build.gradle.kts.173 | 85 ---------------- idea/idea-android/build.gradle.kts.as31 | 86 ---------------- idea/idea-android/build.gradle.kts.as32 | 86 ---------------- idea/idea-android/build.gradle.kts.as33 | 86 ---------------- .../android-extensions-idea/build.gradle.kts | 17 +++- .../build.gradle.kts.173 | 79 --------------- .../build.gradle.kts.as31 | 80 --------------- .../build.gradle.kts.as32 | 80 --------------- .../build.gradle.kts.as33 | 80 --------------- .../android-extensions-jps/build.gradle.kts | 20 +++- .../build.gradle.kts.173 | 40 -------- .../build.gradle.kts.as31 | 41 -------- .../build.gradle.kts.as33 | 41 -------- plugins/kapt3/kapt3-compiler/build.gradle.kts | 6 +- .../kapt3/kapt3-compiler/build.gradle.kts.173 | 56 ----------- .../kapt3-compiler/build.gradle.kts.as32 | 56 ----------- .../sam-with-receiver-ide/build.gradle.kts | 12 ++- .../build.gradle.kts.173 | 32 ------ .../build.gradle.kts.as33 | 31 ------ plugins/uast-kotlin/build.gradle.kts | 23 ++++- plugins/uast-kotlin/build.gradle.kts.173 | 56 ----------- versions.gradle.kts | 2 + versions.gradle.kts.173 | 2 + versions.gradle.kts.181 | 2 + versions.gradle.kts.183 | 2 + versions.gradle.kts.as31 | 2 + versions.gradle.kts.as32 | 2 + versions.gradle.kts.as33 | 2 + 31 files changed, 193 insertions(+), 1034 deletions(-) create mode 100644 buildSrc/src/main/kotlin/IdeCompatibilityDsl.kt delete mode 100644 idea/idea-android/build.gradle.kts.173 delete mode 100644 idea/idea-android/build.gradle.kts.as31 delete mode 100644 idea/idea-android/build.gradle.kts.as32 delete mode 100644 idea/idea-android/build.gradle.kts.as33 delete mode 100644 plugins/android-extensions/android-extensions-idea/build.gradle.kts.173 delete mode 100644 plugins/android-extensions/android-extensions-idea/build.gradle.kts.as31 delete mode 100644 plugins/android-extensions/android-extensions-idea/build.gradle.kts.as32 delete mode 100644 plugins/android-extensions/android-extensions-idea/build.gradle.kts.as33 delete mode 100644 plugins/android-extensions/android-extensions-jps/build.gradle.kts.173 delete mode 100644 plugins/android-extensions/android-extensions-jps/build.gradle.kts.as31 delete mode 100644 plugins/android-extensions/android-extensions-jps/build.gradle.kts.as33 delete mode 100644 plugins/kapt3/kapt3-compiler/build.gradle.kts.173 delete mode 100644 plugins/kapt3/kapt3-compiler/build.gradle.kts.as32 delete mode 100644 plugins/sam-with-receiver/sam-with-receiver-ide/build.gradle.kts.173 delete mode 100644 plugins/sam-with-receiver/sam-with-receiver-ide/build.gradle.kts.as33 delete mode 100644 plugins/uast-kotlin/build.gradle.kts.173 diff --git a/build.gradle.kts b/build.gradle.kts index a0d82cafeec..fda496432fc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -263,6 +263,8 @@ fun Task.listConfigurationContents(configName: String) { } } +IdeVersionConfigurator.setCurrentIde(this) + val defaultJvmTarget = "1.8" val defaultJavaHome = jdkPath(defaultJvmTarget) val ignoreTestFailures by extra(project.findProperty("ignoreTestFailures")?.toString()?.toBoolean() ?: project.hasProperty("teamcity")) diff --git a/buildSrc/src/main/kotlin/IdeCompatibilityDsl.kt b/buildSrc/src/main/kotlin/IdeCompatibilityDsl.kt new file mode 100644 index 00000000000..ffc1106b8db --- /dev/null +++ b/buildSrc/src/main/kotlin/IdeCompatibilityDsl.kt @@ -0,0 +1,97 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +import org.gradle.api.Project + +interface CompatibilityPredicate { + fun matches(ide: Ide): Boolean + + operator fun invoke(block: () -> Unit): Any? { + if (matches(IdeVersionConfigurator.currentIde)) { + block() + return emptyList() + } + + return null + } +} + +val CompatibilityPredicate.not: CompatibilityPredicate get() = object : CompatibilityPredicate { + override fun matches(ide: Ide) = !this@not.matches(ide) +} + +fun CompatibilityPredicate.or(other: CompatibilityPredicate): CompatibilityPredicate = object : CompatibilityPredicate { + override fun matches(ide: Ide) = this@or.matches(ide) || other.matches(ide) +} + +enum class Platform : CompatibilityPredicate { + P173, P181, P182, P183; + + val version: Int = name.drop(1).toInt() + + override fun matches(ide: Ide) = ide.platform == this + + companion object { + operator fun get(version: Int): Platform { + return Platform.values().firstOrNull { it.version == version } + ?: error("Can't find platform $version") + } + } +} + +enum class Ide(val platform: Platform) : CompatibilityPredicate { + IJ173(Platform.P173), + IJ181(Platform.P181), + IJ182(Platform.P182), + IJ183(Platform.P183), + + AS31(Platform.P173), + AS32(Platform.P181), + AS33(Platform.P182); + + val kind = Kind.values().first { it.shortName == name.take(2) } + val version = name.dropWhile { !it.isDigit() }.toInt() + + override fun matches(ide: Ide) = ide == this + + enum class Kind(val shortName: String) { + AndroidStudio("AS"), IntelliJ("IJ") + } + + companion object { + val IJ: CompatibilityPredicate = IdeKindPredicate(Kind.IntelliJ) + val AS: CompatibilityPredicate = IdeKindPredicate(Kind.AndroidStudio) + } +} + +val Platform.orHigher get() = object : CompatibilityPredicate { + override fun matches(ide: Ide) = ide.platform.version >= version +} + +val Platform.orLower get() = object : CompatibilityPredicate { + override fun matches(ide: Ide) = ide.platform.version <= version +} + +val Ide.orHigher get() = object : CompatibilityPredicate { + override fun matches(ide: Ide) = ide.kind == kind && ide.version >= version +} + +val Ide.orLower get() = object : CompatibilityPredicate { + override fun matches(ide: Ide) = ide.kind == kind && ide.version <= version +} + +object IdeVersionConfigurator { + lateinit var currentIde: Ide + + fun setCurrentIde(project: Project) { + val platformVersion = project.rootProject.extensions.extraProperties["versions.platform"].toString() + val ideName = if (platformVersion.startsWith("AS")) platformVersion else "IJ$platformVersion" + currentIde = Ide.valueOf(ideName) + } +} + +private class IdeKindPredicate(val kind: Ide.Kind) : CompatibilityPredicate { + override fun matches(ide: Ide) = ide.kind == kind +} \ No newline at end of file diff --git a/idea/idea-android/build.gradle.kts b/idea/idea-android/build.gradle.kts index 5fd33dd6498..b230087b896 100644 --- a/idea/idea-android/build.gradle.kts +++ b/idea/idea-android/build.gradle.kts @@ -54,7 +54,11 @@ dependencies { testRuntime(project(":kotlinx-serialization-ide-plugin")) testRuntime(intellijPluginDep("android")) - testRuntime(intellijPluginDep("smali")) + + (Platform[181].orHigher.or(Ide.AS31)) { + testRuntime(intellijPluginDep("smali")) + } + testRuntime(intellijPluginDep("copyright")) testRuntime(intellijPluginDep("coverage")) testRuntime(intellijPluginDep("gradle")) @@ -63,13 +67,22 @@ dependencies { testRuntime(intellijPluginDep("java-decompiler")) testRuntime(intellijPluginDep("java-i18n")) testRuntime(intellijPluginDep("junit")) - testRuntime(intellijPluginDep("maven")) + + Ide.IJ { + testRuntime(intellijPluginDep("maven")) + } + testRuntime(intellijPluginDep("testng")) } sourceSets { - "main" { projectDefault() } - "test" { projectDefault() } + Ide.AS33.orHigher { + "main" { } + "test" { } + } ?: run { + "main" { projectDefault() } + "test" { projectDefault() } + } } projectTest { diff --git a/idea/idea-android/build.gradle.kts.173 b/idea/idea-android/build.gradle.kts.173 deleted file mode 100644 index 8db6ddd6587..00000000000 --- a/idea/idea-android/build.gradle.kts.173 +++ /dev/null @@ -1,85 +0,0 @@ - -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - -plugins { - kotlin("jvm") - id("jps-compatible") -} - -dependencies { - testRuntime(intellijDep()) - - compileOnly(project(":kotlin-reflect-api")) - compile(project(":compiler:util")) - compile(project(":compiler:light-classes")) - compile(project(":compiler:frontend")) - compile(project(":compiler:frontend.java")) - compile(project(":idea")) - compile(project(":idea:idea-jvm")) - compile(project(":idea:idea-core")) - compile(project(":idea:ide-common")) - compile(project(":idea:idea-gradle")) - - compile(androidDxJar()) - - compileOnly(project(":kotlin-android-extensions-runtime")) - compileOnly(intellijDep()) - compileOnly(intellijPluginDep("android")) - - testCompile(project(":kotlin-test:kotlin-test-jvm")) - testCompile(projectTests(":idea:idea-test-framework")) { isTransitive = false } - testCompile(project(":plugins:lint")) { isTransitive = false } - testCompile(project(":idea:idea-jvm")) - testCompile(projectTests(":compiler:tests-common")) - testCompile(projectTests(":idea")) - testCompile(projectTests(":idea:idea-gradle")) - testCompile(commonDep("junit:junit")) - - testCompile(project(":idea:idea-native")) { isTransitive = false } - testCompile(project(":idea:idea-gradle-native")) { isTransitive = false } - testRuntime(project(":kotlin-native:kotlin-native-library-reader")) { isTransitive = false } - testRuntime(project(":kotlin-native:kotlin-native-utils")) { isTransitive = false } - - testCompile(intellijDep()) - testCompile(intellijPluginDep("properties")) - testCompileOnly(intellijPluginDep("android")) - - testRuntime(project(":kotlin-reflect")) - testRuntime(project(":plugins:android-extensions-ide")) - testRuntime(project(":plugins:kapt3-idea")) - testRuntime(project(":sam-with-receiver-ide-plugin")) - testRuntime(project(":noarg-ide-plugin")) - testRuntime(project(":allopen-ide-plugin")) - testRuntime(project(":kotlin-scripting-idea")) - testRuntime(project(":kotlinx-serialization-ide-plugin")) - - testRuntime(intellijPluginDep("android")) - testRuntime(intellijPluginDep("copyright")) - testRuntime(intellijPluginDep("coverage")) - testRuntime(intellijPluginDep("gradle")) - testRuntime(intellijPluginDep("Groovy")) - testRuntime(intellijPluginDep("IntelliLang")) - testRuntime(intellijPluginDep("java-decompiler")) - testRuntime(intellijPluginDep("java-i18n")) - testRuntime(intellijPluginDep("junit")) - testRuntime(intellijPluginDep("maven")) - testRuntime(intellijPluginDep("testng")) -} - -sourceSets { - "main" { projectDefault() } - "test" { projectDefault() } -} - -projectTest { - workingDir = rootDir - useAndroidSdk() -} - -testsJar {} - -runtimeJar { - archiveName = "android-ide.jar" -} - -ideaPlugin() diff --git a/idea/idea-android/build.gradle.kts.as31 b/idea/idea-android/build.gradle.kts.as31 deleted file mode 100644 index 769ebde2451..00000000000 --- a/idea/idea-android/build.gradle.kts.as31 +++ /dev/null @@ -1,86 +0,0 @@ - -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - -plugins { - kotlin("jvm") - id("jps-compatible") -} - -dependencies { - testRuntime(intellijDep()) - - compileOnly(project(":kotlin-reflect-api")) - compile(project(":compiler:util")) - compile(project(":compiler:light-classes")) - compile(project(":compiler:frontend")) - compile(project(":compiler:frontend.java")) - compile(project(":idea")) - compile(project(":idea:idea-jvm")) - compile(project(":idea:idea-core")) - compile(project(":idea:ide-common")) - compile(project(":idea:idea-gradle")) - - compile(androidDxJar()) - - compileOnly(project(":kotlin-android-extensions-runtime")) - compileOnly(intellijDep()) - compileOnly(intellijPluginDep("android")) - - testCompile(project(":kotlin-test:kotlin-test-jvm")) - testCompile(projectTests(":idea:idea-test-framework")) { isTransitive = false } - testCompile(project(":plugins:lint")) { isTransitive = false } - testCompile(project(":idea:idea-jvm")) - testCompile(projectTests(":compiler:tests-common")) - testCompile(projectTests(":idea")) - testCompile(projectTests(":idea:idea-gradle")) - testCompile(commonDep("junit:junit")) - - testCompile(project(":idea:idea-native")) { isTransitive = false } - testCompile(project(":idea:idea-gradle-native")) { isTransitive = false } - testRuntime(project(":kotlin-native:kotlin-native-library-reader")) { isTransitive = false } - testRuntime(project(":kotlin-native:kotlin-native-utils")) { isTransitive = false } - - testCompile(intellijDep()) - testCompile(intellijPluginDep("properties")) - testCompileOnly(intellijPluginDep("android")) - - testRuntime(project(":kotlin-reflect")) - testRuntime(project(":plugins:android-extensions-ide")) - testRuntime(project(":plugins:kapt3-idea")) - testRuntime(project(":sam-with-receiver-ide-plugin")) - testRuntime(project(":noarg-ide-plugin")) - testRuntime(project(":allopen-ide-plugin")) - testRuntime(project(":kotlin-scripting-idea")) - testRuntime(project(":kotlinx-serialization-ide-plugin")) - - testRuntime(intellijPluginDep("android")) - testRuntime(intellijPluginDep("smali")) - testRuntime(intellijPluginDep("copyright")) - testRuntime(intellijPluginDep("coverage")) - testRuntime(intellijPluginDep("gradle")) - testRuntime(intellijPluginDep("Groovy")) - testRuntime(intellijPluginDep("IntelliLang")) - testRuntime(intellijPluginDep("java-decompiler")) - testRuntime(intellijPluginDep("java-i18n")) - testRuntime(intellijPluginDep("junit")) - //testRuntime(intellijPluginDep("maven")) - testRuntime(intellijPluginDep("testng")) -} - -sourceSets { - "main" { projectDefault() } - "test" { projectDefault() } -} - -projectTest { - workingDir = rootDir - useAndroidSdk() -} - -testsJar {} - -runtimeJar { - archiveName = "android-ide.jar" -} - -ideaPlugin() diff --git a/idea/idea-android/build.gradle.kts.as32 b/idea/idea-android/build.gradle.kts.as32 deleted file mode 100644 index 769ebde2451..00000000000 --- a/idea/idea-android/build.gradle.kts.as32 +++ /dev/null @@ -1,86 +0,0 @@ - -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - -plugins { - kotlin("jvm") - id("jps-compatible") -} - -dependencies { - testRuntime(intellijDep()) - - compileOnly(project(":kotlin-reflect-api")) - compile(project(":compiler:util")) - compile(project(":compiler:light-classes")) - compile(project(":compiler:frontend")) - compile(project(":compiler:frontend.java")) - compile(project(":idea")) - compile(project(":idea:idea-jvm")) - compile(project(":idea:idea-core")) - compile(project(":idea:ide-common")) - compile(project(":idea:idea-gradle")) - - compile(androidDxJar()) - - compileOnly(project(":kotlin-android-extensions-runtime")) - compileOnly(intellijDep()) - compileOnly(intellijPluginDep("android")) - - testCompile(project(":kotlin-test:kotlin-test-jvm")) - testCompile(projectTests(":idea:idea-test-framework")) { isTransitive = false } - testCompile(project(":plugins:lint")) { isTransitive = false } - testCompile(project(":idea:idea-jvm")) - testCompile(projectTests(":compiler:tests-common")) - testCompile(projectTests(":idea")) - testCompile(projectTests(":idea:idea-gradle")) - testCompile(commonDep("junit:junit")) - - testCompile(project(":idea:idea-native")) { isTransitive = false } - testCompile(project(":idea:idea-gradle-native")) { isTransitive = false } - testRuntime(project(":kotlin-native:kotlin-native-library-reader")) { isTransitive = false } - testRuntime(project(":kotlin-native:kotlin-native-utils")) { isTransitive = false } - - testCompile(intellijDep()) - testCompile(intellijPluginDep("properties")) - testCompileOnly(intellijPluginDep("android")) - - testRuntime(project(":kotlin-reflect")) - testRuntime(project(":plugins:android-extensions-ide")) - testRuntime(project(":plugins:kapt3-idea")) - testRuntime(project(":sam-with-receiver-ide-plugin")) - testRuntime(project(":noarg-ide-plugin")) - testRuntime(project(":allopen-ide-plugin")) - testRuntime(project(":kotlin-scripting-idea")) - testRuntime(project(":kotlinx-serialization-ide-plugin")) - - testRuntime(intellijPluginDep("android")) - testRuntime(intellijPluginDep("smali")) - testRuntime(intellijPluginDep("copyright")) - testRuntime(intellijPluginDep("coverage")) - testRuntime(intellijPluginDep("gradle")) - testRuntime(intellijPluginDep("Groovy")) - testRuntime(intellijPluginDep("IntelliLang")) - testRuntime(intellijPluginDep("java-decompiler")) - testRuntime(intellijPluginDep("java-i18n")) - testRuntime(intellijPluginDep("junit")) - //testRuntime(intellijPluginDep("maven")) - testRuntime(intellijPluginDep("testng")) -} - -sourceSets { - "main" { projectDefault() } - "test" { projectDefault() } -} - -projectTest { - workingDir = rootDir - useAndroidSdk() -} - -testsJar {} - -runtimeJar { - archiveName = "android-ide.jar" -} - -ideaPlugin() diff --git a/idea/idea-android/build.gradle.kts.as33 b/idea/idea-android/build.gradle.kts.as33 deleted file mode 100644 index dbf5c526a20..00000000000 --- a/idea/idea-android/build.gradle.kts.as33 +++ /dev/null @@ -1,86 +0,0 @@ - -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - -plugins { - kotlin("jvm") - id("jps-compatible") -} - -dependencies { - testRuntime(intellijDep()) - - compileOnly(project(":kotlin-reflect-api")) - compile(project(":compiler:util")) - compile(project(":compiler:light-classes")) - compile(project(":compiler:frontend")) - compile(project(":compiler:frontend.java")) - compile(project(":idea")) - compile(project(":idea:idea-jvm")) - compile(project(":idea:idea-core")) - compile(project(":idea:ide-common")) - compile(project(":idea:idea-gradle")) - - compile(androidDxJar()) - - compileOnly(project(":kotlin-android-extensions-runtime")) - compileOnly(intellijDep()) - compileOnly(intellijPluginDep("android")) - - testCompile(project(":kotlin-test:kotlin-test-jvm")) - testCompile(projectTests(":idea:idea-test-framework")) { isTransitive = false } - testCompile(project(":plugins:lint")) { isTransitive = false } - testCompile(project(":idea:idea-jvm")) - testCompile(projectTests(":compiler:tests-common")) - testCompile(projectTests(":idea")) - testCompile(projectTests(":idea:idea-gradle")) - testCompile(commonDep("junit:junit")) - - testCompile(project(":idea:idea-native")) { isTransitive = false } - testCompile(project(":idea:idea-gradle-native")) { isTransitive = false } - testRuntime(project(":kotlin-native:kotlin-native-library-reader")) { isTransitive = false } - testRuntime(project(":kotlin-native:kotlin-native-utils")) { isTransitive = false } - - testCompile(intellijDep()) - testCompile(intellijPluginDep("properties")) - testCompileOnly(intellijPluginDep("android")) - - testRuntime(project(":kotlin-reflect")) - testRuntime(project(":plugins:android-extensions-ide")) - testRuntime(project(":plugins:kapt3-idea")) - testRuntime(project(":sam-with-receiver-ide-plugin")) - testRuntime(project(":noarg-ide-plugin")) - testRuntime(project(":allopen-ide-plugin")) - testRuntime(project(":kotlin-scripting-idea")) - testRuntime(project(":kotlinx-serialization-ide-plugin")) - - testRuntime(intellijPluginDep("android")) - testRuntime(intellijPluginDep("smali")) - testRuntime(intellijPluginDep("copyright")) - testRuntime(intellijPluginDep("coverage")) - testRuntime(intellijPluginDep("gradle")) - testRuntime(intellijPluginDep("Groovy")) - testRuntime(intellijPluginDep("IntelliLang")) - testRuntime(intellijPluginDep("java-decompiler")) - testRuntime(intellijPluginDep("java-i18n")) - testRuntime(intellijPluginDep("junit")) - //testRuntime(intellijPluginDep("maven")) - testRuntime(intellijPluginDep("testng")) -} - -sourceSets { - "main" {} - "test" {} -} - -projectTest { - workingDir = rootDir - useAndroidSdk() -} - -testsJar {} - -runtimeJar { - archiveName = "android-ide.jar" -} - -ideaPlugin() diff --git a/plugins/android-extensions/android-extensions-idea/build.gradle.kts b/plugins/android-extensions/android-extensions-idea/build.gradle.kts index eb50bd7eb75..146354916b8 100644 --- a/plugins/android-extensions/android-extensions-idea/build.gradle.kts +++ b/plugins/android-extensions/android-extensions-idea/build.gradle.kts @@ -56,14 +56,23 @@ dependencies { testRuntime(intellijPluginDep("gradle")) testRuntime(intellijPluginDep("Groovy")) testRuntime(intellijPluginDep("java-decompiler")) - testRuntime(intellijPluginDep("maven")) + Ide.IJ { + testRuntime(intellijPluginDep("maven")) + } testRuntime(intellijPluginDep("android")) - testRuntime(intellijPluginDep("smali")) + (Platform[181].orHigher.or(Ide.AS31)) { + testRuntime(intellijPluginDep("smali")) + } } sourceSets { - "main" { projectDefault() } - "test" { projectDefault() } + Ide.AS33.orHigher { + "main" { } + "test" { } + } ?: run { + "main" { projectDefault() } + "test" { projectDefault() } + } } testsJar {} diff --git a/plugins/android-extensions/android-extensions-idea/build.gradle.kts.173 b/plugins/android-extensions/android-extensions-idea/build.gradle.kts.173 deleted file mode 100644 index 2fc3a8e4a39..00000000000 --- a/plugins/android-extensions/android-extensions-idea/build.gradle.kts.173 +++ /dev/null @@ -1,79 +0,0 @@ - -description = "Kotlin Android Extensions IDEA" - -plugins { - kotlin("jvm") - id("jps-compatible") -} - -jvmTarget = "1.6" - -dependencies { - testRuntime(intellijDep()) - - compile(project(":compiler:util")) - compile(project(":compiler:light-classes")) - compile(project(":idea:idea-core")) - compile(project(":idea")) - compile(project(":idea:idea-jvm")) - compile(project(":idea:idea-gradle")) - compile(project(":plugins:android-extensions-compiler")) - compileOnly(project(":kotlin-android-extensions-runtime")) - compileOnly(intellijPluginDep("android")) - compileOnly(intellijPluginDep("Groovy")) - compileOnly(intellijDep()) - - testCompile(project(":compiler:cli")) - testCompile(project(":compiler:frontend.java")) - testCompile(projectTests(":idea:idea-test-framework")) { isTransitive = false } - testCompile(project(":plugins:kapt3-idea")) - testCompile(projectTests(":compiler:tests-common")) - testCompile(projectTests(":idea")) - testCompile(projectTests(":idea:idea-android")) - testCompile(project(":kotlin-test:kotlin-test-jvm")) - testCompile(commonDep("junit:junit")) - testCompile(project(":idea:idea-native")) { isTransitive = false } - testCompile(project(":idea:idea-gradle-native")) { isTransitive = false } - testRuntime(project(":kotlin-native:kotlin-native-library-reader")) { isTransitive = false } - testRuntime(project(":kotlin-native:kotlin-native-utils")) { isTransitive = false } - testRuntime(project(":kotlin-reflect")) - testCompile(intellijPluginDep("android")) - testCompile(intellijPluginDep("Groovy")) - testCompile(intellijDep()) - - testRuntime(project(":idea:idea-jvm")) - testRuntime(project(":plugins:android-extensions-jps")) - testRuntime(project(":sam-with-receiver-ide-plugin")) - testRuntime(project(":noarg-ide-plugin")) - testRuntime(project(":allopen-ide-plugin")) - testRuntime(project(":kotlin-scripting-idea")) - testRuntime(project(":kotlinx-serialization-ide-plugin")) - testRuntime(project(":plugins:lint")) - testRuntime(intellijPluginDep("junit")) - testRuntime(intellijPluginDep("IntelliLang")) - testRuntime(intellijPluginDep("properties")) - testRuntime(intellijPluginDep("java-i18n")) - testRuntime(intellijPluginDep("gradle")) - testRuntime(intellijPluginDep("Groovy")) - testRuntime(intellijPluginDep("java-decompiler")) - testRuntime(intellijPluginDep("maven")) - testRuntime(intellijPluginDep("android")) -} - -sourceSets { - "main" { projectDefault() } - "test" { projectDefault() } -} - -testsJar {} - -projectTest { - dependsOn(":kotlin-android-extensions-runtime:dist") - workingDir = rootDir - useAndroidSdk() - useAndroidJar() -} - -runtimeJar() - -ideaPlugin() diff --git a/plugins/android-extensions/android-extensions-idea/build.gradle.kts.as31 b/plugins/android-extensions/android-extensions-idea/build.gradle.kts.as31 deleted file mode 100644 index f68293fb8d4..00000000000 --- a/plugins/android-extensions/android-extensions-idea/build.gradle.kts.as31 +++ /dev/null @@ -1,80 +0,0 @@ - -description = "Kotlin Android Extensions IDEA" - -plugins { - kotlin("jvm") - id("jps-compatible") -} - -jvmTarget = "1.6" - -dependencies { - testRuntime(intellijDep()) - - compile(project(":compiler:util")) - compile(project(":compiler:light-classes")) - compile(project(":idea:idea-core")) - compile(project(":idea")) - compile(project(":idea:idea-jvm")) - compile(project(":idea:idea-gradle")) - compile(project(":plugins:android-extensions-compiler")) - compileOnly(project(":kotlin-android-extensions-runtime")) - compileOnly(intellijPluginDep("android")) - compileOnly(intellijPluginDep("Groovy")) - compileOnly(intellijDep()) - - testCompile(project(":compiler:cli")) - testCompile(project(":compiler:frontend.java")) - testCompile(projectTests(":idea:idea-test-framework")) { isTransitive = false } - testCompile(project(":plugins:kapt3-idea")) - testCompile(projectTests(":compiler:tests-common")) - testCompile(projectTests(":idea")) - testCompile(projectTests(":idea:idea-android")) - testCompile(project(":kotlin-test:kotlin-test-jvm")) - testCompile(commonDep("junit:junit")) - testCompile(project(":idea:idea-native")) { isTransitive = false } - testCompile(project(":idea:idea-gradle-native")) { isTransitive = false } - testRuntime(project(":kotlin-native:kotlin-native-library-reader")) { isTransitive = false } - testRuntime(project(":kotlin-native:kotlin-native-utils")) { isTransitive = false } - testRuntime(project(":kotlin-reflect")) - testCompile(intellijPluginDep("android")) - testCompile(intellijPluginDep("Groovy")) - testCompile(intellijDep()) - - testRuntime(project(":idea:idea-jvm")) - testRuntime(project(":plugins:android-extensions-jps")) - testRuntime(project(":sam-with-receiver-ide-plugin")) - testRuntime(project(":noarg-ide-plugin")) - testRuntime(project(":allopen-ide-plugin")) - testRuntime(project(":kotlin-scripting-idea")) - testRuntime(project(":kotlinx-serialization-ide-plugin")) - testRuntime(project(":plugins:lint")) - testRuntime(intellijPluginDep("junit")) - testRuntime(intellijPluginDep("IntelliLang")) - testRuntime(intellijPluginDep("properties")) - testRuntime(intellijPluginDep("java-i18n")) - testRuntime(intellijPluginDep("gradle")) - testRuntime(intellijPluginDep("Groovy")) - testRuntime(intellijPluginDep("java-decompiler")) - //testRuntime(intellijPluginDep("maven")) - testRuntime(intellijPluginDep("android")) - testRuntime(intellijPluginDep("smali")) -} - -sourceSets { - "main" { projectDefault() } - "test" { projectDefault() } -} - -testsJar {} - -projectTest { - dependsOn(":kotlin-android-extensions-runtime:dist") - workingDir = rootDir - useAndroidSdk() - useAndroidJar() -} - -runtimeJar() - -ideaPlugin() diff --git a/plugins/android-extensions/android-extensions-idea/build.gradle.kts.as32 b/plugins/android-extensions/android-extensions-idea/build.gradle.kts.as32 deleted file mode 100644 index f68293fb8d4..00000000000 --- a/plugins/android-extensions/android-extensions-idea/build.gradle.kts.as32 +++ /dev/null @@ -1,80 +0,0 @@ - -description = "Kotlin Android Extensions IDEA" - -plugins { - kotlin("jvm") - id("jps-compatible") -} - -jvmTarget = "1.6" - -dependencies { - testRuntime(intellijDep()) - - compile(project(":compiler:util")) - compile(project(":compiler:light-classes")) - compile(project(":idea:idea-core")) - compile(project(":idea")) - compile(project(":idea:idea-jvm")) - compile(project(":idea:idea-gradle")) - compile(project(":plugins:android-extensions-compiler")) - compileOnly(project(":kotlin-android-extensions-runtime")) - compileOnly(intellijPluginDep("android")) - compileOnly(intellijPluginDep("Groovy")) - compileOnly(intellijDep()) - - testCompile(project(":compiler:cli")) - testCompile(project(":compiler:frontend.java")) - testCompile(projectTests(":idea:idea-test-framework")) { isTransitive = false } - testCompile(project(":plugins:kapt3-idea")) - testCompile(projectTests(":compiler:tests-common")) - testCompile(projectTests(":idea")) - testCompile(projectTests(":idea:idea-android")) - testCompile(project(":kotlin-test:kotlin-test-jvm")) - testCompile(commonDep("junit:junit")) - testCompile(project(":idea:idea-native")) { isTransitive = false } - testCompile(project(":idea:idea-gradle-native")) { isTransitive = false } - testRuntime(project(":kotlin-native:kotlin-native-library-reader")) { isTransitive = false } - testRuntime(project(":kotlin-native:kotlin-native-utils")) { isTransitive = false } - testRuntime(project(":kotlin-reflect")) - testCompile(intellijPluginDep("android")) - testCompile(intellijPluginDep("Groovy")) - testCompile(intellijDep()) - - testRuntime(project(":idea:idea-jvm")) - testRuntime(project(":plugins:android-extensions-jps")) - testRuntime(project(":sam-with-receiver-ide-plugin")) - testRuntime(project(":noarg-ide-plugin")) - testRuntime(project(":allopen-ide-plugin")) - testRuntime(project(":kotlin-scripting-idea")) - testRuntime(project(":kotlinx-serialization-ide-plugin")) - testRuntime(project(":plugins:lint")) - testRuntime(intellijPluginDep("junit")) - testRuntime(intellijPluginDep("IntelliLang")) - testRuntime(intellijPluginDep("properties")) - testRuntime(intellijPluginDep("java-i18n")) - testRuntime(intellijPluginDep("gradle")) - testRuntime(intellijPluginDep("Groovy")) - testRuntime(intellijPluginDep("java-decompiler")) - //testRuntime(intellijPluginDep("maven")) - testRuntime(intellijPluginDep("android")) - testRuntime(intellijPluginDep("smali")) -} - -sourceSets { - "main" { projectDefault() } - "test" { projectDefault() } -} - -testsJar {} - -projectTest { - dependsOn(":kotlin-android-extensions-runtime:dist") - workingDir = rootDir - useAndroidSdk() - useAndroidJar() -} - -runtimeJar() - -ideaPlugin() diff --git a/plugins/android-extensions/android-extensions-idea/build.gradle.kts.as33 b/plugins/android-extensions/android-extensions-idea/build.gradle.kts.as33 deleted file mode 100644 index b7554a785c2..00000000000 --- a/plugins/android-extensions/android-extensions-idea/build.gradle.kts.as33 +++ /dev/null @@ -1,80 +0,0 @@ - -description = "Kotlin Android Extensions IDEA" - -plugins { - kotlin("jvm") - id("jps-compatible") -} - -jvmTarget = "1.6" - -dependencies { - testRuntime(intellijDep()) - - compile(project(":compiler:util")) - compile(project(":compiler:light-classes")) - compile(project(":idea:idea-core")) - compile(project(":idea")) - compile(project(":idea:idea-jvm")) - compile(project(":idea:idea-gradle")) - compile(project(":plugins:android-extensions-compiler")) - compileOnly(project(":kotlin-android-extensions-runtime")) - compileOnly(intellijPluginDep("android")) - compileOnly(intellijPluginDep("Groovy")) - compileOnly(intellijDep()) - - testCompile(project(":compiler:cli")) - testCompile(project(":compiler:frontend.java")) - testCompile(projectTests(":idea:idea-test-framework")) { isTransitive = false } - testCompile(project(":plugins:kapt3-idea")) - testCompile(projectTests(":compiler:tests-common")) - testCompile(projectTests(":idea")) - testCompile(projectTests(":idea:idea-android")) - testCompile(project(":kotlin-test:kotlin-test-jvm")) - testCompile(commonDep("junit:junit")) - testCompile(project(":idea:idea-native")) { isTransitive = false } - testCompile(project(":idea:idea-gradle-native")) { isTransitive = false } - testRuntime(project(":kotlin-native:kotlin-native-library-reader")) { isTransitive = false } - testRuntime(project(":kotlin-native:kotlin-native-utils")) { isTransitive = false } - testRuntime(project(":kotlin-reflect")) - testCompile(intellijPluginDep("android")) - testCompile(intellijPluginDep("Groovy")) - testCompile(intellijDep()) - - testRuntime(project(":idea:idea-jvm")) - testRuntime(project(":plugins:android-extensions-jps")) - testRuntime(project(":sam-with-receiver-ide-plugin")) - testRuntime(project(":noarg-ide-plugin")) - testRuntime(project(":allopen-ide-plugin")) - testRuntime(project(":kotlin-scripting-idea")) - testRuntime(project(":kotlinx-serialization-ide-plugin")) - testRuntime(project(":plugins:lint")) - testRuntime(intellijPluginDep("junit")) - testRuntime(intellijPluginDep("IntelliLang")) - testRuntime(intellijPluginDep("properties")) - testRuntime(intellijPluginDep("java-i18n")) - testRuntime(intellijPluginDep("gradle")) - testRuntime(intellijPluginDep("Groovy")) - testRuntime(intellijPluginDep("java-decompiler")) - //testRuntime(intellijPluginDep("maven")) - testRuntime(intellijPluginDep("android")) - testRuntime(intellijPluginDep("smali")) -} - -sourceSets { - "main" {} - "test" {} -} - -testsJar {} - -projectTest { - dependsOn(":kotlin-android-extensions-runtime:dist") - workingDir = rootDir - useAndroidSdk() - useAndroidJar() -} - -runtimeJar() - -ideaPlugin() diff --git a/plugins/android-extensions/android-extensions-jps/build.gradle.kts b/plugins/android-extensions/android-extensions-jps/build.gradle.kts index e0b39966d51..51e2d6684ee 100644 --- a/plugins/android-extensions/android-extensions-jps/build.gradle.kts +++ b/plugins/android-extensions/android-extensions-jps/build.gradle.kts @@ -10,7 +10,10 @@ dependencies { compile(project(":compiler:util")) compile(project(":jps-plugin")) compile(project(":plugins:android-extensions-compiler")) - compileOnly(intellijDep()) { includeJars("openapi", "platform-api", "jps-builders", "jps-model", "jdom") } + compileOnly(intellijDep()) { includeJars("openapi", "jps-builders", "jps-model", "jdom") } + Platform[181].orHigher { + compileOnly(intellijDep()) { includeJars("platform-api") } + } compileOnly(intellijPluginDep("android")) { includeJars("jps/android-jps-plugin") } compile(intellijPluginDep("android")) { includeJars("jps/android-jps-plugin") } @@ -23,14 +26,23 @@ dependencies { testCompileOnly(intellijDep()) { includeJars("jps-model") } testRuntime(intellijPluginDep("android")) - testRuntime(intellijPluginDep("smali")) + (Platform[181].orHigher.or(Ide.AS31)) { + testRuntime(intellijPluginDep("smali")) + } testRuntime(intellijDep("jps-build-test")) testRuntime(intellijDep("jps-standalone")) } sourceSets { - "main" { projectDefault() } - "test" { projectDefault() } + Ide.IJ { + "main" { projectDefault() } + "test" { projectDefault() } + } + + Ide.AS { + "main" {} + "test" {} + } } projectTest { diff --git a/plugins/android-extensions/android-extensions-jps/build.gradle.kts.173 b/plugins/android-extensions/android-extensions-jps/build.gradle.kts.173 deleted file mode 100644 index 64978cda1c8..00000000000 --- a/plugins/android-extensions/android-extensions-jps/build.gradle.kts.173 +++ /dev/null @@ -1,40 +0,0 @@ - -plugins { - kotlin("jvm") - id("jps-compatible") -} - -dependencies { - testRuntime(intellijDep()) - - compile(project(":compiler:util")) - compile(project(":jps-plugin")) - compile(project(":plugins:android-extensions-compiler")) - compileOnly(intellijDep()) { includeJars("openapi", "jps-builders", "jps-model", "jdom") } - compileOnly(intellijPluginDep("android")) { includeJars("jps/android-jps-plugin") } - compile(intellijPluginDep("android")) { includeJars("jps/android-jps-plugin") } - - testCompile(projectTests(":jps-plugin")) - testCompile(commonDep("junit:junit")) - testCompile(project(":kotlin-test:kotlin-test-jvm")) - testCompile(projectTests(":kotlin-build-common")) - testCompileOnly(intellijDep()) { includeJars("openapi", "jps-builders") } - testCompileOnly(intellijDep("jps-build-test")) { includeJars("jps-build-test") } - testCompileOnly(intellijDep()) { includeJars("jps-model") } - - testRuntime(intellijPluginDep("android")) - testRuntime(intellijDep("jps-build-test")) - testRuntime(intellijDep("jps-standalone")) -} - -sourceSets { - "main" { projectDefault() } - "test" { projectDefault() } -} - -projectTest { - workingDir = rootDir - useAndroidSdk() -} - -testsJar {} \ No newline at end of file diff --git a/plugins/android-extensions/android-extensions-jps/build.gradle.kts.as31 b/plugins/android-extensions/android-extensions-jps/build.gradle.kts.as31 deleted file mode 100644 index 0944e3bc1cc..00000000000 --- a/plugins/android-extensions/android-extensions-jps/build.gradle.kts.as31 +++ /dev/null @@ -1,41 +0,0 @@ - -plugins { - kotlin("jvm") - id("jps-compatible") -} - -dependencies { - testRuntime(intellijDep()) - - compile(project(":compiler:util")) - compile(project(":jps-plugin")) - compile(project(":plugins:android-extensions-compiler")) - compileOnly(intellijDep()) { includeJars("openapi", "jps-builders", "jps-model", "jdom") } - compileOnly(intellijPluginDep("android")) { includeJars("jps/android-jps-plugin") } - compile(intellijPluginDep("android")) { includeJars("jps/android-jps-plugin") } - - testCompile(projectTests(":jps-plugin")) - testCompile(commonDep("junit:junit")) - testCompile(project(":kotlin-test:kotlin-test-jvm")) - testCompile(projectTests(":kotlin-build-common")) - testCompileOnly(intellijDep()) { includeJars("openapi", "jps-builders") } - testCompileOnly(intellijDep("jps-build-test")) { includeJars("jps-build-test") } - testCompileOnly(intellijDep()) { includeJars("jps-model") } - - testRuntime(intellijPluginDep("android")) - testRuntime(intellijPluginDep("smali")) - testRuntime(intellijDep("jps-build-test")) - testRuntime(intellijDep("jps-standalone")) -} - -sourceSets { - "main" { projectDefault() } - "test" { projectDefault() } -} - -projectTest { - workingDir = rootDir - useAndroidSdk() -} - -testsJar {} \ No newline at end of file diff --git a/plugins/android-extensions/android-extensions-jps/build.gradle.kts.as33 b/plugins/android-extensions/android-extensions-jps/build.gradle.kts.as33 deleted file mode 100644 index 4b9c83c3df1..00000000000 --- a/plugins/android-extensions/android-extensions-jps/build.gradle.kts.as33 +++ /dev/null @@ -1,41 +0,0 @@ - -plugins { - kotlin("jvm") - id("jps-compatible") -} - -dependencies { - testRuntime(intellijDep()) - - compile(project(":compiler:util")) - compile(project(":jps-plugin")) - compile(project(":plugins:android-extensions-compiler")) - compileOnly(intellijDep()) { includeJars("openapi", "platform-api", "jps-builders", "jps-model", "jdom") } - compileOnly(intellijPluginDep("android")) { includeJars("jps/android-jps-plugin") } - compile(intellijPluginDep("android")) { includeJars("jps/android-jps-plugin") } - - testCompile(projectTests(":jps-plugin")) - testCompile(commonDep("junit:junit")) - testCompile(project(":kotlin-test:kotlin-test-jvm")) - testCompile(projectTests(":kotlin-build-common")) - testCompileOnly(intellijDep()) { includeJars("openapi", "jps-builders") } - testCompileOnly(intellijDep("jps-build-test")) { includeJars("jps-build-test") } - testCompileOnly(intellijDep()) { includeJars("jps-model") } - - testRuntime(intellijPluginDep("android")) - testRuntime(intellijPluginDep("smali")) - testRuntime(intellijDep("jps-build-test")) - testRuntime(intellijDep("jps-standalone")) -} - -sourceSets { - "main" {} - "test" {} -} - -projectTest { - workingDir = rootDir - useAndroidSdk() -} - -testsJar {} \ No newline at end of file diff --git a/plugins/kapt3/kapt3-compiler/build.gradle.kts b/plugins/kapt3/kapt3-compiler/build.gradle.kts index 0a621dc934f..ee8d088f122 100644 --- a/plugins/kapt3/kapt3-compiler/build.gradle.kts +++ b/plugins/kapt3/kapt3-compiler/build.gradle.kts @@ -9,7 +9,11 @@ plugins { dependencies { testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") } testRuntime(intellijDep()) - testCompileOnly(intellijDep()) { includeJars("idea", "idea_rt", "openapi", "platform-api", "platform-impl") } + testCompileOnly(intellijDep()) { includeJars("idea", "idea_rt", "openapi") } + + Platform[181].orHigher { + testCompileOnly(intellijDep()) { includeJars("platform-api", "platform-impl") } + } compile(project(":compiler:util")) compile(project(":compiler:cli")) diff --git a/plugins/kapt3/kapt3-compiler/build.gradle.kts.173 b/plugins/kapt3/kapt3-compiler/build.gradle.kts.173 deleted file mode 100644 index 49c0e3c45d7..00000000000 --- a/plugins/kapt3/kapt3-compiler/build.gradle.kts.173 +++ /dev/null @@ -1,56 +0,0 @@ - -description = "Annotation Processor for Kotlin" - -plugins { - kotlin("jvm") - id("jps-compatible") -} - -dependencies { - testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") } - testRuntime(intellijDep()) - testCompileOnly(intellijDep()) { includeJars("idea", "idea_rt", "openapi") } - - compile(project(":compiler:util")) - compile(project(":compiler:cli")) - compile(project(":compiler:backend")) - compile(project(":compiler:frontend")) - compile(project(":compiler:frontend.java")) - compile(project(":compiler:plugin-api")) - compileOnly(project(":kotlin-annotation-processing-base")) - compileOnly(project(":kotlin-annotation-processing-runtime")) - compileOnly(intellijCoreDep()) { includeJars("intellij-core") } - compileOnly(intellijDep()) { includeJars("asm-all", rootProject = rootProject) } - - testCompile(projectTests(":compiler:tests-common")) - testCompile(project(":kotlin-annotation-processing-base")) - testCompile(projectTests(":kotlin-annotation-processing-base")) - testCompile(commonDep("junit:junit")) - testCompile(project(":kotlin-annotation-processing-runtime")) - - embeddedComponents(project(":kotlin-annotation-processing-runtime")) { isTransitive = false } - embeddedComponents(project(":kotlin-annotation-processing-base")) { isTransitive = false } -} - -sourceSets { - "main" { projectDefault() } - "test" { projectDefault() } -} - -testsJar {} - -projectTest { - workingDir = rootDir - dependsOn(":dist") -} - -runtimeJar { - fromEmbeddedComponents() -} - -sourcesJar() -javadocJar() - -dist() - -publish() diff --git a/plugins/kapt3/kapt3-compiler/build.gradle.kts.as32 b/plugins/kapt3/kapt3-compiler/build.gradle.kts.as32 deleted file mode 100644 index 49c0e3c45d7..00000000000 --- a/plugins/kapt3/kapt3-compiler/build.gradle.kts.as32 +++ /dev/null @@ -1,56 +0,0 @@ - -description = "Annotation Processor for Kotlin" - -plugins { - kotlin("jvm") - id("jps-compatible") -} - -dependencies { - testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") } - testRuntime(intellijDep()) - testCompileOnly(intellijDep()) { includeJars("idea", "idea_rt", "openapi") } - - compile(project(":compiler:util")) - compile(project(":compiler:cli")) - compile(project(":compiler:backend")) - compile(project(":compiler:frontend")) - compile(project(":compiler:frontend.java")) - compile(project(":compiler:plugin-api")) - compileOnly(project(":kotlin-annotation-processing-base")) - compileOnly(project(":kotlin-annotation-processing-runtime")) - compileOnly(intellijCoreDep()) { includeJars("intellij-core") } - compileOnly(intellijDep()) { includeJars("asm-all", rootProject = rootProject) } - - testCompile(projectTests(":compiler:tests-common")) - testCompile(project(":kotlin-annotation-processing-base")) - testCompile(projectTests(":kotlin-annotation-processing-base")) - testCompile(commonDep("junit:junit")) - testCompile(project(":kotlin-annotation-processing-runtime")) - - embeddedComponents(project(":kotlin-annotation-processing-runtime")) { isTransitive = false } - embeddedComponents(project(":kotlin-annotation-processing-base")) { isTransitive = false } -} - -sourceSets { - "main" { projectDefault() } - "test" { projectDefault() } -} - -testsJar {} - -projectTest { - workingDir = rootDir - dependsOn(":dist") -} - -runtimeJar { - fromEmbeddedComponents() -} - -sourcesJar() -javadocJar() - -dist() - -publish() diff --git a/plugins/sam-with-receiver/sam-with-receiver-ide/build.gradle.kts b/plugins/sam-with-receiver/sam-with-receiver-ide/build.gradle.kts index 27b6f93e9e2..3bb12fdc5e1 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-ide/build.gradle.kts +++ b/plugins/sam-with-receiver/sam-with-receiver-ide/build.gradle.kts @@ -15,10 +15,18 @@ dependencies { compile(project(":compiler:frontend")) compile(project(":compiler:frontend.java")) compile(project(":idea:idea-core")) - compile(project(":idea:idea-android")) + + Ide.AS33.orHigher.not { + compile(project(":idea:idea-android")) + } + compile(project(":idea")) compile(project(":idea:idea-jvm")) - compile(intellijDep()) { includeJars("openapi", "platform-api", "extensions", "util") } + + compile(intellijDep()) { includeJars("openapi", "extensions", "util") } + Platform[181].orHigher { + compile(intellijDep()) { includeJars("platform-api") } + } } sourceSets { diff --git a/plugins/sam-with-receiver/sam-with-receiver-ide/build.gradle.kts.173 b/plugins/sam-with-receiver/sam-with-receiver-ide/build.gradle.kts.173 deleted file mode 100644 index 0603f259ac8..00000000000 --- a/plugins/sam-with-receiver/sam-with-receiver-ide/build.gradle.kts.173 +++ /dev/null @@ -1,32 +0,0 @@ - -description = "Kotlin SamWithReceiver IDEA Plugin" - -plugins { - kotlin("jvm") - id("jps-compatible") -} - -jvmTarget = "1.6" - -dependencies { - compile(project(":kotlin-sam-with-receiver-compiler-plugin")) - compile(project(":plugins:annotation-based-compiler-plugins-ide-support")) - compile(project(":compiler:util")) - compile(project(":compiler:frontend")) - compile(project(":compiler:frontend.java")) - compile(project(":idea:idea-core")) - compile(project(":idea:idea-android")) - compile(project(":idea")) - compile(project(":idea:idea-jvm")) - compile(intellijDep()) { includeJars("openapi", "extensions", "util") } -} - -sourceSets { - "main" { projectDefault() } - "test" {} -} - -runtimeJar() - -ideaPlugin() - diff --git a/plugins/sam-with-receiver/sam-with-receiver-ide/build.gradle.kts.as33 b/plugins/sam-with-receiver/sam-with-receiver-ide/build.gradle.kts.as33 deleted file mode 100644 index 906b7335142..00000000000 --- a/plugins/sam-with-receiver/sam-with-receiver-ide/build.gradle.kts.as33 +++ /dev/null @@ -1,31 +0,0 @@ - -description = "Kotlin SamWithReceiver IDEA Plugin" - -plugins { - kotlin("jvm") - id("jps-compatible") -} - -jvmTarget = "1.6" - -dependencies { - compile(project(":kotlin-sam-with-receiver-compiler-plugin")) - compile(project(":plugins:annotation-based-compiler-plugins-ide-support")) - compile(project(":compiler:util")) - compile(project(":compiler:frontend")) - compile(project(":compiler:frontend.java")) - compile(project(":idea:idea-core")) - compile(project(":idea")) - compile(project(":idea:idea-jvm")) - compile(intellijDep()) { includeJars("openapi", "platform-api", "extensions", "util") } -} - -sourceSets { - "main" { projectDefault() } - "test" {} -} - -runtimeJar() - -ideaPlugin() - diff --git a/plugins/uast-kotlin/build.gradle.kts b/plugins/uast-kotlin/build.gradle.kts index 407af133bf6..1543790415b 100644 --- a/plugins/uast-kotlin/build.gradle.kts +++ b/plugins/uast-kotlin/build.gradle.kts @@ -12,9 +12,16 @@ dependencies { compile(project(":compiler:frontend.java")) compile(project(":compiler:light-classes")) - // BEWARE: Uast should not depend on IDEA. - compileOnly(intellijCoreDep()) { includeJars("intellij-core") } - compileOnly(intellijDep()) { includeJars("java-api", "java-impl", "asm-all", rootProject = rootProject) } + Platform[181].orHigher { + // BEWARE: Uast should not depend on IDEA. + compileOnly(intellijCoreDep()) { includeJars("intellij-core") } + compileOnly(intellijDep()) { includeJars("java-api", "java-impl", "asm-all", rootProject = rootProject) } + } + + Platform[173].orLower { + compile(project(":idea:idea-core")) + compileOnly(intellijDep()) { includeJars("openapi", "idea", "util", "extensions", "asm-all", rootProject = rootProject) } + } testCompile(project(":kotlin-test:kotlin-test-jvm")) testCompile(projectTests(":compiler:tests-common")) @@ -22,7 +29,15 @@ dependencies { testCompile(project(":compiler:util")) testCompile(project(":compiler:cli")) testCompile(projectTests(":idea:idea-test-framework")) - testCompileOnly(intellijDep()) { includeJars("java-api", "java-impl") } + + Platform[181].orHigher { + testCompileOnly(intellijDep()) { includeJars("java-api", "java-impl") } + } + + Platform[173].orLower { + testCompileOnly(intellijDep()) { includeJars("idea_rt") } + } + testCompile(project(":idea:idea-native")) { isTransitive = false } testCompile(project(":idea:idea-gradle-native")) { isTransitive = false } diff --git a/plugins/uast-kotlin/build.gradle.kts.173 b/plugins/uast-kotlin/build.gradle.kts.173 deleted file mode 100644 index 9bb6134a960..00000000000 --- a/plugins/uast-kotlin/build.gradle.kts.173 +++ /dev/null @@ -1,56 +0,0 @@ - -plugins { - kotlin("jvm") - id("jps-compatible") -} - -dependencies { - compile(project(":kotlin-stdlib")) - compile(project(":core:util.runtime")) - compile(project(":compiler:backend")) - compile(project(":compiler:frontend")) - compile(project(":compiler:frontend.java")) - compile(project(":compiler:light-classes")) - compile(project(":idea:idea-core")) - compileOnly(intellijDep()) { includeJars("openapi", "idea", "util", "extensions", "asm-all", rootProject = rootProject) } - - testCompile(project(":kotlin-test:kotlin-test-jvm")) - testCompile(projectTests(":compiler:tests-common")) - testCompile(commonDep("junit:junit")) - testCompile(project(":compiler:util")) - testCompile(project(":compiler:cli")) - testCompile(projectTests(":idea:idea-test-framework")) - testCompileOnly(intellijDep()) { includeJars("idea_rt") } - testCompile(project(":idea:idea-native")) { isTransitive = false } - testCompile(project(":idea:idea-gradle-native")) { isTransitive = false } - - testRuntime(project(":kotlin-native:kotlin-native-library-reader")) { isTransitive = false } - testRuntime(project(":kotlin-native:kotlin-native-utils")) { isTransitive = false } - testRuntime(project(":kotlin-reflect")) - testRuntime(project(":idea:idea-android")) - testRuntime(project(":idea:idea-gradle")) - testRuntime(project(":plugins:kapt3-idea")) { isTransitive = false } - testRuntime(project(":sam-with-receiver-ide-plugin")) - testRuntime(project(":allopen-ide-plugin")) - testRuntime(project(":noarg-ide-plugin")) - testRuntime(project(":kotlin-scripting-idea")) - testRuntime(project(":plugins:android-extensions-ide")) - testRuntime(project(":plugins:kapt3-idea")) - testRuntime(project(":kotlinx-serialization-ide-plugin")) - testRuntime(intellijDep()) - testRuntime(intellijPluginDep("junit")) - testRuntime(intellijPluginDep("gradle")) - testRuntime(intellijPluginDep("Groovy")) - testRuntime(intellijPluginDep("properties")) -} - -sourceSets { - "main" { projectDefault() } - "test" { projectDefault() } -} - -testsJar {} - -projectTest { - workingDir = rootDir -} diff --git a/versions.gradle.kts b/versions.gradle.kts index 10ba13110d6..d278ae2fbe4 100644 --- a/versions.gradle.kts +++ b/versions.gradle.kts @@ -27,6 +27,8 @@ if (intellijVersionDelimiterIndex == -1) { val platformBaseVersion = intellijVersion.substring(0, intellijVersionDelimiterIndex) val platform = androidStudioVersion?.let { "AS$it" } ?: platformBaseVersion +rootProject.extra["versions.platform"] = platform + when (platform) { "183" -> { extra["versions.jar.guava"] = "25.1-jre" diff --git a/versions.gradle.kts.173 b/versions.gradle.kts.173 index ba649ca477f..8d2a8528a25 100644 --- a/versions.gradle.kts.173 +++ b/versions.gradle.kts.173 @@ -28,6 +28,8 @@ if (intellijVersionDelimiterIndex == -1) { val platformBaseVersion = intellijVersion.substring(0, intellijVersionDelimiterIndex) val platform = androidStudioVersion?.let { "AS$it" } ?: platformBaseVersion +rootProject.extra["versions.platform"] = platform + when (platform) { "183" -> { extra["versions.jar.guava"] = "25.1-jre" diff --git a/versions.gradle.kts.181 b/versions.gradle.kts.181 index ed29dda7405..b8fdb78fd25 100644 --- a/versions.gradle.kts.181 +++ b/versions.gradle.kts.181 @@ -28,6 +28,8 @@ if (intellijVersionDelimiterIndex == -1) { val platformBaseVersion = intellijVersion.substring(0, intellijVersionDelimiterIndex) val platform = androidStudioVersion?.let { "AS$it" } ?: platformBaseVersion +rootProject.extra["versions.platform"] = platform + when (platform) { "183" -> { extra["versions.jar.guava"] = "25.1-jre" diff --git a/versions.gradle.kts.183 b/versions.gradle.kts.183 index 2735e91377f..9066237344a 100644 --- a/versions.gradle.kts.183 +++ b/versions.gradle.kts.183 @@ -27,6 +27,8 @@ if (intellijVersionDelimiterIndex == -1) { val platformBaseVersion = intellijVersion.substring(0, intellijVersionDelimiterIndex) val platform = androidStudioVersion?.let { "AS$it" } ?: platformBaseVersion +rootProject.extra["versions.platform"] = platform + when (platform) { "183" -> { extra["versions.jar.guava"] = "25.1-jre" diff --git a/versions.gradle.kts.as31 b/versions.gradle.kts.as31 index c88569f956e..2fa9ceca4a2 100644 --- a/versions.gradle.kts.as31 +++ b/versions.gradle.kts.as31 @@ -28,6 +28,8 @@ if (intellijVersionDelimiterIndex == -1) { val platformBaseVersion = intellijVersion.substring(0, intellijVersionDelimiterIndex) val platform = androidStudioVersion?.let { "AS$it" } ?: platformBaseVersion +rootProject.extra["versions.platform"] = platform + when (platform) { "183" -> { extra["versions.jar.guava"] = "25.1-jre" diff --git a/versions.gradle.kts.as32 b/versions.gradle.kts.as32 index 1834eebaa32..c20774f0e38 100644 --- a/versions.gradle.kts.as32 +++ b/versions.gradle.kts.as32 @@ -28,6 +28,8 @@ if (intellijVersionDelimiterIndex == -1) { val platformBaseVersion = intellijVersion.substring(0, intellijVersionDelimiterIndex) val platform = androidStudioVersion?.let { "AS$it" } ?: platformBaseVersion +rootProject.extra["versions.platform"] = platform + when (platform) { "183" -> { extra["versions.jar.guava"] = "25.1-jre" diff --git a/versions.gradle.kts.as33 b/versions.gradle.kts.as33 index 849a733ed1c..ecc9451d66b 100644 --- a/versions.gradle.kts.as33 +++ b/versions.gradle.kts.as33 @@ -27,6 +27,8 @@ if (intellijVersionDelimiterIndex == -1) { val platformBaseVersion = intellijVersion.substring(0, intellijVersionDelimiterIndex) val platform = androidStudioVersion?.let { "AS$it" } ?: platformBaseVersion +rootProject.extra["versions.platform"] = platform + when (platform) { "183" -> { extra["versions.jar.guava"] = "25.1-jre"