Download native compiler in configuration stage

This commit is contained in:
Ilya Matveev
2018-09-12 13:48:58 +03:00
committed by Ilya Matveev
parent 5a64067601
commit 80bec0898f
7 changed files with 149 additions and 128 deletions
@@ -17,6 +17,7 @@ import org.junit.Test
import java.util.jar.JarFile
import java.util.zip.ZipFile
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertTrue
class NewMultiplatformIT : BaseGradleIT() {
@@ -607,4 +608,21 @@ class NewMultiplatformIT : BaseGradleIT() {
assertTrue(output.contains("Dependent: Published print"), "No test output found")
}
}
@Test
fun testNativeCompilerDownloading() {
// The plugin shouldn't download the K/N compiler if there is no corresponding targets in the project.
with(Project("new-mpp-lib-with-tests", gradleVersion)) {
build("tasks") {
assertSuccessful()
assertFalse(output.contains("Kotlin/Native distribution: "))
}
}
with(Project("new-mpp-native-libraries", gradleVersion)) {
build("tasks") {
assertSuccessful()
assertTrue(output.contains("Kotlin/Native distribution: "))
}
}
}
}