Skip to content

Commit 2b145e2

Browse files
BernatCarbottypic
authored andcommitted
Added missing watchosDeviceArm64 target
1 parent 8f0db06 commit 2b145e2

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

examples/helloswift/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ kotlin {
1313
tvosSimulatorArm64(),
1414
watchosX64(),
1515
watchosArm64(),
16+
watchosDeviceArm64(),
1617
watchosSimulatorArm64(),
1718
macosArm64(),
1819
macosX64(),

plugin/src/main/kotlin/io/github/ttypic/swiftklib/gradle/CompileTarget.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ enum class CompileTarget {
99
iosSimulatorArm64,
1010
watchosX64,
1111
watchosArm64,
12+
watchosDeviceArm64,
1213
watchosSimulatorArm64,
1314
tvosX64,
1415
tvosArm64,
@@ -28,6 +29,7 @@ enum class CompileTarget {
2829
KonanTarget.IOS_SIMULATOR_ARM64.name -> iosSimulatorArm64
2930
KonanTarget.WATCHOS_X64.name -> watchosX64
3031
KonanTarget.WATCHOS_ARM64.name -> watchosArm64
32+
KonanTarget.WATCHOS_DEVICE_ARM64.name -> watchosDeviceArm64
3133
KonanTarget.WATCHOS_SIMULATOR_ARM64.name -> watchosSimulatorArm64
3234
KonanTarget.TVOS_X64.name -> tvosX64
3335
KonanTarget.TVOS_ARM64.name -> tvosArm64

plugin/src/main/kotlin/io/github/ttypic/swiftklib/gradle/task/CompileSwiftTask.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,15 +255,15 @@ abstract class CompileSwiftTask @Inject constructor(
255255
private fun CompileTarget.operatingSystem(): String =
256256
when (this) {
257257
CompileTarget.iosX64, CompileTarget.iosArm64, CompileTarget.iosSimulatorArm64 -> "ios$minIos"
258-
CompileTarget.watchosX64, CompileTarget.watchosArm64, CompileTarget.watchosSimulatorArm64 -> "watchos$minWatchos"
258+
CompileTarget.watchosX64, CompileTarget.watchosArm64, CompileTarget.watchosDeviceArm64, CompileTarget.watchosSimulatorArm64 -> "watchos$minWatchos"
259259
CompileTarget.tvosX64, CompileTarget.tvosArm64, CompileTarget.tvosSimulatorArm64 -> "tvos$minTvos"
260260
CompileTarget.macosX64, CompileTarget.macosArm64 -> "macosx$minMacos"
261261
}
262262

263263
private fun minOs(compileTarget: CompileTarget): Int =
264264
when (compileTarget) {
265265
CompileTarget.iosX64, CompileTarget.iosArm64, CompileTarget.iosSimulatorArm64 -> minIos
266-
CompileTarget.watchosX64, CompileTarget.watchosArm64, CompileTarget.watchosSimulatorArm64 -> minWatchos
266+
CompileTarget.watchosX64, CompileTarget.watchosArm64, CompileTarget.watchosDeviceArm64, CompileTarget.watchosSimulatorArm64 -> minWatchos
267267
CompileTarget.tvosX64, CompileTarget.tvosArm64, CompileTarget.tvosSimulatorArm64 -> minTvos
268268
CompileTarget.macosX64, CompileTarget.macosArm64 -> minMacos
269269
}
@@ -279,6 +279,7 @@ val SDKLESS_TARGETS = listOf(
279279
CompileTarget.iosArm64,
280280
CompileTarget.iosSimulatorArm64,
281281
CompileTarget.watchosArm64,
282+
CompileTarget.watchosDeviceArm64,
282283
CompileTarget.watchosX64,
283284
CompileTarget.watchosSimulatorArm64,
284285
CompileTarget.tvosArm64,

plugin/src/main/kotlin/io/github/ttypic/swiftklib/gradle/task/CompileTargetExt.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ internal fun CompileTarget.os() = when(this) {
77
CompileTarget.iosArm64 -> "iphoneos"
88
CompileTarget.iosSimulatorArm64 -> "iphonesimulator"
99
CompileTarget.watchosX64 -> "watchsimulator"
10-
CompileTarget.watchosArm64 -> "watchos"
10+
CompileTarget.watchosArm64, CompileTarget.watchosDeviceArm64 -> "watchos"
1111
CompileTarget.watchosSimulatorArm64 -> "watchsimulator"
1212
CompileTarget.tvosX64 -> "appletvsimulator"
1313
CompileTarget.tvosArm64 -> "appletvos"
@@ -22,6 +22,7 @@ internal fun CompileTarget.arch() = when(this) {
2222
CompileTarget.iosSimulatorArm64 -> "arm64"
2323
CompileTarget.watchosX64 -> "x86_64"
2424
CompileTarget.watchosArm64 -> "arm64"
25+
CompileTarget.watchosDeviceArm64 -> "arm64"
2526
CompileTarget.watchosSimulatorArm64 -> "arm64"
2627
CompileTarget.tvosX64 -> "x86_64"
2728
CompileTarget.tvosArm64 -> "arm64"
@@ -40,7 +41,7 @@ internal fun CompileTarget.simulatorSuffix() = when(this) {
4041
CompileTarget.iosArm64 -> ""
4142
CompileTarget.iosSimulatorArm64 -> "-simulator"
4243
CompileTarget.watchosX64 -> "-simulator"
43-
CompileTarget.watchosArm64 -> ""
44+
CompileTarget.watchosArm64, CompileTarget.watchosDeviceArm64 -> ""
4445
CompileTarget.watchosSimulatorArm64 -> "-simulator"
4546
CompileTarget.tvosX64 -> "-simulator"
4647
CompileTarget.tvosArm64 -> ""
@@ -52,7 +53,7 @@ internal fun CompileTarget.simulatorSuffix() = when(this) {
5253
internal fun CompileTarget.linkerPlatformVersionName() = when(this) {
5354
CompileTarget.iosArm64 -> "platform_version ios"
5455
CompileTarget.iosX64, CompileTarget.iosSimulatorArm64 -> "platform_version ios-simulator"
55-
CompileTarget.watchosArm64 -> "platform_version watchos"
56+
CompileTarget.watchosArm64, CompileTarget.watchosDeviceArm64 -> "platform_version watchos"
5657
CompileTarget.watchosX64, CompileTarget.watchosSimulatorArm64 -> "platform_version watchos-simulator"
5758
CompileTarget.tvosArm64 -> "platform_version tvos"
5859
CompileTarget.tvosX64, CompileTarget.tvosSimulatorArm64 -> "platform_version tvos-simulator"
@@ -65,6 +66,7 @@ internal fun CompileTarget.linkerMinOsVersionName() = when(this) {
6566
CompileTarget.iosSimulatorArm64 -> "ios_simulator_version_min"
6667
CompileTarget.watchosX64 -> "watchos_simulator_version_min"
6768
CompileTarget.watchosArm64 -> "watchos_version_min"
69+
CompileTarget.watchosDeviceArm64 -> "watchos_version_min"
6870
CompileTarget.watchosSimulatorArm64 -> "watchos_simulator_version_min"
6971
CompileTarget.tvosX64 -> "tvos_simulator_version_min"
7072
CompileTarget.tvosArm64 -> "tvos_version_min"

0 commit comments

Comments
 (0)