[gradle-plugin] Use main targets in the test component by default

This commit is contained in:
Ilya Matveev
2018-08-30 16:01:27 +07:00
committed by Ilya Matveev
parent 94e6c2a514
commit a91f91bc65
2 changed files with 6 additions and 3 deletions
@@ -41,6 +41,7 @@ open class KotlinNativeTestSuite @Inject constructor(
init {
getImplementationDependencies().extendsFrom(testedComponent.getImplementationDependencies())
konanTargets.set(project.provider { testedComponent.konanTargets.get() })
}
override fun getDisplayName(): DisplayName = Describables.withTypeAndName("Kotlin/Native test suite", name)
@@ -175,9 +175,11 @@ class KotlinNativePlugin @Inject constructor(val attributesFactory: ImmutableAtt
objects
)
val binary = component.addTestExecutable(variantIdentity)
if (target == HostManager.host) {
component.testBinary.set(binary)
if (hostManager.isEnabled(target)) {
val binary = component.addTestExecutable(variantIdentity)
if (target == HostManager.host) {
component.testBinary.set(binary)
}
}
}
component.binaries.realizeNow()