File tree Expand file tree Collapse file tree 3 files changed +29
-22
lines changed
build-support/src/main/kotlin Expand file tree Collapse file tree 3 files changed +29
-22
lines changed Original file line number Diff line number Diff line change 3838
3939 test-jvm :
4040 name : Test JVM
41- runs-on : macos-11
41+ runs-on : ubuntu-latest
4242 needs : lint
4343 strategy :
4444 matrix :
Original file line number Diff line number Diff line change 11import org.gradle.kotlin.dsl.creating
22import org.gradle.kotlin.dsl.getValue
33import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
4+ import org.jetbrains.kotlin.konan.target.HostManager
45
56fun KotlinMultiplatformExtension.native () {
67 sourceSets.apply {
@@ -17,24 +18,26 @@ fun KotlinMultiplatformExtension.native() {
1718 }
1819
1920 // Darwin targets
20- val darwinMain by creating { dependsOn(nativeMain) }
21- val darwinTest by creating { dependsOn(nativeTest) }
22- listOf (
23- iosX64(),
24- iosArm64(),
25- iosSimulatorArm64(),
26- macosX64(),
27- macosArm64(),
28- tvosX64(),
29- tvosArm64(),
30- tvosSimulatorArm64(),
31- watchosArm32(),
32- watchosArm64(),
33- watchosX64(),
34- watchosSimulatorArm64(),
35- ).forEach { target ->
36- getByName(" ${target.name} Main" ).dependsOn(darwinMain)
37- getByName(" ${target.name} Test" ).dependsOn(darwinTest)
21+ if (HostManager .hostIsMac) {
22+ val darwinMain by creating { dependsOn(nativeMain) }
23+ val darwinTest by creating { dependsOn(nativeTest) }
24+ listOf (
25+ iosX64(),
26+ iosArm64(),
27+ iosSimulatorArm64(),
28+ macosX64(),
29+ macosArm64(),
30+ tvosX64(),
31+ tvosArm64(),
32+ tvosSimulatorArm64(),
33+ watchosArm32(),
34+ watchosArm64(),
35+ watchosX64(),
36+ watchosSimulatorArm64(),
37+ ).forEach { target ->
38+ getByName(" ${target.name} Main" ).dependsOn(darwinMain)
39+ getByName(" ${target.name} Test" ).dependsOn(darwinTest)
40+ }
3841 }
3942 }
4043}
Original file line number Diff line number Diff line change 1+ import org.jetbrains.kotlin.konan.target.HostManager
2+
13plugins {
24 kotlin(" multiplatform" )
35 kotlin(" plugin.serialization" )
@@ -72,9 +74,11 @@ kotlin {
7274 implementation(libs.ktor.client.curl)
7375 }
7476 }
75- val darwinTest by getting {
76- dependencies {
77- implementation(libs.ktor.client.darwin)
77+ if (HostManager .hostIsMac) {
78+ val darwinTest by getting {
79+ dependencies {
80+ implementation(libs.ktor.client.darwin)
81+ }
7882 }
7983 }
8084 }
You can’t perform that action at this time.
0 commit comments