Allow the common platform type consumers to consume platform artifacts

When a Kotlin metadata input configuration tries to resolve a module
with no Kotlin metadata (such as: plain old Maven module, a non-MPP
Kotlin project with a single platform), it should be able to resolve
successfully.

Given that the input metadata configurations extend from source set
dependencies configurations, where platform-specific dependencies may
occur, allowing the metadata configuration to resolve such dependencies
into platform artifacts seems to achieve successful dependency
resolution.

Issue #KT-26834 Fixed
This commit is contained in:
Sergey Igushkin
2018-09-21 22:29:18 +03:00
parent 269410d7aa
commit 76b51b1058
2 changed files with 36 additions and 15 deletions
@@ -78,11 +78,7 @@ abstract class KotlinBasePluginWrapper(
}
private fun setupAttributeMatchingStrategy(project: Project) = with(project.dependencies.attributesSchema) {
attribute(KotlinPlatformType.attribute).run {
if (isGradleVersionAtLeast(4, 0)) {
compatibilityRules.add(KotlinPlatformType.CompatibilityRule::class.java)
}
}
KotlinPlatformType.setupAttributesMatchingStrategy(this)
}
internal abstract fun getPlugin(