diff --git a/app-ios-shared/build.gradle.kts b/app-ios-shared/build.gradle.kts index 5c4115599..cc6bb6172 100644 --- a/app-ios-shared/build.gradle.kts +++ b/app-ios-shared/build.gradle.kts @@ -6,6 +6,7 @@ plugins { id("droidkaigi.primitive.kmp") id("droidkaigi.primitive.kmp.ios") id("droidkaigi.primitive.kover") + id("droidkaigi.primitive.kmp.native.coroutines") } kotlin { diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts index 3990d7375..b2b055038 100644 --- a/build-logic/build.gradle.kts +++ b/build-logic/build.gradle.kts @@ -74,6 +74,10 @@ gradlePlugin { id = "droidkaigi.primitive.kmp.compose" implementationClass = "io.github.droidkaigi.confsched2023.primitive.KmpComposePlugin" } + register("kotlinMppNativeCoroutines") { + id = "droidkaigi.primitive.kmp.native.coroutines" + implementationClass = "io.github.droidkaigi.confsched2023.primitive.KmpNativeCoroutinesPlugin" + } register("kotlinMppKtorfit") { id = "droidkaigi.primitive.kmp.ktorfit" implementationClass = "io.github.droidkaigi.confsched2023.primitive.KmpKtorfitPlugin" @@ -99,6 +103,7 @@ gradlePlugin { implementationClass = "io.github.droidkaigi.confsched2023.primitive.DetektPlugin" } + // Conventions register("androidFeature") { id = "droidkaigi.convention.androidfeature" diff --git a/build-logic/src/main/kotlin/io/github/droidkaigi/confsched2023/primitive/KmpNativeCoroutinesPlugin.kt b/build-logic/src/main/kotlin/io/github/droidkaigi/confsched2023/primitive/KmpNativeCoroutinesPlugin.kt new file mode 100644 index 000000000..ff9844409 --- /dev/null +++ b/build-logic/src/main/kotlin/io/github/droidkaigi/confsched2023/primitive/KmpNativeCoroutinesPlugin.kt @@ -0,0 +1,21 @@ +package io.github.droidkaigi.confsched2023.primitive + +import org.gradle.api.Plugin +import org.gradle.api.Project + +@Suppress("unused") +class KmpNativeCoroutinesPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + with(pluginManager) { + apply(libs.plugin("kspGradlePlugin").pluginId) + apply("com.rickclephas.kmp.nativecoroutines") + } + kotlin { + sourceSets.all { + languageSettings.optIn("kotlin.experimental.ExperimentalObjCName") + } + } + } + } +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index eea24e33c..52ea56301 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -60,6 +60,7 @@ daggerHiltAndroidCompiler = { module = "com.google.dagger:hilt-android-compiler" # for iOS koin = { module = "io.insert-koin:koin-core", version.ref = "koin" } +kmpNativeCoroutines = { module = "com.rickclephas.kmp:kmp-nativecoroutines-gradle-plugin", version = "1.0.0-ALPHA-17" } kotlinxCoroutinesCore = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinxCoroutines" } @@ -157,4 +158,5 @@ plugins = [ "kotlinxSerializationGradlePlugin", "completeKotlinPlugin", "detektGradlePlugin", + "kmpNativeCoroutines", ]