Add macos in targets for new MPP integration tests

This commit is contained in:
Ilya Matveev
2018-08-24 19:15:18 +07:00
committed by Ilya Matveev
parent 577bae763c
commit 0a685d57c2
5 changed files with 31 additions and 2 deletions
@@ -11,6 +11,7 @@ import org.jetbrains.kotlin.gradle.plugin.sources.SourceSetConsistencyChecks
import org.jetbrains.kotlin.gradle.util.checkBytecodeContains
import org.jetbrains.kotlin.gradle.util.isWindows
import org.jetbrains.kotlin.gradle.util.modify
import org.jetbrains.kotlin.konan.target.HostManager
import org.junit.Assert
import org.junit.Test
import java.util.zip.ZipFile
@@ -28,7 +29,12 @@ class NewMultiplatformIT : BaseGradleIT() {
val appProject = Project("sample-app", gradleVersion, "new-mpp-lib-and-app")
val oldStyleAppProject = Project("sample-old-style-app", gradleVersion, "new-mpp-lib-and-app")
val hostTargetName = if (isWindows) "mingw64" else "linux64"
val hostTargetName = when {
HostManager.hostIsMingw -> "mingw64"
HostManager.hostIsLinux -> "linux64"
HostManager.hostIsMac -> "macos64"
else -> error("Unknown host")
}
val compileTasksNames =
listOf("Jvm6", "NodeJs", "Metadata", "Wasm32", hostTargetName.capitalize()).map { ":compileKotlin$it" }
@@ -61,8 +61,9 @@ kotlin {
fromPreset(presets.wasm32, 'wasm32')
fromPreset(presets.linuxX64, 'linux64')
fromPreset(presets.mingwX64, 'mingw64')
fromPreset(presets.macosX64, 'macos64')
configure([wasm32, linux64, mingw64]) {
configure([wasm32, linux64, mingw64, macos64]) {
compilations.main.outputKinds += org.jetbrains.kotlin.gradle.plugin.mpp.NativeOutputKind.EXECUTABLE
}
}
@@ -0,0 +1,11 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
import com.example.lib.*
fun main(args: Array<String>) {
id(id(123))
expectedFun()
}
@@ -26,6 +26,7 @@ kotlin {
fromPreset(presets.wasm32, 'wasm32')
fromPreset(presets.linuxX64, 'linux64')
fromPreset(presets.mingwX64, 'mingw64')
fromPreset(presets.macosX64, 'macos64')
}
sourceSets {
jvm6Main {
@@ -0,0 +1,10 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package com.example.lib
actual fun expectedFun(): Unit {
id(123)
}