[gradle-plugin] Fix incompatibility with older metadata

This commit is contained in:
Ilya Matveev
2018-09-24 13:28:58 +03:00
committed by Ilya Matveev
parent 080ecf0d11
commit ba14e032a2
3 changed files with 3 additions and 0 deletions
@@ -78,6 +78,7 @@ interface KotlinNativeBinary : ComponentWithDependencies, BuildableComponent, Co
companion object {
val KONAN_TARGET_ATTRIBUTE = Attribute.of("org.jetbrains.kotlin.native.target", String::class.java)
val OLD_KONAN_TARGET_ATTRIBUTE = Attribute.of("org.gradle.native.kotlin.platform", String::class.java)
}
}
@@ -111,6 +111,7 @@ abstract class AbstractKotlinNativeBinary(
attributes.attribute(CppBinary.OPTIMIZED_ATTRIBUTE, optimized)
attributes.attribute(KotlinPlatformType.attribute, KotlinPlatformType.native)
attributes.attribute(KotlinNativeBinary.KONAN_TARGET_ATTRIBUTE, konanTarget.name)
attributes.attribute(KotlinNativeBinary.OLD_KONAN_TARGET_ATTRIBUTE, konanTarget.name)
attributes.attribute(OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE, konanTarget.getGradleOSFamily(objects))
extendsFrom(getImplementationDependencies())
}
@@ -87,6 +87,7 @@ open class CInteropSettingsImpl @Inject constructor(
attributes.attribute(CppBinary.OPTIMIZED_ATTRIBUTE, KotlinNativeBuildType.DEBUG.optimized)
attributes.attribute(KotlinPlatformType.attribute, KotlinPlatformType.native)
attributes.attribute(KotlinNativeBinary.KONAN_TARGET_ATTRIBUTE, konanTarget.name)
attributes.attribute(KotlinNativeBinary.OLD_KONAN_TARGET_ATTRIBUTE, konanTarget.name)
attributes.attribute(
OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE,
konanTarget.getGradleOSFamily(objects)