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 38
38
39
39
test-jvm :
40
40
name : Test JVM
41
- runs-on : macos-11
41
+ runs-on : ubuntu-latest
42
42
needs : lint
43
43
strategy :
44
44
matrix :
Original file line number Diff line number Diff line change 1
1
import org.gradle.kotlin.dsl.creating
2
2
import org.gradle.kotlin.dsl.getValue
3
3
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
4
+ import org.jetbrains.kotlin.konan.target.HostManager
4
5
5
6
fun KotlinMultiplatformExtension.native () {
6
7
sourceSets.apply {
@@ -17,24 +18,26 @@ fun KotlinMultiplatformExtension.native() {
17
18
}
18
19
19
20
// 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
+ }
38
41
}
39
42
}
40
43
}
Original file line number Diff line number Diff line change
1
+ import org.jetbrains.kotlin.konan.target.HostManager
2
+
1
3
plugins {
2
4
kotlin(" multiplatform" )
3
5
kotlin(" plugin.serialization" )
@@ -72,9 +74,11 @@ kotlin {
72
74
implementation(libs.ktor.client.curl)
73
75
}
74
76
}
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
+ }
78
82
}
79
83
}
80
84
}
You can’t perform that action at this time.
0 commit comments