From 79e3b31ffc46672e87c18e7d2cc5cf1c4dfaf4ec Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Fri, 14 Sep 2018 17:24:40 +0300 Subject: [PATCH] MPP: Allow 'implements' relation only within the same Gradle project Also allow COMMON modules on the "implementer" side Original commit: 619e2bc0dbc3f522f833cf1edee4713b14d092df --- .../src/org/jetbrains/kotlin/config/KotlinFacetSettings.kt | 2 ++ .../src/org/jetbrains/kotlin/config/facetSerialization.kt | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/jps/jps-common/src/org/jetbrains/kotlin/config/KotlinFacetSettings.kt b/jps/jps-common/src/org/jetbrains/kotlin/config/KotlinFacetSettings.kt index 14c0d2f3136..912246c6457 100644 --- a/jps/jps-common/src/org/jetbrains/kotlin/config/KotlinFacetSettings.kt +++ b/jps/jps-common/src/org/jetbrains/kotlin/config/KotlinFacetSettings.kt @@ -216,6 +216,8 @@ class KotlinFacetSettings { var kind: KotlinModuleKind = KotlinModuleKind.DEFAULT var sourceSetNames: List = emptyList() var isTestModule: Boolean = false + + var externalProjectId: String = "" } interface KotlinFacetSettingsProvider { diff --git a/jps/jps-common/src/org/jetbrains/kotlin/config/facetSerialization.kt b/jps/jps-common/src/org/jetbrains/kotlin/config/facetSerialization.kt index 33eb65f939a..d0480dfbcc5 100644 --- a/jps/jps-common/src/org/jetbrains/kotlin/config/facetSerialization.kt +++ b/jps/jps-common/src/org/jetbrains/kotlin/config/facetSerialization.kt @@ -132,6 +132,7 @@ private fun readV2AndLaterConfig(element: Element): KotlinFacetSettings { } else null } ?: KotlinModuleKind.DEFAULT isTestModule = element.getAttributeValue("isTestModule")?.toBoolean() ?: false + externalProjectId = element.getAttributeValue("externalProjectId") ?: "" element.getChild("compilerSettings")?.let { compilerSettings = CompilerSettings() XmlSerializer.deserializeInto(compilerSettings!!, it) @@ -292,6 +293,9 @@ private fun KotlinFacetSettings.writeLatestConfig(element: Element) { element.addContent(Element("newMppModelJpsModuleKind").apply { addContent(kind.name) }) element.setAttribute("isTestModule", isTestModule.toString()) } + if (externalProjectId.isNotEmpty()) { + element.setAttribute("externalProjectId", externalProjectId) + } productionOutputPath?.let { if (it != (compilerArguments as? K2JSCompilerArguments)?.outputFile) { element.addContent(Element("productionOutputPath").apply { addContent(PathUtil.toSystemIndependentName(it)) })