diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 2346bebe3b3..72bdb491c49 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -33,6 +33,10 @@ plugins { gradlePlugin { (plugins) { + "jps-compatible-base" { + id = "jps-compatible-base" + implementationClass = "org.jetbrains.kotlin.pill.JpsCompatibleBasePlugin" + } "jps-compatible" { id = "jps-compatible" implementationClass = "org.jetbrains.kotlin.pill.JpsCompatiblePlugin" diff --git a/buildSrc/src/main/kotlin/dependencies.kt b/buildSrc/src/main/kotlin/dependencies.kt index 8f9616a343d..f341a4e3c4f 100644 --- a/buildSrc/src/main/kotlin/dependencies.kt +++ b/buildSrc/src/main/kotlin/dependencies.kt @@ -107,10 +107,6 @@ object EmbeddedComponents { val CONFIGURATION_NAME = "embeddedComponents" } -fun Project.containsEmbeddedComponents() { - configurations.create(EmbeddedComponents.CONFIGURATION_NAME) -} - fun AbstractCopyTask.fromEmbeddedComponents() { val embeddedComponents = project.configurations.getByName(EmbeddedComponents.CONFIGURATION_NAME) if (this is ShadowJar) { diff --git a/buildSrc/src/main/kotlin/pill/plugin.kt b/buildSrc/src/main/kotlin/pill/plugin.kt index 7f5f5ccb6c1..8b3d3f7ad11 100644 --- a/buildSrc/src/main/kotlin/pill/plugin.kt +++ b/buildSrc/src/main/kotlin/pill/plugin.kt @@ -10,6 +10,12 @@ import shadow.org.jdom2.output.Format import shadow.org.jdom2.output.XMLOutputter import java.io.File +class JpsCompatibleBasePlugin : Plugin { + override fun apply(project: Project) { + project.configurations.create(EmbeddedComponents.CONFIGURATION_NAME) + } +} + class JpsCompatiblePlugin : Plugin { companion object { private const val JPS_LIBRARY_PATH = "jpsLibraryPath" @@ -64,6 +70,7 @@ class JpsCompatiblePlugin : Plugin { } override fun apply(project: Project) { + project.plugins.apply(JpsCompatibleBasePlugin::class.java) // 'jpsTest' does not require the 'tests-jar' artifact project.configurations.create("jpsTest") diff --git a/compiler/daemon/daemon-client/build.gradle.kts b/compiler/daemon/daemon-client/build.gradle.kts index 613e9209b85..b00b2ee9f89 100644 --- a/compiler/daemon/daemon-client/build.gradle.kts +++ b/compiler/daemon/daemon-client/build.gradle.kts @@ -11,8 +11,6 @@ jvmTarget = "1.6" val nativePlatformVariants: List by rootProject.extra -containsEmbeddedComponents() - dependencies { compileOnly(project(":compiler:util")) compileOnly(project(":compiler:cli-common")) diff --git a/plugins/android-extensions/android-extensions-compiler/build.gradle.kts b/plugins/android-extensions/android-extensions-compiler/build.gradle.kts index d3f63de8f22..0cc877f477d 100644 --- a/plugins/android-extensions/android-extensions-compiler/build.gradle.kts +++ b/plugins/android-extensions/android-extensions-compiler/build.gradle.kts @@ -8,8 +8,6 @@ plugins { val robolectricClasspath by configurations.creating -containsEmbeddedComponents() - dependencies { testCompile(intellijCoreDep()) { includeJars("intellij-core") } diff --git a/plugins/kapt3/kapt3-compiler/build.gradle.kts b/plugins/kapt3/kapt3-compiler/build.gradle.kts index 7ca6e48854b..aa4891a4b9e 100644 --- a/plugins/kapt3/kapt3-compiler/build.gradle.kts +++ b/plugins/kapt3/kapt3-compiler/build.gradle.kts @@ -6,8 +6,6 @@ plugins { id("jps-compatible") } -containsEmbeddedComponents() - dependencies { testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") } testRuntime(intellijDep()) diff --git a/prepare/android-lint/build.gradle.kts b/prepare/android-lint/build.gradle.kts index a31f18b7ec9..7f050f3d72e 100644 --- a/prepare/android-lint/build.gradle.kts +++ b/prepare/android-lint/build.gradle.kts @@ -3,6 +3,7 @@ description = "Kotlin Android Lint" plugins { `java-base` + id("jps-compatible-base") } val projectsToShadow = listOf( @@ -15,8 +16,6 @@ sourceSets { "test" {} } -containsEmbeddedComponents() - dependencies { projectsToShadow.forEach { p -> embeddedComponents(project(p)) { isTransitive = false } diff --git a/prepare/jps-plugin/build.gradle.kts b/prepare/jps-plugin/build.gradle.kts index 9b0d6a86092..22f2cd6a00c 100644 --- a/prepare/jps-plugin/build.gradle.kts +++ b/prepare/jps-plugin/build.gradle.kts @@ -4,6 +4,7 @@ description = "Kotlin JPS plugin" plugins { `java-base` + id("jps-compatible-base") } val projectsToShadow = listOf( @@ -20,9 +21,6 @@ val projectsToShadow = listOf( ":core:util.runtime", ":plugins:android-extensions-jps") - -containsEmbeddedComponents() - dependencies { projectsToShadow.forEach { embeddedComponents(project(it)) { isTransitive = false }