Skip to content

Commit

Permalink
Update K/N targets in accordance with official recommendations (#3640)
Browse files Browse the repository at this point in the history
More tier 3 targets added

Fixes #3601
Fixes #812
Fixes #855
  • Loading branch information
qwwdfsad authored Feb 27, 2023
1 parent 4ce3536 commit 2b865e2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ Kotlin/JS version of `kotlinx.coroutines` is published as

Kotlin/Native version of `kotlinx.coroutines` is published as
[`kotlinx-coroutines-core-$platform`](https://mvnrepository.com/search?q=kotlinx-coroutines-core-) where `$platform` is
the target Kotlin/Native platform. [List of currently supported targets](https://github.com/Kotlin/kotlinx.coroutines/blob/master/gradle/compile-native-multiplatform.gradle#L16).

the target Kotlin/Native platform.
Targets are provided in accordance with [official K/N target support](https://kotlinlang.org/docs/native-target-support.html).
## Building and Contributing

See [Contributing Guidelines](CONTRIBUTING.md).
Expand Down
36 changes: 25 additions & 11 deletions gradle/compile-native-multiplatform.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,36 @@ kotlin {
}

targets {
// According to https://kotlinlang.org/docs/native-target-support.html
// Tier 1
addTarget(presets.linuxX64)
addTarget(presets.iosArm64)
addTarget(presets.iosArm32)
addTarget(presets.iosX64)
addTarget(presets.macosX64)
addTarget(presets.mingwX64)
addTarget(presets.tvosArm64)
addTarget(presets.tvosX64)
addTarget(presets.watchosArm32)
addTarget(presets.watchosArm64)
addTarget(presets.watchosX86)
addTarget(presets.watchosX64)
addTarget(presets.macosArm64)
addTarget(presets.iosSimulatorArm64)
addTarget(presets.iosX64)

// Tier 2
addTarget(presets.linuxArm64)
addTarget(presets.watchosSimulatorArm64)
addTarget(presets.watchosX64)
addTarget(presets.watchosArm32)
addTarget(presets.watchosArm64)
addTarget(presets.tvosSimulatorArm64)
addTarget(presets.macosArm64)
addTarget(presets.tvosX64)
addTarget(presets.tvosArm64)
addTarget(presets.iosArm64)

// Tier 3
addTarget(presets.androidNativeArm32)
addTarget(presets.androidNativeArm64)
addTarget(presets.androidNativeX86)
addTarget(presets.androidNativeX64)
addTarget(presets.mingwX64)
addTarget(presets.watchosDeviceArm64)

// Deprecated, but were provided by coroutine; can be removed only when K/N drops the target
addTarget(presets.iosArm32)
addTarget(presets.watchosX86)
}

sourceSets {
Expand Down
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void defineSourceSet(newName, dependsOn, includedInPred) {

static boolean isNativeDarwin(String name) { return ["ios", "macos", "tvos", "watchos"].any { name.startsWith(it) } }

static boolean isNativeOther(String name) { return ["linux", "mingw"].any { name.startsWith(it) } }
static boolean isNativeOther(String name) { return ["linux", "mingw", "androidNative"].any { name.startsWith(it) } }

defineSourceSet("concurrent", ["common"]) { it in ["jvm", "native"] }

Expand Down

0 comments on commit 2b865e2

Please sign in to comment.