Skip to content

Update K/N targets in accordance with official recommendations #3640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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