[gradle-plugin] Don't create compiler tasks for unsupported targets

This commit is contained in:
Ilya Matveev
2018-07-18 20:10:40 +07:00
committed by ilmat192
parent 7ddfd8defa
commit 9a5086af1d
@@ -112,23 +112,26 @@ class KotlinNativePlugin @Inject constructor(val attributesFactory: ImmutableAtt
objects
)
val binary = component.addBinary(kind, variantIdentity)
if (hostManager.isEnabled(target)) {
val binary = component.addBinary(kind, variantIdentity)
if (kind.publishable) {
if (hostManager.isEnabled(target)) {
if (kind == developmentKind &&
buildType == KotlinNativeBuildType.DEBUG &&
target == developmentTarget) {
component.developmentBinary.set(binary)
}
if (kind.publishable) {
component.mainPublication.variants.add(binary)
} else {
}
} else {
if (kind.publishable) {
// Known but not buildable.
// It allows us to publish different parts of a multitarget library from differnt hosts.
component.mainPublication.variants.add(variantIdentity)
}
}
if (kind == developmentKind &&
buildType == KotlinNativeBuildType.DEBUG &&
target == developmentTarget) {
component.developmentBinary.set(binary)
}
}
}
}