Kotlin Facet: Support "implements" relation between modules

#KT-17593 Fixed
This commit is contained in:
Alexey Sedunov
2017-08-15 19:00:47 +03:00
parent 8ebc766b5b
commit bdad58cec6
6 changed files with 288 additions and 4 deletions
@@ -47,6 +47,7 @@ interface KotlinGradleModel : Serializable {
val compilerArgumentsBySourceSet: CompilerArgumentsBySourceSet
val coroutines: String?
val platformPluginId: String?
val implements: String?
val transitiveCommonDependencies: Set<String>
}
@@ -55,6 +56,7 @@ class KotlinGradleModelImpl(
override val compilerArgumentsBySourceSet: CompilerArgumentsBySourceSet,
override val coroutines: String?,
override val platformPluginId: String?,
override val implements: String?,
override val transitiveCommonDependencies: Set<String>
) : KotlinGradleModel
@@ -191,13 +193,15 @@ class KotlinGradleModelBuilder : ModelBuilderService {
}
val platform = platformPluginId ?: pluginToPlatform.entries.singleOrNull { project.plugins.findPlugin(it.key) != null }?.value
val transitiveCommon = getImplements(project)?.let { transitiveCommonDependencies(it) } ?: emptySet()
val implementedProject = getImplements(project)
val transitiveCommon = implementedProject?.let { transitiveCommonDependencies(it) } ?: emptySet()
return KotlinGradleModelImpl(
kotlinPluginId != null || platformPluginId != null,
compilerArgumentsBySourceSet,
getCoroutines(project),
platform,
implementedProject?.pathOrName(),
transitiveCommon
)
}