Kotlin 1.6.10, K/N new memory model related changes use new Swift concurrency features
This commit is contained in:
parent
3bdaab7c11
commit
08a51bb92d
64 changed files with 1101 additions and 1065 deletions
|
@ -22,7 +22,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
composeOptions {
|
composeOptions {
|
||||||
kotlinCompilerExtensionVersion = Versions.compose
|
kotlinCompilerExtensionVersion = Versions.composeCompiler
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
@ -68,6 +68,7 @@ dependencies {
|
||||||
|
|
||||||
|
|
||||||
with(Deps.Compose) {
|
with(Deps.Compose) {
|
||||||
|
implementation(compiler)
|
||||||
implementation(ui)
|
implementation(ui)
|
||||||
implementation(uiGraphics)
|
implementation(uiGraphics)
|
||||||
implementation(foundationLayout)
|
implementation(foundationLayout)
|
||||||
|
|
|
@ -99,7 +99,7 @@ fun MainLayout() {
|
||||||
AnimatedNavHost(navController, startDestination = Screen.PersonList.title) {
|
AnimatedNavHost(navController, startDestination = Screen.PersonList.title) {
|
||||||
composable(
|
composable(
|
||||||
route = Screen.PersonList.title,
|
route = Screen.PersonList.title,
|
||||||
exitTransition = { _, _ ->
|
exitTransition = { _, target ->
|
||||||
slideOutHorizontally() +
|
slideOutHorizontally() +
|
||||||
fadeOut(animationSpec = tween(1000))
|
fadeOut(animationSpec = tween(1000))
|
||||||
},
|
},
|
||||||
|
|
|
@ -16,7 +16,7 @@ dependencies {
|
||||||
with(Deps.Ktor) {
|
with(Deps.Ktor) {
|
||||||
implementation(serverCore)
|
implementation(serverCore)
|
||||||
implementation(serverNetty)
|
implementation(serverNetty)
|
||||||
implementation(serialization)
|
//implementation(serialization)
|
||||||
implementation(websockets)
|
implementation(websockets)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ buildscript {
|
||||||
classpath(shadow)
|
classpath(shadow)
|
||||||
classpath(kotlinter)
|
classpath(kotlinter)
|
||||||
classpath(gradleVersionsPlugin)
|
classpath(gradleVersionsPlugin)
|
||||||
val kmpNativeCoroutinesVersion = if (kotlinVersion == "1.6.0") "0.9.0" else "0.8.0"
|
val kmpNativeCoroutinesVersion = if (kotlinVersion == "1.6.10") "0.10.0-new-mm" else "0.8.0"
|
||||||
classpath("com.rickclephas.kmp:kmp-nativecoroutines-gradle-plugin:$kmpNativeCoroutinesVersion")
|
classpath("com.rickclephas.kmp:kmp-nativecoroutines-gradle-plugin:$kmpNativeCoroutinesVersion")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,15 +3,16 @@ object Versions {
|
||||||
const val androidCompileSdk = 31
|
const val androidCompileSdk = 31
|
||||||
const val androidTargetSdk = androidCompileSdk
|
const val androidTargetSdk = androidCompileSdk
|
||||||
|
|
||||||
const val kotlinCoroutines = "1.5.2-native-mt"
|
const val kotlinCoroutines = "1.6.0-RC3"
|
||||||
const val koin = "3.1.4"
|
const val koin = "3.1.4"
|
||||||
const val ktor = "1.6.5"
|
const val ktor = "2.0.0-eap-278"
|
||||||
const val kotlinxSerialization = "1.3.0"
|
const val kotlinxSerialization = "1.3.1"
|
||||||
const val kotlinxHtmlJs = "0.7.3"
|
const val kotlinxHtmlJs = "0.7.3"
|
||||||
|
|
||||||
const val compose = "1.0.5"
|
const val compose = "1.1.0-rc01"
|
||||||
const val wearCompose = "1.0.0-alpha10"
|
const val composeCompiler = "1.1.0-rc02"
|
||||||
const val navCompose = "2.4.0-beta02"
|
const val wearCompose = "1.0.0-alpha13"
|
||||||
|
const val navCompose = "2.4.0-rc01"
|
||||||
const val accompanist = "0.21.0-beta"
|
const val accompanist = "0.21.0-beta"
|
||||||
|
|
||||||
const val junit = "4.12"
|
const val junit = "4.12"
|
||||||
|
@ -81,6 +82,7 @@ object Deps {
|
||||||
}
|
}
|
||||||
|
|
||||||
object Compose {
|
object Compose {
|
||||||
|
const val compiler = "androidx.compose.compiler:compiler:${Versions.composeCompiler}"
|
||||||
const val ui = "androidx.compose.ui:ui:${Versions.compose}"
|
const val ui = "androidx.compose.ui:ui:${Versions.compose}"
|
||||||
const val uiGraphics = "androidx.compose.ui:ui-graphics:${Versions.compose}"
|
const val uiGraphics = "androidx.compose.ui:ui-graphics:${Versions.compose}"
|
||||||
const val uiTooling = "androidx.compose.ui:ui-tooling:${Versions.compose}"
|
const val uiTooling = "androidx.compose.ui:ui-tooling:${Versions.compose}"
|
||||||
|
@ -107,7 +109,10 @@ object Deps {
|
||||||
object Ktor {
|
object Ktor {
|
||||||
const val serverCore = "io.ktor:ktor-server-core:${Versions.ktor}"
|
const val serverCore = "io.ktor:ktor-server-core:${Versions.ktor}"
|
||||||
const val serverNetty = "io.ktor:ktor-server-netty:${Versions.ktor}"
|
const val serverNetty = "io.ktor:ktor-server-netty:${Versions.ktor}"
|
||||||
const val serialization = "io.ktor:ktor-serialization:${Versions.ktor}"
|
//const val serialization = "io.ktor:ktor-serialization:${Versions.ktor}"
|
||||||
|
const val contentNegotiation = "io.ktor:ktor-client-content-negotiation:${Versions.ktor}"
|
||||||
|
const val json = "io.ktor:ktor-serialization-kotlinx-json:${Versions.ktor}"
|
||||||
|
|
||||||
const val websockets = "io.ktor:ktor-websockets:${Versions.ktor}"
|
const val websockets = "io.ktor:ktor-websockets:${Versions.ktor}"
|
||||||
const val clientCore = "io.ktor:ktor-client-core:${Versions.ktor}"
|
const val clientCore = "io.ktor:ktor-client-core:${Versions.ktor}"
|
||||||
const val clientJson = "io.ktor:ktor-client-json:${Versions.ktor}"
|
const val clientJson = "io.ktor:ktor-client-json:${Versions.ktor}"
|
||||||
|
|
|
@ -82,7 +82,8 @@ kotlin {
|
||||||
implementation(clientCore)
|
implementation(clientCore)
|
||||||
implementation(clientJson)
|
implementation(clientJson)
|
||||||
implementation(clientLogging)
|
implementation(clientLogging)
|
||||||
implementation(clientSerialization)
|
implementation(contentNegotiation)
|
||||||
|
implementation(json)
|
||||||
}
|
}
|
||||||
|
|
||||||
with(Deps.Kotlinx) {
|
with(Deps.Kotlinx) {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
Pod::Spec.new do |spec|
|
Pod::Spec.new do |spec|
|
||||||
spec.name = 'common'
|
spec.name = 'common'
|
||||||
spec.version = '1.0'
|
spec.version = '1.0'
|
||||||
spec.homepage = 'https://github.com/joreilly/PeopleInSpace'
|
spec.homepage = ''
|
||||||
spec.source = { :git => "Not Published", :tag => "Cocoapods/#{spec.name}/#{spec.version}" }
|
spec.source = { :git => "Not Published", :tag => "Cocoapods/#{spec.name}/#{spec.version}" }
|
||||||
spec.authors = ''
|
spec.authors = ''
|
||||||
spec.license = ''
|
spec.license = ''
|
||||||
spec.summary = 'PeopleInSpace'
|
spec.summary = ''
|
||||||
|
|
||||||
spec.vendored_frameworks = "build/cocoapods/framework/common.framework"
|
spec.vendored_frameworks = "build/cocoapods/framework/common.framework"
|
||||||
spec.libraries = "c++"
|
spec.libraries = "c++"
|
||||||
|
@ -33,13 +33,9 @@ Pod::Spec.new do |spec|
|
||||||
set -ev
|
set -ev
|
||||||
REPO_ROOT="$PODS_TARGET_SRCROOT"
|
REPO_ROOT="$PODS_TARGET_SRCROOT"
|
||||||
"$REPO_ROOT/../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \
|
"$REPO_ROOT/../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \
|
||||||
-PkotlinVersion="1.6.0" \
|
|
||||||
-Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \
|
-Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \
|
||||||
-Pkotlin.native.cocoapods.archs="$ARCHS" \
|
-Pkotlin.native.cocoapods.archs="$ARCHS" \
|
||||||
-Pkotlin.native.cocoapods.configuration=$CONFIGURATION \
|
-Pkotlin.native.cocoapods.configuration=$CONFIGURATION
|
||||||
-Pkotlin.native.cocoapods.cflags="$OTHER_CFLAGS" \
|
|
||||||
-Pkotlin.native.cocoapods.paths.headers="$HEADER_SEARCH_PATHS" \
|
|
||||||
-Pkotlin.native.cocoapods.paths.frameworks="$FRAMEWORK_SEARCH_PATHS"
|
|
||||||
SCRIPT
|
SCRIPT
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
package com.surrus.common.repository
|
package com.surrus.common.repository
|
||||||
|
|
||||||
import co.touchlab.kermit.Logger
|
|
||||||
import com.squareup.sqldelight.android.AndroidSqliteDriver
|
import com.squareup.sqldelight.android.AndroidSqliteDriver
|
||||||
import com.surrus.common.di.PeopleInSpaceDatabaseWrapper
|
import com.surrus.common.di.PeopleInSpaceDatabaseWrapper
|
||||||
import com.surrus.peopleinspace.db.PeopleInSpaceDatabase
|
import com.surrus.peopleinspace.db.PeopleInSpaceDatabase
|
||||||
|
import io.ktor.client.engine.android.*
|
||||||
import org.koin.dsl.module
|
import org.koin.dsl.module
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
actual fun platformModule() = module {
|
actual fun platformModule() = module {
|
||||||
single {
|
single {
|
||||||
val driver =
|
val driver =
|
||||||
|
@ -13,4 +15,5 @@ actual fun platformModule() = module {
|
||||||
|
|
||||||
PeopleInSpaceDatabaseWrapper(PeopleInSpaceDatabase(driver))
|
PeopleInSpaceDatabaseWrapper(PeopleInSpaceDatabase(driver))
|
||||||
}
|
}
|
||||||
|
single { Android.create() }
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,9 +5,10 @@ import com.surrus.common.repository.PeopleInSpaceRepository
|
||||||
import com.surrus.common.repository.PeopleInSpaceRepositoryInterface
|
import com.surrus.common.repository.PeopleInSpaceRepositoryInterface
|
||||||
import com.surrus.common.repository.platformModule
|
import com.surrus.common.repository.platformModule
|
||||||
import io.ktor.client.*
|
import io.ktor.client.*
|
||||||
import io.ktor.client.features.json.*
|
import io.ktor.client.engine.*
|
||||||
import io.ktor.client.features.json.serializer.*
|
import io.ktor.client.plugins.*
|
||||||
import io.ktor.client.features.logging.*
|
import io.ktor.client.plugins.logging.*
|
||||||
|
import io.ktor.serialization.kotlinx.json.*
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.SupervisorJob
|
import kotlinx.coroutines.SupervisorJob
|
||||||
|
@ -27,7 +28,7 @@ fun initKoin() = initKoin(enableNetworkLogs = false) {}
|
||||||
|
|
||||||
fun commonModule(enableNetworkLogs: Boolean) = module {
|
fun commonModule(enableNetworkLogs: Boolean) = module {
|
||||||
single { createJson() }
|
single { createJson() }
|
||||||
single { createHttpClient(get(), enableNetworkLogs = enableNetworkLogs) }
|
single { createHttpClient(get(), get(), enableNetworkLogs = enableNetworkLogs) }
|
||||||
|
|
||||||
single { CoroutineScope(Dispatchers.Default + SupervisorJob() ) }
|
single { CoroutineScope(Dispatchers.Default + SupervisorJob() ) }
|
||||||
|
|
||||||
|
@ -38,9 +39,10 @@ fun commonModule(enableNetworkLogs: Boolean) = module {
|
||||||
|
|
||||||
fun createJson() = Json { isLenient = true; ignoreUnknownKeys = true }
|
fun createJson() = Json { isLenient = true; ignoreUnknownKeys = true }
|
||||||
|
|
||||||
fun createHttpClient(json: Json, enableNetworkLogs: Boolean) = HttpClient {
|
|
||||||
install(JsonFeature) {
|
fun createHttpClient(httpClientEngine: HttpClientEngine, json: Json, enableNetworkLogs: Boolean) = HttpClient(httpClientEngine) {
|
||||||
serializer = KotlinxSerializer(json)
|
install(ContentNegotiation) {
|
||||||
|
json()
|
||||||
}
|
}
|
||||||
if (enableNetworkLogs) {
|
if (enableNetworkLogs) {
|
||||||
install(Logging) {
|
install(Logging) {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.surrus.common.remote
|
package com.surrus.common.remote
|
||||||
|
|
||||||
import io.ktor.client.*
|
import io.ktor.client.*
|
||||||
|
import io.ktor.client.call.*
|
||||||
import io.ktor.client.request.*
|
import io.ktor.client.request.*
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
|
@ -21,6 +22,6 @@ class PeopleInSpaceApi(
|
||||||
private val client: HttpClient,
|
private val client: HttpClient,
|
||||||
var baseUrl: String = "https://people-in-space-proxy.ew.r.appspot.com",
|
var baseUrl: String = "https://people-in-space-proxy.ew.r.appspot.com",
|
||||||
) : KoinComponent {
|
) : KoinComponent {
|
||||||
suspend fun fetchPeople() = client.get<AstroResult>("$baseUrl/astros.json")
|
suspend fun fetchPeople() = client.get("$baseUrl/astros.json").body<AstroResult>()
|
||||||
suspend fun fetchISSPosition() = client.get<IssResponse>("$baseUrl/iss-now.json")
|
suspend fun fetchISSPosition() = client.get("$baseUrl/iss-now.json").body<IssResponse>()
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,14 @@ package com.surrus.common.repository
|
||||||
import com.squareup.sqldelight.drivers.native.NativeSqliteDriver
|
import com.squareup.sqldelight.drivers.native.NativeSqliteDriver
|
||||||
import com.surrus.common.di.PeopleInSpaceDatabaseWrapper
|
import com.surrus.common.di.PeopleInSpaceDatabaseWrapper
|
||||||
import com.surrus.peopleinspace.db.PeopleInSpaceDatabase
|
import com.surrus.peopleinspace.db.PeopleInSpaceDatabase
|
||||||
|
import io.ktor.client.engine.ios.*
|
||||||
import org.koin.dsl.module
|
import org.koin.dsl.module
|
||||||
|
|
||||||
|
|
||||||
actual fun platformModule() = module {
|
actual fun platformModule() = module {
|
||||||
single {
|
single {
|
||||||
val driver = NativeSqliteDriver(PeopleInSpaceDatabase.Schema, "peopleinspace.db")
|
val driver = NativeSqliteDriver(PeopleInSpaceDatabase.Schema, "peopleinspace.db")
|
||||||
PeopleInSpaceDatabaseWrapper(PeopleInSpaceDatabase(driver))
|
PeopleInSpaceDatabaseWrapper(PeopleInSpaceDatabase(driver))
|
||||||
}
|
}
|
||||||
|
single { Ios.create() }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
package com.surrus.common.repository
|
package com.surrus.common.repository
|
||||||
|
|
||||||
import com.surrus.common.di.PeopleInSpaceDatabaseWrapper
|
import com.surrus.common.di.PeopleInSpaceDatabaseWrapper
|
||||||
|
import io.ktor.client.engine.js.*
|
||||||
import org.koin.dsl.module
|
import org.koin.dsl.module
|
||||||
|
|
||||||
actual fun platformModule() = module {
|
actual fun platformModule() = module {
|
||||||
single {
|
single {
|
||||||
PeopleInSpaceDatabaseWrapper(null)
|
PeopleInSpaceDatabaseWrapper(null)
|
||||||
}
|
}
|
||||||
|
single { Js.create() }
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.surrus.common.repository
|
||||||
import com.squareup.sqldelight.sqlite.driver.JdbcSqliteDriver
|
import com.squareup.sqldelight.sqlite.driver.JdbcSqliteDriver
|
||||||
import com.surrus.common.di.PeopleInSpaceDatabaseWrapper
|
import com.surrus.common.di.PeopleInSpaceDatabaseWrapper
|
||||||
import com.surrus.peopleinspace.db.PeopleInSpaceDatabase
|
import com.surrus.peopleinspace.db.PeopleInSpaceDatabase
|
||||||
|
import io.ktor.client.engine.java.*
|
||||||
import org.koin.dsl.module
|
import org.koin.dsl.module
|
||||||
|
|
||||||
actual fun platformModule() = module {
|
actual fun platformModule() = module {
|
||||||
|
@ -11,4 +12,5 @@ actual fun platformModule() = module {
|
||||||
.also { PeopleInSpaceDatabase.Schema.create(it) }
|
.also { PeopleInSpaceDatabase.Schema.create(it) }
|
||||||
PeopleInSpaceDatabaseWrapper(PeopleInSpaceDatabase(driver))
|
PeopleInSpaceDatabaseWrapper(PeopleInSpaceDatabase(driver))
|
||||||
}
|
}
|
||||||
|
single { Java.create() }
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.surrus.common.repository
|
||||||
import com.squareup.sqldelight.drivers.native.NativeSqliteDriver
|
import com.squareup.sqldelight.drivers.native.NativeSqliteDriver
|
||||||
import com.surrus.common.di.PeopleInSpaceDatabaseWrapper
|
import com.surrus.common.di.PeopleInSpaceDatabaseWrapper
|
||||||
import com.surrus.peopleinspace.db.PeopleInSpaceDatabase
|
import com.surrus.peopleinspace.db.PeopleInSpaceDatabase
|
||||||
|
import io.ktor.client.engine.ios.*
|
||||||
import org.koin.dsl.module
|
import org.koin.dsl.module
|
||||||
|
|
||||||
actual fun platformModule() = module {
|
actual fun platformModule() = module {
|
||||||
|
@ -10,4 +11,5 @@ actual fun platformModule() = module {
|
||||||
val driver = NativeSqliteDriver(PeopleInSpaceDatabase.Schema, "peopleinspace.db")
|
val driver = NativeSqliteDriver(PeopleInSpaceDatabase.Schema, "peopleinspace.db")
|
||||||
PeopleInSpaceDatabaseWrapper(PeopleInSpaceDatabase(driver))
|
PeopleInSpaceDatabaseWrapper(PeopleInSpaceDatabase(driver))
|
||||||
}
|
}
|
||||||
|
single { Ios.create() }
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.surrus.common.repository
|
||||||
import com.squareup.sqldelight.drivers.native.NativeSqliteDriver
|
import com.squareup.sqldelight.drivers.native.NativeSqliteDriver
|
||||||
import com.surrus.common.di.PeopleInSpaceDatabaseWrapper
|
import com.surrus.common.di.PeopleInSpaceDatabaseWrapper
|
||||||
import com.surrus.peopleinspace.db.PeopleInSpaceDatabase
|
import com.surrus.peopleinspace.db.PeopleInSpaceDatabase
|
||||||
|
import io.ktor.client.engine.ios.*
|
||||||
import org.koin.dsl.module
|
import org.koin.dsl.module
|
||||||
|
|
||||||
actual fun platformModule() = module {
|
actual fun platformModule() = module {
|
||||||
|
@ -10,4 +11,5 @@ actual fun platformModule() = module {
|
||||||
val driver = NativeSqliteDriver(PeopleInSpaceDatabase.Schema, "peopleinspace.db")
|
val driver = NativeSqliteDriver(PeopleInSpaceDatabase.Schema, "peopleinspace.db")
|
||||||
PeopleInSpaceDatabaseWrapper(PeopleInSpaceDatabase(driver))
|
PeopleInSpaceDatabaseWrapper(PeopleInSpaceDatabase(driver))
|
||||||
}
|
}
|
||||||
|
single { Ios.create() }
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm")
|
kotlin("jvm")
|
||||||
id("org.jetbrains.compose") version "1.0.0"
|
id("org.jetbrains.compose") version "1.0.1-rc2"
|
||||||
application
|
application
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform")
|
kotlin("multiplatform")
|
||||||
id("org.jetbrains.compose") version "1.0.0"
|
id("org.jetbrains.compose") version "1.0.1-rc2"
|
||||||
}
|
}
|
||||||
|
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
|
|
|
@ -24,7 +24,7 @@ kotlin.code.style=official
|
||||||
xcodeproj=./ios/PeopleInSpaceSwiftUI
|
xcodeproj=./ios/PeopleInSpaceSwiftUI
|
||||||
|
|
||||||
# Kotlin/Native clients can override this through updating common.podspec
|
# Kotlin/Native clients can override this through updating common.podspec
|
||||||
kotlinVersion=1.5.31
|
kotlinVersion=1.6.10
|
||||||
|
|
||||||
#kotlin.native.binary.memoryModel=experimental
|
kotlin.native.binary.memoryModel=experimental
|
||||||
#kotlin.native.binary.freezing=disabled
|
kotlin.native.binary.freezing=disabled
|
||||||
|
|
|
@ -7,12 +7,12 @@
|
||||||
<key>PeopleInSpaceSwiftUI.xcscheme_^#shared#^_</key>
|
<key>PeopleInSpaceSwiftUI.xcscheme_^#shared#^_</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>5</integer>
|
<integer>6</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>PeopleInSpaceWidgetExtension.xcscheme_^#shared#^_</key>
|
<key>PeopleInSpaceWidgetExtension.xcscheme_^#shared#^_</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>3</integer>
|
<integer>5</integer>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
|
|
|
@ -1,41 +1,48 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
import Combine
|
import Combine
|
||||||
import common
|
import common
|
||||||
import KMPNativeCoroutinesCombine
|
import KMPNativeCoroutinesAsync
|
||||||
|
|
||||||
|
|
||||||
|
@MainActor
|
||||||
class PeopleInSpaceViewModel: ObservableObject {
|
class PeopleInSpaceViewModel: ObservableObject {
|
||||||
@Published var people = [Assignment]()
|
@Published var people = [Assignment]()
|
||||||
@Published var issPosition = IssPosition(latitude: 0, longitude: 0)
|
@Published var issPosition = IssPosition(latitude: 0, longitude: 0)
|
||||||
|
|
||||||
private var positionCancellable: AnyCancellable?
|
private var fetchPeopleTask: Task<(), Never>? = nil
|
||||||
private var peopleCancellable: AnyCancellable?
|
private var pollISSPositionTask: Task<(), Never>? = nil
|
||||||
|
|
||||||
private let repository: PeopleInSpaceRepository
|
private let repository: PeopleInSpaceRepository
|
||||||
init(repository: PeopleInSpaceRepository) {
|
init(repository: PeopleInSpaceRepository) {
|
||||||
self.repository = repository
|
self.repository = repository
|
||||||
|
|
||||||
positionCancellable = createPublisher(for: repository.pollISSPositionNative())
|
pollISSPositionTask = Task {
|
||||||
.receive(on: DispatchQueue.main)
|
do {
|
||||||
.sink(receiveCompletion: { completion in
|
let stream = asyncStream(for: repository.pollISSPositionNative())
|
||||||
debugPrint(completion)
|
for try await data in stream {
|
||||||
}, receiveValue: { [weak self] value in
|
self.issPosition = data
|
||||||
self?.issPosition = value
|
}
|
||||||
})
|
} catch {
|
||||||
|
print("Failed with error: \(error)")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func startObservingPeopleUpdates() {
|
func startObservingPeopleUpdates() {
|
||||||
peopleCancellable = createPublisher(for: repository.fetchPeopleAsFlowNative())
|
fetchPeopleTask = Task {
|
||||||
.receive(on: DispatchQueue.main)
|
do {
|
||||||
.sink(receiveCompletion: { completion in
|
let stream = asyncStream(for: repository.fetchPeopleAsFlowNative())
|
||||||
debugPrint(completion)
|
for try await data in stream {
|
||||||
}, receiveValue: { [weak self] value in
|
self.people = data
|
||||||
self?.people = value
|
}
|
||||||
})
|
} catch {
|
||||||
|
print("Failed with error: \(error)")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func stopObservingPeopleUpdates() {
|
func stopObservingPeopleUpdates() {
|
||||||
peopleCancellable?.cancel()
|
fetchPeopleTask?.cancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ import WidgetKit
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import Combine
|
import Combine
|
||||||
import common
|
import common
|
||||||
import KMPNativeCoroutinesCombine
|
import KMPNativeCoroutinesAsync
|
||||||
|
|
||||||
final class Provider: TimelineProvider {
|
final class Provider: TimelineProvider {
|
||||||
|
|
||||||
|
@ -24,15 +24,15 @@ final class Provider: TimelineProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
func getTimeline(in context: Context, completion: @escaping (Timeline<Entry>) -> ()) {
|
func getTimeline(in context: Context, completion: @escaping (Timeline<Entry>) -> ()) {
|
||||||
timelineCancellable = createFuture(for: repository.fetchPeopleNative())
|
// timelineCancellable = createFuture(for: repository.fetchPeopleNative())
|
||||||
.map { data in
|
// .map { data in
|
||||||
let entry = PeopleInSpaceListEntry(date: Date(), peopleList: data)
|
// let entry = PeopleInSpaceListEntry(date: Date(), peopleList: data)
|
||||||
return Timeline(entries: [entry], policy: .atEnd)
|
// return Timeline(entries: [entry], policy: .atEnd)
|
||||||
}
|
// }
|
||||||
.receive(on: DispatchQueue.main)
|
// .receive(on: DispatchQueue.main)
|
||||||
.sink(receiveCompletion: { completion in
|
// .sink(receiveCompletion: { completion in
|
||||||
debugPrint(completion)
|
// debugPrint(completion)
|
||||||
}, receiveValue: completion)
|
// }, receiveValue: completion)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
|
|
||||||
target 'PeopleInSpaceSwiftUI' do
|
target 'PeopleInSpaceSwiftUI' do
|
||||||
pod 'common', :path => '../../common'
|
pod 'common', :path => '../../common'
|
||||||
pod 'KMPNativeCoroutinesCombine', '0.9.0'
|
pod 'KMPNativeCoroutinesAsync', '0.10.0'
|
||||||
end
|
end
|
||||||
|
|
||||||
target 'PeopleInSpaceWidgetExtension' do
|
target 'PeopleInSpaceWidgetExtension' do
|
||||||
pod 'common', :path => '../../common'
|
pod 'common', :path => '../../common'
|
||||||
pod 'KMPNativeCoroutinesCombine', '0.9.0'
|
pod 'KMPNativeCoroutinesAsync', '0.10.0'
|
||||||
end
|
end
|
|
@ -1,16 +1,16 @@
|
||||||
PODS:
|
PODS:
|
||||||
- common (1.0)
|
- common (1.0)
|
||||||
- KMPNativeCoroutinesCombine (0.9.0):
|
- KMPNativeCoroutinesAsync (0.10.0):
|
||||||
- KMPNativeCoroutinesCore (= 0.9.0)
|
- KMPNativeCoroutinesCore (= 0.10.0)
|
||||||
- KMPNativeCoroutinesCore (0.9.0)
|
- KMPNativeCoroutinesCore (0.10.0)
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- common (from `../../common`)
|
- common (from `../../common`)
|
||||||
- KMPNativeCoroutinesCombine (= 0.9.0)
|
- KMPNativeCoroutinesAsync (= 0.10.0)
|
||||||
|
|
||||||
SPEC REPOS:
|
SPEC REPOS:
|
||||||
trunk:
|
trunk:
|
||||||
- KMPNativeCoroutinesCombine
|
- KMPNativeCoroutinesAsync
|
||||||
- KMPNativeCoroutinesCore
|
- KMPNativeCoroutinesCore
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
|
@ -18,10 +18,10 @@ EXTERNAL SOURCES:
|
||||||
:path: "../../common"
|
:path: "../../common"
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
common: 7e8d176d3cfcbbb6a4901dbf0bd759685bf4dd86
|
common: 6bdd4aad82fe8e27657799269c3615cf5e9cd389
|
||||||
KMPNativeCoroutinesCombine: 3a3c39852cf9fcb764b97ac604bd1cfacdd720c7
|
KMPNativeCoroutinesAsync: 66512d0bf4933d0b160416795284beb8ecf089b8
|
||||||
KMPNativeCoroutinesCore: a9abca92a371f0c1af62bfb06c94c943ad515114
|
KMPNativeCoroutinesCore: 2e2573a75f27178d4cbd7be385f0f0a54416a47a
|
||||||
|
|
||||||
PODFILE CHECKSUM: e35181d90508d66984e05816593afec34fcc1d9a
|
PODFILE CHECKSUM: c82371f217f8782254550b881ac2b3b5acdbe1bb
|
||||||
|
|
||||||
COCOAPODS: 1.9.3
|
COCOAPODS: 1.11.2
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
../../../Target Support Files/KMPNativeCoroutinesAsync/KMPNativeCoroutinesAsync-umbrella.h
|
1
ios/PeopleInSpaceSwiftUI/Pods/Headers/Public/KMPNativeCoroutinesAsync/KMPNativeCoroutinesAsync.modulemap
generated
Symbolic link
1
ios/PeopleInSpaceSwiftUI/Pods/Headers/Public/KMPNativeCoroutinesAsync/KMPNativeCoroutinesAsync.modulemap
generated
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../../../Target Support Files/KMPNativeCoroutinesAsync/KMPNativeCoroutinesAsync.modulemap
|
|
@ -1 +0,0 @@
|
||||||
../../../Target Support Files/KMPNativeCoroutinesCombine/KMPNativeCoroutinesCombine-umbrella.h
|
|
|
@ -1 +0,0 @@
|
||||||
../../../Target Support Files/KMPNativeCoroutinesCombine/KMPNativeCoroutinesCombine.modulemap
|
|
69
ios/PeopleInSpaceSwiftUI/Pods/KMPNativeCoroutinesAsync/KMPNativeCoroutinesAsync/AsyncFunction.swift
generated
Normal file
69
ios/PeopleInSpaceSwiftUI/Pods/KMPNativeCoroutinesAsync/KMPNativeCoroutinesAsync/AsyncFunction.swift
generated
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
//
|
||||||
|
// AsyncFunction.swift
|
||||||
|
// KMPNativeCoroutinesAsync
|
||||||
|
//
|
||||||
|
// Created by Rick Clephas on 13/06/2021.
|
||||||
|
//
|
||||||
|
|
||||||
|
import KMPNativeCoroutinesCore
|
||||||
|
|
||||||
|
/// Wraps the `NativeSuspend` in an async function.
|
||||||
|
/// - Parameter nativeSuspend: The native suspend function to await.
|
||||||
|
/// - Returns: The result from the `nativeSuspend`.
|
||||||
|
/// - Throws: Errors thrown by the `nativeSuspend`.
|
||||||
|
public func asyncFunction<Result, Failure: Error, Unit>(for nativeSuspend: @escaping NativeSuspend<Result, Failure, Unit>) async throws -> Result {
|
||||||
|
let asyncFunctionActor = AsyncFunctionActor<Result, Unit>()
|
||||||
|
return try await withTaskCancellationHandler {
|
||||||
|
Task { await asyncFunctionActor.cancel() }
|
||||||
|
} operation: {
|
||||||
|
try await withUnsafeThrowingContinuation { continuation in
|
||||||
|
Task {
|
||||||
|
await asyncFunctionActor.setContinuation(continuation)
|
||||||
|
let nativeCancellable = nativeSuspend({ output, unit in
|
||||||
|
Task { await asyncFunctionActor.continueWith(result: output) }
|
||||||
|
return unit
|
||||||
|
}, { error, unit in
|
||||||
|
Task { await asyncFunctionActor.continueWith(error: error) }
|
||||||
|
return unit
|
||||||
|
})
|
||||||
|
await asyncFunctionActor.setNativeCancellable(nativeCancellable)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal actor AsyncFunctionActor<Result, Unit> {
|
||||||
|
|
||||||
|
private var isCancelled = false
|
||||||
|
private var nativeCancellable: NativeCancellable<Unit>? = nil
|
||||||
|
|
||||||
|
func setNativeCancellable(_ nativeCancellable: @escaping NativeCancellable<Unit>) {
|
||||||
|
guard !isCancelled else {
|
||||||
|
_ = nativeCancellable()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
self.nativeCancellable = nativeCancellable
|
||||||
|
}
|
||||||
|
|
||||||
|
func cancel() {
|
||||||
|
isCancelled = true
|
||||||
|
_ = nativeCancellable?()
|
||||||
|
nativeCancellable = nil
|
||||||
|
}
|
||||||
|
|
||||||
|
private var continuation: UnsafeContinuation<Result, Error>? = nil
|
||||||
|
|
||||||
|
func setContinuation(_ continuation: UnsafeContinuation<Result, Error>) {
|
||||||
|
self.continuation = continuation
|
||||||
|
}
|
||||||
|
|
||||||
|
func continueWith(result: Result) {
|
||||||
|
continuation?.resume(returning: result)
|
||||||
|
continuation = nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func continueWith(error: Error) {
|
||||||
|
continuation?.resume(throwing: error)
|
||||||
|
continuation = nil
|
||||||
|
}
|
||||||
|
}
|
19
ios/PeopleInSpaceSwiftUI/Pods/KMPNativeCoroutinesAsync/KMPNativeCoroutinesAsync/AsyncResult.swift
generated
Normal file
19
ios/PeopleInSpaceSwiftUI/Pods/KMPNativeCoroutinesAsync/KMPNativeCoroutinesAsync/AsyncResult.swift
generated
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
//
|
||||||
|
// AsyncResult.swift
|
||||||
|
// KMPNativeCoroutinesAsync
|
||||||
|
//
|
||||||
|
// Created by Rick Clephas on 28/06/2021.
|
||||||
|
//
|
||||||
|
|
||||||
|
import KMPNativeCoroutinesCore
|
||||||
|
|
||||||
|
/// Awaits the `NativeSuspend` and returns the result.
|
||||||
|
/// - Parameter nativeSuspend: The native suspend function to await.
|
||||||
|
/// - Returns: The `Result` from the `nativeSuspend`.
|
||||||
|
public func asyncResult<Output, Failure: Error, Unit>(for nativeSuspend: @escaping NativeSuspend<Output, Failure, Unit>) async -> Result<Output, Error> {
|
||||||
|
do {
|
||||||
|
return .success(try await asyncFunction(for: nativeSuspend))
|
||||||
|
} catch {
|
||||||
|
return .failure(error)
|
||||||
|
}
|
||||||
|
}
|
54
ios/PeopleInSpaceSwiftUI/Pods/KMPNativeCoroutinesAsync/KMPNativeCoroutinesAsync/AsyncStream.swift
generated
Normal file
54
ios/PeopleInSpaceSwiftUI/Pods/KMPNativeCoroutinesAsync/KMPNativeCoroutinesAsync/AsyncStream.swift
generated
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
//
|
||||||
|
// AsyncStream.swift
|
||||||
|
// AsyncStream
|
||||||
|
//
|
||||||
|
// Created by Rick Clephas on 15/07/2021.
|
||||||
|
//
|
||||||
|
|
||||||
|
import KMPNativeCoroutinesCore
|
||||||
|
|
||||||
|
/// Wraps the `NativeFlow` in an `AsyncThrowingStream`.
|
||||||
|
/// - Parameter nativeFlow: The native flow to collect.
|
||||||
|
/// - Returns: An stream that yields the collected values.
|
||||||
|
public func asyncStream<Output, Failure: Error, Unit>(for nativeFlow: @escaping NativeFlow<Output, Failure, Unit>) -> AsyncThrowingStream<Output, Error> {
|
||||||
|
let asyncStreamActor = AsyncStreamActor<Output, Unit>()
|
||||||
|
return AsyncThrowingStream { continuation in
|
||||||
|
continuation.onTermination = { @Sendable _ in
|
||||||
|
Task { await asyncStreamActor.cancel() }
|
||||||
|
}
|
||||||
|
Task {
|
||||||
|
let nativeCancellable = nativeFlow({ item, unit in
|
||||||
|
continuation.yield(item)
|
||||||
|
return unit
|
||||||
|
}, { error, unit in
|
||||||
|
if let error = error {
|
||||||
|
continuation.finish(throwing: error)
|
||||||
|
} else {
|
||||||
|
continuation.finish(throwing: nil)
|
||||||
|
}
|
||||||
|
return unit
|
||||||
|
})
|
||||||
|
await asyncStreamActor.setNativeCancellable(nativeCancellable)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal actor AsyncStreamActor<Output, Unit> {
|
||||||
|
|
||||||
|
private var isCancelled = false
|
||||||
|
private var nativeCancellable: NativeCancellable<Unit>? = nil
|
||||||
|
|
||||||
|
func setNativeCancellable(_ nativeCancellable: @escaping NativeCancellable<Unit>) {
|
||||||
|
guard !isCancelled else {
|
||||||
|
_ = nativeCancellable()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
self.nativeCancellable = nativeCancellable
|
||||||
|
}
|
||||||
|
|
||||||
|
func cancel() {
|
||||||
|
isCancelled = true
|
||||||
|
_ = nativeCancellable?()
|
||||||
|
nativeCancellable = nil
|
||||||
|
}
|
||||||
|
}
|
|
@ -11,37 +11,37 @@ Kotlin suspend functions are exposed to Swift as functions with a completion han
|
||||||
This allows you to easily use them from your Swift code, but it doesn't support cancellation.
|
This allows you to easily use them from your Swift code, but it doesn't support cancellation.
|
||||||
|
|
||||||
> While Swift 5.5 brings async functions to Swift, it doesn't solve this issue.
|
> While Swift 5.5 brings async functions to Swift, it doesn't solve this issue.
|
||||||
> For interoperability with ObjC all function with a completion handler can be called like an async function.
|
> For interoperability with ObjC all functions with a completion handler can be called like an async function.
|
||||||
> This means starting with Swift 5.5 your Kotlin suspend functions will look like Swift async functions.
|
> This means starting with Swift 5.5 your Kotlin suspend functions will look like Swift async functions.
|
||||||
> But that's just syntactic sugar, so there's still no cancellation support.
|
> But that's just syntactic sugar, so there's still no cancellation support.
|
||||||
|
|
||||||
Besides cancellation support, ObjC doesn't support generics on protocols.
|
Besides cancellation support, ObjC doesn't support generics on protocols.
|
||||||
So all the `Flow` interfaces lose their generic value type which make them hard to use.
|
So all the `Flow` interfaces lose their generic value type which make them hard to use.
|
||||||
|
|
||||||
This library solves both of these limitations :smile: .
|
This library solves both of these limitations 😄.
|
||||||
|
|
||||||
## Compatibility
|
## Compatibility
|
||||||
|
|
||||||
As of version `0.9.0` the library uses Kotlin version `1.6.0`.
|
As of version `0.10.0` the library uses Kotlin version `1.6.10`.
|
||||||
Compatibility versions for older and early access Kotlin versions are also available:
|
Compatibility versions for older and early access Kotlin versions are also available:
|
||||||
|
|
||||||
|Version|Version suffix|Kotlin|Coroutines|
|
| Version | Version suffix | Kotlin | Coroutines |
|
||||||
|---|---|:---:|:---:|
|
|--------------|-----------------|:----------:|:-------------------:|
|
||||||
|_latest_|-new-mm|1.6.0|1.5.1-new-mm-dev2|
|
| _latest_ | -new-mm | 1.6.10 | 1.6.0-RC3 |
|
||||||
|**_latest_**|**_no suffix_**|**1.6.0**|**1.5.2-native-mt**|
|
| **_latest_** | **_no suffix_** | **1.6.10** | **1.5.2-native-mt** |
|
||||||
|0.8.0|_no suffix_|1.5.30|1.5.2-native-mt|
|
| _latest_ | -kotlin-1.6.0 | 1.6.0 | 1.5.2-native-mt |
|
||||||
|0.8.0|-kotlin-1.5.20|1.5.20|1.5.0-native-mt|
|
| 0.9.0 | -new-mm-3 | 1.6.0 | 1.6.0-RC2 |
|
||||||
|
| 0.8.0 | _no suffix_ | 1.5.30 | 1.5.2-native-mt |
|
||||||
|
| 0.8.0 | -kotlin-1.5.20 | 1.5.20 | 1.5.0-native-mt |
|
||||||
|
|
||||||
You can choose from a couple of Swift implementations.
|
You can choose from a couple of Swift implementations.
|
||||||
Depending on the implementation you can support as low as iOS 9, macOS 10.9, tvOS 9 and watchOS 3:
|
Depending on the implementation you can support as low as iOS 9, macOS 10.9, tvOS 9 and watchOS 3:
|
||||||
|
|
||||||
|Implementation|Swift|iOS|macOS|tvOS|watchOS|
|
| Implementation | Swift | iOS | macOS | tvOS | watchOS |
|
||||||
|---|:---:|:---:|:---:|:---:|:---:|
|
|----------------|:-----:|:----:|:-----:|:----:|:-------:|
|
||||||
|RxSwift|5.0|9.0|10.9|9.0|3.0|
|
| Async | 5.5 | 13.0 | 10.15 | 13.0 | 6.0 |
|
||||||
|Combine|5.0|13.0|10.15|13.0|6.0|
|
| Combine | 5.0 | 13.0 | 10.15 | 13.0 | 6.0 |
|
||||||
|Async :construction:|5.5|13.0|10.15|13.0|6.0|
|
| RxSwift | 5.0 | 9.0 | 10.9 | 9.0 | 3.0 |
|
||||||
|
|
||||||
> :construction: : the Async implementation requires Xcode 13.2 which is currently in beta!
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
@ -62,23 +62,9 @@ plugins {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Swift (CocoaPods)
|
|
||||||
|
|
||||||
Now for Swift you can choose from a couple of implementations.
|
|
||||||
Add one or more of the following libraries to your `Podfile`:
|
|
||||||
```ruby
|
|
||||||
pod 'KMPNativeCoroutinesCombine' # Combine implementation
|
|
||||||
pod 'KMPNativeCoroutinesRxSwift' # RxSwift implementation
|
|
||||||
pod 'KMPNativeCoroutinesAsync' # Swift 5.5 Async/Await implementation
|
|
||||||
```
|
|
||||||
|
|
||||||
### Swift (Swift Package Manager)
|
### Swift (Swift Package Manager)
|
||||||
|
|
||||||
All Swift implementations are also available via the Swift Package Manager.
|
All Swift implementations are also available via the Swift Package Manager.
|
||||||
|
|
||||||
> **NOTE:** `KMPNativeCoroutinesAsync` requires Xcode 13.2 which is currently in beta.
|
|
||||||
> To add the async implementation you should add the `-swift-async-await` suffix to the version.
|
|
||||||
|
|
||||||
Just add it to your `Package.swift` file:
|
Just add it to your `Package.swift` file:
|
||||||
```swift
|
```swift
|
||||||
dependencies: [
|
dependencies: [
|
||||||
|
@ -89,6 +75,16 @@ dependencies: [
|
||||||
Or add it in Xcode by going to `File` > `Add Packages...` and providing the URL:
|
Or add it in Xcode by going to `File` > `Add Packages...` and providing the URL:
|
||||||
`https://github.com/rickclephas/KMP-NativeCoroutines.git`.
|
`https://github.com/rickclephas/KMP-NativeCoroutines.git`.
|
||||||
|
|
||||||
|
### Swift (CocoaPods)
|
||||||
|
|
||||||
|
Now for Swift you can choose from a couple of implementations.
|
||||||
|
Add one or more of the following libraries to your `Podfile`:
|
||||||
|
```ruby
|
||||||
|
pod 'KMPNativeCoroutinesAsync' # Swift 5.5 Async/Await implementation
|
||||||
|
pod 'KMPNativeCoroutinesCombine' # Combine implementation
|
||||||
|
pod 'KMPNativeCoroutinesRxSwift' # RxSwift implementation
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Using your Kotlin Coroutines code from Swift is almost as easy as calling the Kotlin code.
|
Using your Kotlin Coroutines code from Swift is almost as easy as calling the Kotlin code.
|
||||||
|
@ -96,7 +92,7 @@ Just use the wrapper functions in Swift to get Observables, Publishers, AsyncStr
|
||||||
|
|
||||||
### Kotlin
|
### Kotlin
|
||||||
|
|
||||||
The plugin will automagically generate the necessary code for you! :crystal_ball:
|
The plugin will automagically generate the necessary code for you! 🔮
|
||||||
|
|
||||||
Your `Flow` properties/functions get a `Native` version:
|
Your `Flow` properties/functions get a `Native` version:
|
||||||
```kotlin
|
```kotlin
|
||||||
|
@ -123,7 +119,6 @@ val timeNativeReplayCache
|
||||||
|
|
||||||
The plugin also generates `Native` versions for all your suspend functions:
|
The plugin also generates `Native` versions for all your suspend functions:
|
||||||
```kotlin
|
```kotlin
|
||||||
|
|
||||||
class RandomLettersGenerator {
|
class RandomLettersGenerator {
|
||||||
// Somewhere in your Kotlin code you define a suspend function
|
// Somewhere in your Kotlin code you define a suspend function
|
||||||
suspend fun getRandomLetters(): String {
|
suspend fun getRandomLetters(): String {
|
||||||
|
@ -178,6 +173,94 @@ val ignoredFlowProperty: Flow<Int>
|
||||||
suspend fun ignoredSuspendFunction() { }
|
suspend fun ignoredSuspendFunction() { }
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Swift 5.5 Async/Await
|
||||||
|
|
||||||
|
The Async implementation provides some functions to get async Swift functions and `AsyncStream`s.
|
||||||
|
|
||||||
|
Use the `asyncFunction(for:)` function to get an async function that can be awaited:
|
||||||
|
```swift
|
||||||
|
let handle = Task {
|
||||||
|
do {
|
||||||
|
let letters = try await asyncFunction(for: randomLettersGenerator.getRandomLettersNative())
|
||||||
|
print("Got random letters: \(letters)")
|
||||||
|
} catch {
|
||||||
|
print("Failed with error: \(error)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// To cancel the suspend function just cancel the async task
|
||||||
|
handle.cancel()
|
||||||
|
```
|
||||||
|
|
||||||
|
or if you don't like these do-catches you can use the `asyncResult(for:)` function:
|
||||||
|
```swift
|
||||||
|
let result = await asyncResult(for: randomLettersGenerator.getRandomLettersNative())
|
||||||
|
if case let .success(letters) = result {
|
||||||
|
print("Got random letters: \(letters)")
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
For `Flow`s there is the `asyncStream(for:)` function to get an `AsyncStream`:
|
||||||
|
```swift
|
||||||
|
let handle = Task {
|
||||||
|
do {
|
||||||
|
let stream = asyncStream(for: randomLettersGenerator.getRandomLettersFlowNative())
|
||||||
|
for try await letters in stream {
|
||||||
|
print("Got random letters: \(letters)")
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
print("Failed with error: \(error)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// To cancel the flow (collection) just cancel the async task
|
||||||
|
handle.cancel()
|
||||||
|
```
|
||||||
|
|
||||||
|
### Combine
|
||||||
|
|
||||||
|
The Combine implementation provides a couple functions to get an `AnyPublisher` for your Coroutines code.
|
||||||
|
|
||||||
|
For your `Flow`s use the `createPublisher(for:)` function:
|
||||||
|
```swift
|
||||||
|
// Create an AnyPublisher for your flow
|
||||||
|
let publisher = createPublisher(for: clock.timeNative)
|
||||||
|
|
||||||
|
// Now use this publisher as you would any other
|
||||||
|
let cancellable = publisher.sink { completion in
|
||||||
|
print("Received completion: \(completion)")
|
||||||
|
} receiveValue: { value in
|
||||||
|
print("Received value: \(value)")
|
||||||
|
}
|
||||||
|
|
||||||
|
// To cancel the flow (collection) just cancel the publisher
|
||||||
|
cancellable.cancel()
|
||||||
|
```
|
||||||
|
|
||||||
|
For the suspend functions you should use the `createFuture(for:)` function:
|
||||||
|
```swift
|
||||||
|
// Create a Future/AnyPublisher for the suspend function
|
||||||
|
let future = createFuture(for: randomLettersGenerator.getRandomLettersNative())
|
||||||
|
|
||||||
|
// Now use this future as you would any other
|
||||||
|
let cancellable = future.sink { completion in
|
||||||
|
print("Received completion: \(completion)")
|
||||||
|
} receiveValue: { value in
|
||||||
|
print("Received value: \(value)")
|
||||||
|
}
|
||||||
|
|
||||||
|
// To cancel the suspend function just cancel the future
|
||||||
|
cancellable.cancel()
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also use the `createPublisher(for:)` function for suspend functions that return a `Flow`:
|
||||||
|
```swift
|
||||||
|
let publisher = createPublisher(for: randomLettersGenerator.getRandomLettersFlowNative())
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note:** these functions create deferred `AnyPublisher`s.
|
||||||
|
Meaning every subscription will trigger the collection of the `Flow` or execution of the suspend function.
|
||||||
|
|
||||||
### RxSwift
|
### RxSwift
|
||||||
|
|
||||||
The RxSwift implementation provides a couple functions to get an `Observable` or `Single` for your Coroutines code.
|
The RxSwift implementation provides a couple functions to get an `Observable` or `Single` for your Coroutines code.
|
||||||
|
@ -227,93 +310,3 @@ let observable = createObservable(for: randomLettersGenerator.getRandomLettersFl
|
||||||
|
|
||||||
**Note:** these functions create deferred `Observable`s and `Single`s.
|
**Note:** these functions create deferred `Observable`s and `Single`s.
|
||||||
Meaning every subscription will trigger the collection of the `Flow` or execution of the suspend function.
|
Meaning every subscription will trigger the collection of the `Flow` or execution of the suspend function.
|
||||||
|
|
||||||
### Combine
|
|
||||||
|
|
||||||
The Combine implementation provides a couple functions to get an `AnyPublisher` for your Coroutines code.
|
|
||||||
|
|
||||||
For your `Flow`s use the `createPublisher(for:)` function:
|
|
||||||
```swift
|
|
||||||
// Create an AnyPublisher for your flow
|
|
||||||
let publisher = createPublisher(for: clock.timeNative)
|
|
||||||
|
|
||||||
// Now use this publisher as you would any other
|
|
||||||
let cancellable = publisher.sink { completion in
|
|
||||||
print("Received completion: \(completion)")
|
|
||||||
} receiveValue: { value in
|
|
||||||
print("Received value: \(value)")
|
|
||||||
}
|
|
||||||
|
|
||||||
// To cancel the flow (collection) just cancel the publisher
|
|
||||||
cancellable.cancel()
|
|
||||||
```
|
|
||||||
|
|
||||||
For the suspend functions you should use the `createFuture(for:)` function:
|
|
||||||
```swift
|
|
||||||
// Create a Future/AnyPublisher for the suspend function
|
|
||||||
let future = createFuture(for: randomLettersGenerator.getRandomLettersNative())
|
|
||||||
|
|
||||||
// Now use this future as you would any other
|
|
||||||
let cancellable = future.sink { completion in
|
|
||||||
print("Received completion: \(completion)")
|
|
||||||
} receiveValue: { value in
|
|
||||||
print("Received value: \(value)")
|
|
||||||
}
|
|
||||||
|
|
||||||
// To cancel the suspend function just cancel the future
|
|
||||||
cancellable.cancel()
|
|
||||||
```
|
|
||||||
|
|
||||||
You can also use the `createPublisher(for:)` function for suspend functions that return a `Flow`:
|
|
||||||
```swift
|
|
||||||
let publisher = createPublisher(for: randomLettersGenerator.getRandomLettersFlowNative())
|
|
||||||
```
|
|
||||||
|
|
||||||
**Note:** these functions create deferred `AnyPublisher`s.
|
|
||||||
Meaning every subscription will trigger the collection of the `Flow` or execution of the suspend function.
|
|
||||||
|
|
||||||
### Swift 5.5 Async/Await
|
|
||||||
|
|
||||||
> :construction: : the Async implementation requires Xcode 13.2 which is currently in beta!
|
|
||||||
|
|
||||||
The Async implementation provides some functions to get async Swift functions and `AsyncStream`s.
|
|
||||||
|
|
||||||
Use the `asyncFunction(for:)` function to get an async function that can be awaited:
|
|
||||||
```swift
|
|
||||||
let handle = Task {
|
|
||||||
do {
|
|
||||||
let letters = try await asyncFunction(for: randomLettersGenerator.getRandomLettersNative())
|
|
||||||
print("Got random letters: \(letters)")
|
|
||||||
} catch {
|
|
||||||
print("Failed with error: \(error)")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// To cancel the suspend function just cancel the async task
|
|
||||||
handle.cancel()
|
|
||||||
```
|
|
||||||
|
|
||||||
or if you don't like these do-catches you can use the `asyncResult(for:)` function:
|
|
||||||
```swift
|
|
||||||
let result = await asyncResult(for: randomLettersGenerator.getRandomLettersNative())
|
|
||||||
if case let .success(letters) = result {
|
|
||||||
print("Got random letters: \(letters)")
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
For `Flow`s there is the `asyncStream(for:)` function to get an `AsyncStream`:
|
|
||||||
```swift
|
|
||||||
let handle = Task {
|
|
||||||
do {
|
|
||||||
let stream = asyncStream(for: randomLettersGenerator.getRandomLettersFlowNative())
|
|
||||||
for try await letters in stream {
|
|
||||||
print("Got random letters: \(letters)")
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
print("Failed with error: \(error)")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// To cancel the flow (collection) just cancel the async task
|
|
||||||
handle.cancel()
|
|
||||||
```
|
|
|
@ -1,60 +0,0 @@
|
||||||
//
|
|
||||||
// Future.swift
|
|
||||||
// KMPNativeCoroutinesCombine
|
|
||||||
//
|
|
||||||
// Created by Rick Clephas on 06/06/2021.
|
|
||||||
//
|
|
||||||
|
|
||||||
import Combine
|
|
||||||
import KMPNativeCoroutinesCore
|
|
||||||
|
|
||||||
/// Creates an `AnyPublisher` for the provided `NativeSuspend`.
|
|
||||||
/// - Parameter nativeSuspend: The native suspend function to await.
|
|
||||||
/// - Returns: A publisher that either finishes with a single value or fails with an error.
|
|
||||||
public func createFuture<Result, Failure: Error, Unit>(
|
|
||||||
for nativeSuspend: @escaping NativeSuspend<Result, Failure, Unit>
|
|
||||||
) -> AnyPublisher<Result, Failure> {
|
|
||||||
return NativeSuspendFuture(nativeSuspend: nativeSuspend)
|
|
||||||
.eraseToAnyPublisher()
|
|
||||||
}
|
|
||||||
|
|
||||||
internal struct NativeSuspendFuture<Result, Failure: Error, Unit>: Publisher {
|
|
||||||
|
|
||||||
typealias Output = Result
|
|
||||||
typealias Failure = Failure
|
|
||||||
|
|
||||||
let nativeSuspend: NativeSuspend<Result, Failure, Unit>
|
|
||||||
|
|
||||||
func receive<S>(subscriber: S) where S : Subscriber, Failure == S.Failure, Result == S.Input {
|
|
||||||
let subscription = NativeSuspendSubscription(nativeSuspend: nativeSuspend, subscriber: subscriber)
|
|
||||||
subscriber.receive(subscription: subscription)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal class NativeSuspendSubscription<Result, Failure, Unit, S: Subscriber>: Subscription where S.Input == Result, S.Failure == Failure {
|
|
||||||
|
|
||||||
private var nativeCancellable: NativeCancellable<Unit>? = nil
|
|
||||||
private var subscriber: S?
|
|
||||||
|
|
||||||
init(nativeSuspend: NativeSuspend<Result, Failure, Unit>, subscriber: S) {
|
|
||||||
self.subscriber = subscriber
|
|
||||||
nativeCancellable = nativeSuspend({ output, unit in
|
|
||||||
if let subscriber = self.subscriber {
|
|
||||||
_ = subscriber.receive(output)
|
|
||||||
subscriber.receive(completion: .finished)
|
|
||||||
}
|
|
||||||
return unit
|
|
||||||
}, { error, unit in
|
|
||||||
self.subscriber?.receive(completion: .failure(error))
|
|
||||||
return unit
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func request(_ demand: Subscribers.Demand) { }
|
|
||||||
|
|
||||||
func cancel() {
|
|
||||||
subscriber = nil
|
|
||||||
_ = nativeCancellable?()
|
|
||||||
nativeCancellable = nil
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
//
|
|
||||||
// FuturePublisher.swift
|
|
||||||
// KMPNativeCoroutinesCombine
|
|
||||||
//
|
|
||||||
// Created by Rick Clephas on 28/06/2021.
|
|
||||||
//
|
|
||||||
|
|
||||||
import Combine
|
|
||||||
import KMPNativeCoroutinesCore
|
|
||||||
|
|
||||||
/// Creates an `AnyPublisher` for the provided `NativeSuspend` that returns a `NativeFlow`.
|
|
||||||
/// - Parameter nativeSuspend: The native suspend function to await.
|
|
||||||
/// - Returns: A publisher that publishes the collected values.
|
|
||||||
public func createPublisher<Output, Failure: Error, Unit>(
|
|
||||||
for nativeSuspend: @escaping NativeSuspend<NativeFlow<Output, Failure, Unit>, Failure, Unit>
|
|
||||||
) -> AnyPublisher<Output, Failure> {
|
|
||||||
return createFuture(for: nativeSuspend)
|
|
||||||
.flatMap { createPublisher(for: $0) }
|
|
||||||
.eraseToAnyPublisher()
|
|
||||||
}
|
|
|
@ -1,61 +0,0 @@
|
||||||
//
|
|
||||||
// Publisher.swift
|
|
||||||
// KMPNativeCoroutinesCombine
|
|
||||||
//
|
|
||||||
// Created by Rick Clephas on 06/06/2021.
|
|
||||||
//
|
|
||||||
|
|
||||||
import Combine
|
|
||||||
import KMPNativeCoroutinesCore
|
|
||||||
|
|
||||||
/// Creates an `AnyPublisher` for the provided `NativeFlow`.
|
|
||||||
/// - Parameter nativeFlow: The native flow to collect.
|
|
||||||
/// - Returns: A publisher that publishes the collected values.
|
|
||||||
public func createPublisher<Output, Failure: Error, Unit>(
|
|
||||||
for nativeFlow: @escaping NativeFlow<Output, Failure, Unit>
|
|
||||||
) -> AnyPublisher<Output, Failure> {
|
|
||||||
return NativeFlowPublisher(nativeFlow: nativeFlow)
|
|
||||||
.eraseToAnyPublisher()
|
|
||||||
}
|
|
||||||
|
|
||||||
internal struct NativeFlowPublisher<Output, Failure: Error, Unit>: Publisher {
|
|
||||||
|
|
||||||
typealias Output = Output
|
|
||||||
typealias Failure = Failure
|
|
||||||
|
|
||||||
let nativeFlow: NativeFlow<Output, Failure, Unit>
|
|
||||||
|
|
||||||
func receive<S>(subscriber: S) where S : Subscriber, Failure == S.Failure, Output == S.Input {
|
|
||||||
let subscription = NativeFlowSubscription(nativeFlow: nativeFlow, subscriber: subscriber)
|
|
||||||
subscriber.receive(subscription: subscription)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal class NativeFlowSubscription<Output, Failure, Unit, S: Subscriber>: Subscription where S.Input == Output, S.Failure == Failure {
|
|
||||||
|
|
||||||
private var nativeCancellable: NativeCancellable<Unit>? = nil
|
|
||||||
private var subscriber: S?
|
|
||||||
|
|
||||||
init(nativeFlow: NativeFlow<Output, Failure, Unit>, subscriber: S) {
|
|
||||||
self.subscriber = subscriber
|
|
||||||
nativeCancellable = nativeFlow({ item, unit in
|
|
||||||
_ = self.subscriber?.receive(item)
|
|
||||||
return unit
|
|
||||||
}, { error, unit in
|
|
||||||
if let error = error {
|
|
||||||
self.subscriber?.receive(completion: .failure(error))
|
|
||||||
} else {
|
|
||||||
self.subscriber?.receive(completion: .finished)
|
|
||||||
}
|
|
||||||
return unit
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func request(_ demand: Subscribers.Demand) { }
|
|
||||||
|
|
||||||
func cancel() {
|
|
||||||
subscriber = nil
|
|
||||||
_ = nativeCancellable?()
|
|
||||||
nativeCancellable = nil
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -11,37 +11,37 @@ Kotlin suspend functions are exposed to Swift as functions with a completion han
|
||||||
This allows you to easily use them from your Swift code, but it doesn't support cancellation.
|
This allows you to easily use them from your Swift code, but it doesn't support cancellation.
|
||||||
|
|
||||||
> While Swift 5.5 brings async functions to Swift, it doesn't solve this issue.
|
> While Swift 5.5 brings async functions to Swift, it doesn't solve this issue.
|
||||||
> For interoperability with ObjC all function with a completion handler can be called like an async function.
|
> For interoperability with ObjC all functions with a completion handler can be called like an async function.
|
||||||
> This means starting with Swift 5.5 your Kotlin suspend functions will look like Swift async functions.
|
> This means starting with Swift 5.5 your Kotlin suspend functions will look like Swift async functions.
|
||||||
> But that's just syntactic sugar, so there's still no cancellation support.
|
> But that's just syntactic sugar, so there's still no cancellation support.
|
||||||
|
|
||||||
Besides cancellation support, ObjC doesn't support generics on protocols.
|
Besides cancellation support, ObjC doesn't support generics on protocols.
|
||||||
So all the `Flow` interfaces lose their generic value type which make them hard to use.
|
So all the `Flow` interfaces lose their generic value type which make them hard to use.
|
||||||
|
|
||||||
This library solves both of these limitations :smile: .
|
This library solves both of these limitations 😄.
|
||||||
|
|
||||||
## Compatibility
|
## Compatibility
|
||||||
|
|
||||||
As of version `0.9.0` the library uses Kotlin version `1.6.0`.
|
As of version `0.10.0` the library uses Kotlin version `1.6.10`.
|
||||||
Compatibility versions for older and early access Kotlin versions are also available:
|
Compatibility versions for older and early access Kotlin versions are also available:
|
||||||
|
|
||||||
|Version|Version suffix|Kotlin|Coroutines|
|
| Version | Version suffix | Kotlin | Coroutines |
|
||||||
|---|---|:---:|:---:|
|
|--------------|-----------------|:----------:|:-------------------:|
|
||||||
|_latest_|-new-mm|1.6.0|1.5.1-new-mm-dev2|
|
| _latest_ | -new-mm | 1.6.10 | 1.6.0-RC3 |
|
||||||
|**_latest_**|**_no suffix_**|**1.6.0**|**1.5.2-native-mt**|
|
| **_latest_** | **_no suffix_** | **1.6.10** | **1.5.2-native-mt** |
|
||||||
|0.8.0|_no suffix_|1.5.30|1.5.2-native-mt|
|
| _latest_ | -kotlin-1.6.0 | 1.6.0 | 1.5.2-native-mt |
|
||||||
|0.8.0|-kotlin-1.5.20|1.5.20|1.5.0-native-mt|
|
| 0.9.0 | -new-mm-3 | 1.6.0 | 1.6.0-RC2 |
|
||||||
|
| 0.8.0 | _no suffix_ | 1.5.30 | 1.5.2-native-mt |
|
||||||
|
| 0.8.0 | -kotlin-1.5.20 | 1.5.20 | 1.5.0-native-mt |
|
||||||
|
|
||||||
You can choose from a couple of Swift implementations.
|
You can choose from a couple of Swift implementations.
|
||||||
Depending on the implementation you can support as low as iOS 9, macOS 10.9, tvOS 9 and watchOS 3:
|
Depending on the implementation you can support as low as iOS 9, macOS 10.9, tvOS 9 and watchOS 3:
|
||||||
|
|
||||||
|Implementation|Swift|iOS|macOS|tvOS|watchOS|
|
| Implementation | Swift | iOS | macOS | tvOS | watchOS |
|
||||||
|---|:---:|:---:|:---:|:---:|:---:|
|
|----------------|:-----:|:----:|:-----:|:----:|:-------:|
|
||||||
|RxSwift|5.0|9.0|10.9|9.0|3.0|
|
| Async | 5.5 | 13.0 | 10.15 | 13.0 | 6.0 |
|
||||||
|Combine|5.0|13.0|10.15|13.0|6.0|
|
| Combine | 5.0 | 13.0 | 10.15 | 13.0 | 6.0 |
|
||||||
|Async :construction:|5.5|13.0|10.15|13.0|6.0|
|
| RxSwift | 5.0 | 9.0 | 10.9 | 9.0 | 3.0 |
|
||||||
|
|
||||||
> :construction: : the Async implementation requires Xcode 13.2 which is currently in beta!
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
@ -62,23 +62,9 @@ plugins {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Swift (CocoaPods)
|
|
||||||
|
|
||||||
Now for Swift you can choose from a couple of implementations.
|
|
||||||
Add one or more of the following libraries to your `Podfile`:
|
|
||||||
```ruby
|
|
||||||
pod 'KMPNativeCoroutinesCombine' # Combine implementation
|
|
||||||
pod 'KMPNativeCoroutinesRxSwift' # RxSwift implementation
|
|
||||||
pod 'KMPNativeCoroutinesAsync' # Swift 5.5 Async/Await implementation
|
|
||||||
```
|
|
||||||
|
|
||||||
### Swift (Swift Package Manager)
|
### Swift (Swift Package Manager)
|
||||||
|
|
||||||
All Swift implementations are also available via the Swift Package Manager.
|
All Swift implementations are also available via the Swift Package Manager.
|
||||||
|
|
||||||
> **NOTE:** `KMPNativeCoroutinesAsync` requires Xcode 13.2 which is currently in beta.
|
|
||||||
> To add the async implementation you should add the `-swift-async-await` suffix to the version.
|
|
||||||
|
|
||||||
Just add it to your `Package.swift` file:
|
Just add it to your `Package.swift` file:
|
||||||
```swift
|
```swift
|
||||||
dependencies: [
|
dependencies: [
|
||||||
|
@ -89,6 +75,16 @@ dependencies: [
|
||||||
Or add it in Xcode by going to `File` > `Add Packages...` and providing the URL:
|
Or add it in Xcode by going to `File` > `Add Packages...` and providing the URL:
|
||||||
`https://github.com/rickclephas/KMP-NativeCoroutines.git`.
|
`https://github.com/rickclephas/KMP-NativeCoroutines.git`.
|
||||||
|
|
||||||
|
### Swift (CocoaPods)
|
||||||
|
|
||||||
|
Now for Swift you can choose from a couple of implementations.
|
||||||
|
Add one or more of the following libraries to your `Podfile`:
|
||||||
|
```ruby
|
||||||
|
pod 'KMPNativeCoroutinesAsync' # Swift 5.5 Async/Await implementation
|
||||||
|
pod 'KMPNativeCoroutinesCombine' # Combine implementation
|
||||||
|
pod 'KMPNativeCoroutinesRxSwift' # RxSwift implementation
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Using your Kotlin Coroutines code from Swift is almost as easy as calling the Kotlin code.
|
Using your Kotlin Coroutines code from Swift is almost as easy as calling the Kotlin code.
|
||||||
|
@ -96,7 +92,7 @@ Just use the wrapper functions in Swift to get Observables, Publishers, AsyncStr
|
||||||
|
|
||||||
### Kotlin
|
### Kotlin
|
||||||
|
|
||||||
The plugin will automagically generate the necessary code for you! :crystal_ball:
|
The plugin will automagically generate the necessary code for you! 🔮
|
||||||
|
|
||||||
Your `Flow` properties/functions get a `Native` version:
|
Your `Flow` properties/functions get a `Native` version:
|
||||||
```kotlin
|
```kotlin
|
||||||
|
@ -123,7 +119,6 @@ val timeNativeReplayCache
|
||||||
|
|
||||||
The plugin also generates `Native` versions for all your suspend functions:
|
The plugin also generates `Native` versions for all your suspend functions:
|
||||||
```kotlin
|
```kotlin
|
||||||
|
|
||||||
class RandomLettersGenerator {
|
class RandomLettersGenerator {
|
||||||
// Somewhere in your Kotlin code you define a suspend function
|
// Somewhere in your Kotlin code you define a suspend function
|
||||||
suspend fun getRandomLetters(): String {
|
suspend fun getRandomLetters(): String {
|
||||||
|
@ -178,6 +173,94 @@ val ignoredFlowProperty: Flow<Int>
|
||||||
suspend fun ignoredSuspendFunction() { }
|
suspend fun ignoredSuspendFunction() { }
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Swift 5.5 Async/Await
|
||||||
|
|
||||||
|
The Async implementation provides some functions to get async Swift functions and `AsyncStream`s.
|
||||||
|
|
||||||
|
Use the `asyncFunction(for:)` function to get an async function that can be awaited:
|
||||||
|
```swift
|
||||||
|
let handle = Task {
|
||||||
|
do {
|
||||||
|
let letters = try await asyncFunction(for: randomLettersGenerator.getRandomLettersNative())
|
||||||
|
print("Got random letters: \(letters)")
|
||||||
|
} catch {
|
||||||
|
print("Failed with error: \(error)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// To cancel the suspend function just cancel the async task
|
||||||
|
handle.cancel()
|
||||||
|
```
|
||||||
|
|
||||||
|
or if you don't like these do-catches you can use the `asyncResult(for:)` function:
|
||||||
|
```swift
|
||||||
|
let result = await asyncResult(for: randomLettersGenerator.getRandomLettersNative())
|
||||||
|
if case let .success(letters) = result {
|
||||||
|
print("Got random letters: \(letters)")
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
For `Flow`s there is the `asyncStream(for:)` function to get an `AsyncStream`:
|
||||||
|
```swift
|
||||||
|
let handle = Task {
|
||||||
|
do {
|
||||||
|
let stream = asyncStream(for: randomLettersGenerator.getRandomLettersFlowNative())
|
||||||
|
for try await letters in stream {
|
||||||
|
print("Got random letters: \(letters)")
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
print("Failed with error: \(error)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// To cancel the flow (collection) just cancel the async task
|
||||||
|
handle.cancel()
|
||||||
|
```
|
||||||
|
|
||||||
|
### Combine
|
||||||
|
|
||||||
|
The Combine implementation provides a couple functions to get an `AnyPublisher` for your Coroutines code.
|
||||||
|
|
||||||
|
For your `Flow`s use the `createPublisher(for:)` function:
|
||||||
|
```swift
|
||||||
|
// Create an AnyPublisher for your flow
|
||||||
|
let publisher = createPublisher(for: clock.timeNative)
|
||||||
|
|
||||||
|
// Now use this publisher as you would any other
|
||||||
|
let cancellable = publisher.sink { completion in
|
||||||
|
print("Received completion: \(completion)")
|
||||||
|
} receiveValue: { value in
|
||||||
|
print("Received value: \(value)")
|
||||||
|
}
|
||||||
|
|
||||||
|
// To cancel the flow (collection) just cancel the publisher
|
||||||
|
cancellable.cancel()
|
||||||
|
```
|
||||||
|
|
||||||
|
For the suspend functions you should use the `createFuture(for:)` function:
|
||||||
|
```swift
|
||||||
|
// Create a Future/AnyPublisher for the suspend function
|
||||||
|
let future = createFuture(for: randomLettersGenerator.getRandomLettersNative())
|
||||||
|
|
||||||
|
// Now use this future as you would any other
|
||||||
|
let cancellable = future.sink { completion in
|
||||||
|
print("Received completion: \(completion)")
|
||||||
|
} receiveValue: { value in
|
||||||
|
print("Received value: \(value)")
|
||||||
|
}
|
||||||
|
|
||||||
|
// To cancel the suspend function just cancel the future
|
||||||
|
cancellable.cancel()
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also use the `createPublisher(for:)` function for suspend functions that return a `Flow`:
|
||||||
|
```swift
|
||||||
|
let publisher = createPublisher(for: randomLettersGenerator.getRandomLettersFlowNative())
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note:** these functions create deferred `AnyPublisher`s.
|
||||||
|
Meaning every subscription will trigger the collection of the `Flow` or execution of the suspend function.
|
||||||
|
|
||||||
### RxSwift
|
### RxSwift
|
||||||
|
|
||||||
The RxSwift implementation provides a couple functions to get an `Observable` or `Single` for your Coroutines code.
|
The RxSwift implementation provides a couple functions to get an `Observable` or `Single` for your Coroutines code.
|
||||||
|
@ -227,93 +310,3 @@ let observable = createObservable(for: randomLettersGenerator.getRandomLettersFl
|
||||||
|
|
||||||
**Note:** these functions create deferred `Observable`s and `Single`s.
|
**Note:** these functions create deferred `Observable`s and `Single`s.
|
||||||
Meaning every subscription will trigger the collection of the `Flow` or execution of the suspend function.
|
Meaning every subscription will trigger the collection of the `Flow` or execution of the suspend function.
|
||||||
|
|
||||||
### Combine
|
|
||||||
|
|
||||||
The Combine implementation provides a couple functions to get an `AnyPublisher` for your Coroutines code.
|
|
||||||
|
|
||||||
For your `Flow`s use the `createPublisher(for:)` function:
|
|
||||||
```swift
|
|
||||||
// Create an AnyPublisher for your flow
|
|
||||||
let publisher = createPublisher(for: clock.timeNative)
|
|
||||||
|
|
||||||
// Now use this publisher as you would any other
|
|
||||||
let cancellable = publisher.sink { completion in
|
|
||||||
print("Received completion: \(completion)")
|
|
||||||
} receiveValue: { value in
|
|
||||||
print("Received value: \(value)")
|
|
||||||
}
|
|
||||||
|
|
||||||
// To cancel the flow (collection) just cancel the publisher
|
|
||||||
cancellable.cancel()
|
|
||||||
```
|
|
||||||
|
|
||||||
For the suspend functions you should use the `createFuture(for:)` function:
|
|
||||||
```swift
|
|
||||||
// Create a Future/AnyPublisher for the suspend function
|
|
||||||
let future = createFuture(for: randomLettersGenerator.getRandomLettersNative())
|
|
||||||
|
|
||||||
// Now use this future as you would any other
|
|
||||||
let cancellable = future.sink { completion in
|
|
||||||
print("Received completion: \(completion)")
|
|
||||||
} receiveValue: { value in
|
|
||||||
print("Received value: \(value)")
|
|
||||||
}
|
|
||||||
|
|
||||||
// To cancel the suspend function just cancel the future
|
|
||||||
cancellable.cancel()
|
|
||||||
```
|
|
||||||
|
|
||||||
You can also use the `createPublisher(for:)` function for suspend functions that return a `Flow`:
|
|
||||||
```swift
|
|
||||||
let publisher = createPublisher(for: randomLettersGenerator.getRandomLettersFlowNative())
|
|
||||||
```
|
|
||||||
|
|
||||||
**Note:** these functions create deferred `AnyPublisher`s.
|
|
||||||
Meaning every subscription will trigger the collection of the `Flow` or execution of the suspend function.
|
|
||||||
|
|
||||||
### Swift 5.5 Async/Await
|
|
||||||
|
|
||||||
> :construction: : the Async implementation requires Xcode 13.2 which is currently in beta!
|
|
||||||
|
|
||||||
The Async implementation provides some functions to get async Swift functions and `AsyncStream`s.
|
|
||||||
|
|
||||||
Use the `asyncFunction(for:)` function to get an async function that can be awaited:
|
|
||||||
```swift
|
|
||||||
let handle = Task {
|
|
||||||
do {
|
|
||||||
let letters = try await asyncFunction(for: randomLettersGenerator.getRandomLettersNative())
|
|
||||||
print("Got random letters: \(letters)")
|
|
||||||
} catch {
|
|
||||||
print("Failed with error: \(error)")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// To cancel the suspend function just cancel the async task
|
|
||||||
handle.cancel()
|
|
||||||
```
|
|
||||||
|
|
||||||
or if you don't like these do-catches you can use the `asyncResult(for:)` function:
|
|
||||||
```swift
|
|
||||||
let result = await asyncResult(for: randomLettersGenerator.getRandomLettersNative())
|
|
||||||
if case let .success(letters) = result {
|
|
||||||
print("Got random letters: \(letters)")
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
For `Flow`s there is the `asyncStream(for:)` function to get an `AsyncStream`:
|
|
||||||
```swift
|
|
||||||
let handle = Task {
|
|
||||||
do {
|
|
||||||
let stream = asyncStream(for: randomLettersGenerator.getRandomLettersFlowNative())
|
|
||||||
for try await letters in stream {
|
|
||||||
print("Got random letters: \(letters)")
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
print("Failed with error: \(error)")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// To cancel the flow (collection) just cancel the async task
|
|
||||||
handle.cancel()
|
|
||||||
```
|
|
|
@ -21,7 +21,7 @@
|
||||||
"name": "Build common",
|
"name": "Build common",
|
||||||
"execution_position": "before_compile",
|
"execution_position": "before_compile",
|
||||||
"shell_path": "/bin/sh",
|
"shell_path": "/bin/sh",
|
||||||
"script": " if [ \"YES\" = \"$COCOAPODS_SKIP_KOTLIN_BUILD\" ]; then\n echo \"Skipping Gradle build task invocation due to COCOAPODS_SKIP_KOTLIN_BUILD environment variable set to \"YES\"\"\n exit 0\n fi\n set -ev\n REPO_ROOT=\"$PODS_TARGET_SRCROOT\"\n \"$REPO_ROOT/../gradlew\" -p \"$REPO_ROOT\" $KOTLIN_PROJECT_PATH:syncFramework -PkotlinVersion=\"1.6.0\" -Pkotlin.native.cocoapods.platform=$PLATFORM_NAME -Pkotlin.native.cocoapods.archs=\"$ARCHS\" -Pkotlin.native.cocoapods.configuration=$CONFIGURATION -Pkotlin.native.cocoapods.cflags=\"$OTHER_CFLAGS\" -Pkotlin.native.cocoapods.paths.headers=\"$HEADER_SEARCH_PATHS\" -Pkotlin.native.cocoapods.paths.frameworks=\"$FRAMEWORK_SEARCH_PATHS\"\n"
|
"script": " if [ \"YES\" = \"$COCOAPODS_SKIP_KOTLIN_BUILD\" ]; then\n echo \"Skipping Gradle build task invocation due to COCOAPODS_SKIP_KOTLIN_BUILD environment variable set to \"YES\"\"\n exit 0\n fi\n set -ev\n REPO_ROOT=\"$PODS_TARGET_SRCROOT\"\n \"$REPO_ROOT/../gradlew\" -p \"$REPO_ROOT\" $KOTLIN_PROJECT_PATH:syncFramework -PkotlinVersion=\"1.6.10\" -Pkotlin.native.cocoapods.platform=$PLATFORM_NAME -Pkotlin.native.cocoapods.archs=\"$ARCHS\" -Pkotlin.native.cocoapods.configuration=$CONFIGURATION -Pkotlin.native.cocoapods.cflags=\"$OTHER_CFLAGS\" -Pkotlin.native.cocoapods.paths.headers=\"$HEADER_SEARCH_PATHS\" -Pkotlin.native.cocoapods.paths.frameworks=\"$FRAMEWORK_SEARCH_PATHS\"\n"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"platforms": {
|
"platforms": {
|
||||||
|
|
20
ios/PeopleInSpaceSwiftUI/Pods/Manifest.lock
generated
20
ios/PeopleInSpaceSwiftUI/Pods/Manifest.lock
generated
|
@ -1,16 +1,16 @@
|
||||||
PODS:
|
PODS:
|
||||||
- common (1.0)
|
- common (1.0)
|
||||||
- KMPNativeCoroutinesCombine (0.9.0):
|
- KMPNativeCoroutinesAsync (0.10.0):
|
||||||
- KMPNativeCoroutinesCore (= 0.9.0)
|
- KMPNativeCoroutinesCore (= 0.10.0)
|
||||||
- KMPNativeCoroutinesCore (0.9.0)
|
- KMPNativeCoroutinesCore (0.10.0)
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- common (from `../../common`)
|
- common (from `../../common`)
|
||||||
- KMPNativeCoroutinesCombine (= 0.9.0)
|
- KMPNativeCoroutinesAsync (= 0.10.0)
|
||||||
|
|
||||||
SPEC REPOS:
|
SPEC REPOS:
|
||||||
trunk:
|
trunk:
|
||||||
- KMPNativeCoroutinesCombine
|
- KMPNativeCoroutinesAsync
|
||||||
- KMPNativeCoroutinesCore
|
- KMPNativeCoroutinesCore
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
|
@ -18,10 +18,10 @@ EXTERNAL SOURCES:
|
||||||
:path: "../../common"
|
:path: "../../common"
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
common: 7e8d176d3cfcbbb6a4901dbf0bd759685bf4dd86
|
common: 6bdd4aad82fe8e27657799269c3615cf5e9cd389
|
||||||
KMPNativeCoroutinesCombine: 3a3c39852cf9fcb764b97ac604bd1cfacdd720c7
|
KMPNativeCoroutinesAsync: 66512d0bf4933d0b160416795284beb8ecf089b8
|
||||||
KMPNativeCoroutinesCore: a9abca92a371f0c1af62bfb06c94c943ad515114
|
KMPNativeCoroutinesCore: 2e2573a75f27178d4cbd7be385f0f0a54416a47a
|
||||||
|
|
||||||
PODFILE CHECKSUM: e35181d90508d66984e05816593afec34fcc1d9a
|
PODFILE CHECKSUM: c82371f217f8782254550b881ac2b3b5acdbe1bb
|
||||||
|
|
||||||
COCOAPODS: 1.9.3
|
COCOAPODS: 1.11.2
|
||||||
|
|
1054
ios/PeopleInSpaceSwiftUI/Pods/Pods.xcodeproj/project.pbxproj
generated
1054
ios/PeopleInSpaceSwiftUI/Pods/Pods.xcodeproj/project.pbxproj
generated
File diff suppressed because it is too large
Load diff
|
@ -4,18 +4,13 @@
|
||||||
<dict>
|
<dict>
|
||||||
<key>SchemeUserState</key>
|
<key>SchemeUserState</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>KMPNativeCoroutinesCombine.xcscheme</key>
|
<key>KMPNativeCoroutinesAsync.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>1</integer>
|
<integer>1</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>KMPNativeCoroutinesCombine.xcscheme_^#shared#^_</key>
|
|
||||||
<dict>
|
|
||||||
<key>orderHint</key>
|
|
||||||
<integer>2</integer>
|
|
||||||
</dict>
|
|
||||||
<key>KMPNativeCoroutinesCore.xcscheme</key>
|
<key>KMPNativeCoroutinesCore.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
|
@ -23,17 +18,12 @@
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>2</integer>
|
<integer>2</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>KMPNativeCoroutinesCore.xcscheme_^#shared#^_</key>
|
|
||||||
<dict>
|
|
||||||
<key>orderHint</key>
|
|
||||||
<integer>4</integer>
|
|
||||||
</dict>
|
|
||||||
<key>Pods-PeopleInSpaceSwiftUI.xcscheme</key>
|
<key>Pods-PeopleInSpaceSwiftUI.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>1</integer>
|
<integer>3</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>Pods-PeopleInSpaceWidgetExtension.xcscheme</key>
|
<key>Pods-PeopleInSpaceWidgetExtension.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
|
@ -42,11 +32,6 @@
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>4</integer>
|
<integer>4</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>Pods-PeopleInSpaceWidgetExtension.xcscheme_^#shared#^_</key>
|
|
||||||
<dict>
|
|
||||||
<key>orderHint</key>
|
|
||||||
<integer>6</integer>
|
|
||||||
</dict>
|
|
||||||
<key>common.xcscheme</key>
|
<key>common.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
@interface PodsDummy_KMPNativeCoroutinesAsync : NSObject
|
||||||
|
@end
|
||||||
|
@implementation PodsDummy_KMPNativeCoroutinesAsync
|
||||||
|
@end
|
|
@ -11,6 +11,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT double KMPNativeCoroutinesCombineVersionNumber;
|
FOUNDATION_EXPORT double KMPNativeCoroutinesAsyncVersionNumber;
|
||||||
FOUNDATION_EXPORT const unsigned char KMPNativeCoroutinesCombineVersionString[];
|
FOUNDATION_EXPORT const unsigned char KMPNativeCoroutinesAsyncVersionString[];
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
APPLICATION_EXTENSION_API_ONLY = YES
|
APPLICATION_EXTENSION_API_ONLY = YES
|
||||||
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCombine
|
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
|
||||||
|
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesAsync
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||||
OTHER_CFLAGS = $(inherited) -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap"
|
OTHER_CFLAGS = $(inherited) -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap"
|
||||||
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap" -import-underlying-module -Xcc -fmodule-map-file="${SRCROOT}/${MODULEMAP_FILE}"
|
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap" -import-underlying-module -Xcc -fmodule-map-file="${SRCROOT}/${MODULEMAP_FILE}"
|
||||||
PODS_BUILD_DIR = ${BUILD_DIR}
|
PODS_BUILD_DIR = ${BUILD_DIR}
|
||||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||||
PODS_ROOT = ${SRCROOT}
|
PODS_ROOT = ${SRCROOT}
|
||||||
PODS_TARGET_SRCROOT = ${PODS_ROOT}/KMPNativeCoroutinesCombine
|
PODS_TARGET_SRCROOT = ${PODS_ROOT}/KMPNativeCoroutinesAsync
|
||||||
|
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
||||||
SKIP_INSTALL = YES
|
SKIP_INSTALL = YES
|
||||||
SWIFT_INCLUDE_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore"
|
SWIFT_INCLUDE_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore"
|
|
@ -0,0 +1,6 @@
|
||||||
|
module KMPNativeCoroutinesAsync {
|
||||||
|
umbrella header "KMPNativeCoroutinesAsync-umbrella.h"
|
||||||
|
|
||||||
|
export *
|
||||||
|
module * { export * }
|
||||||
|
}
|
|
@ -1,12 +1,14 @@
|
||||||
APPLICATION_EXTENSION_API_ONLY = YES
|
APPLICATION_EXTENSION_API_ONLY = YES
|
||||||
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCombine
|
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
|
||||||
|
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesAsync
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||||
OTHER_CFLAGS = $(inherited) -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap"
|
OTHER_CFLAGS = $(inherited) -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap"
|
||||||
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap" -import-underlying-module -Xcc -fmodule-map-file="${SRCROOT}/${MODULEMAP_FILE}"
|
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap" -import-underlying-module -Xcc -fmodule-map-file="${SRCROOT}/${MODULEMAP_FILE}"
|
||||||
PODS_BUILD_DIR = ${BUILD_DIR}
|
PODS_BUILD_DIR = ${BUILD_DIR}
|
||||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||||
PODS_ROOT = ${SRCROOT}
|
PODS_ROOT = ${SRCROOT}
|
||||||
PODS_TARGET_SRCROOT = ${PODS_ROOT}/KMPNativeCoroutinesCombine
|
PODS_TARGET_SRCROOT = ${PODS_ROOT}/KMPNativeCoroutinesAsync
|
||||||
|
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
||||||
SKIP_INSTALL = YES
|
SKIP_INSTALL = YES
|
||||||
SWIFT_INCLUDE_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore"
|
SWIFT_INCLUDE_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore"
|
|
@ -1,5 +0,0 @@
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
@interface PodsDummy_KMPNativeCoroutinesCombine : NSObject
|
|
||||||
@end
|
|
||||||
@implementation PodsDummy_KMPNativeCoroutinesCombine
|
|
||||||
@end
|
|
|
@ -1,6 +0,0 @@
|
||||||
module KMPNativeCoroutinesCombine {
|
|
||||||
umbrella header "KMPNativeCoroutinesCombine-umbrella.h"
|
|
||||||
|
|
||||||
export *
|
|
||||||
module * { export * }
|
|
||||||
}
|
|
|
@ -1,4 +1,5 @@
|
||||||
APPLICATION_EXTENSION_API_ONLY = YES
|
APPLICATION_EXTENSION_API_ONLY = YES
|
||||||
|
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
|
||||||
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore
|
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||||
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -import-underlying-module -Xcc -fmodule-map-file="${SRCROOT}/${MODULEMAP_FILE}"
|
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -import-underlying-module -Xcc -fmodule-map-file="${SRCROOT}/${MODULEMAP_FILE}"
|
||||||
|
@ -6,6 +7,7 @@ PODS_BUILD_DIR = ${BUILD_DIR}
|
||||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||||
PODS_ROOT = ${SRCROOT}
|
PODS_ROOT = ${SRCROOT}
|
||||||
PODS_TARGET_SRCROOT = ${PODS_ROOT}/KMPNativeCoroutinesCore
|
PODS_TARGET_SRCROOT = ${PODS_ROOT}/KMPNativeCoroutinesCore
|
||||||
|
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
||||||
SKIP_INSTALL = YES
|
SKIP_INSTALL = YES
|
||||||
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
|
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
APPLICATION_EXTENSION_API_ONLY = YES
|
APPLICATION_EXTENSION_API_ONLY = YES
|
||||||
|
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
|
||||||
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore
|
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||||
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -import-underlying-module -Xcc -fmodule-map-file="${SRCROOT}/${MODULEMAP_FILE}"
|
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -import-underlying-module -Xcc -fmodule-map-file="${SRCROOT}/${MODULEMAP_FILE}"
|
||||||
|
@ -6,6 +7,7 @@ PODS_BUILD_DIR = ${BUILD_DIR}
|
||||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||||
PODS_ROOT = ${SRCROOT}
|
PODS_ROOT = ${SRCROOT}
|
||||||
PODS_TARGET_SRCROOT = ${PODS_ROOT}/KMPNativeCoroutinesCore
|
PODS_TARGET_SRCROOT = ${PODS_ROOT}/KMPNativeCoroutinesCore
|
||||||
|
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
||||||
SKIP_INSTALL = YES
|
SKIP_INSTALL = YES
|
||||||
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
|
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Acknowledgements
|
# Acknowledgements
|
||||||
This application makes use of the following third party libraries:
|
This application makes use of the following third party libraries:
|
||||||
|
|
||||||
## KMPNativeCoroutinesCombine
|
## KMPNativeCoroutinesAsync
|
||||||
|
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ SOFTWARE.
|
||||||
<key>License</key>
|
<key>License</key>
|
||||||
<string>MIT</string>
|
<string>MIT</string>
|
||||||
<key>Title</key>
|
<key>Title</key>
|
||||||
<string>KMPNativeCoroutinesCombine</string>
|
<string>KMPNativeCoroutinesAsync</string>
|
||||||
<key>Type</key>
|
<key>Type</key>
|
||||||
<string>PSGroupSpecifier</string>
|
<string>PSGroupSpecifier</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
|
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
|
||||||
|
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
|
||||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../../common/build/cocoapods/framework"
|
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../../common/build/cocoapods/framework"
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||||
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCombine" "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore"
|
LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesAsync" "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore" /usr/lib/swift
|
||||||
OTHER_CFLAGS = $(inherited) -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCombine/KMPNativeCoroutinesCombine.modulemap" -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap"
|
OTHER_CFLAGS = $(inherited) -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesAsync/KMPNativeCoroutinesAsync.modulemap" -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap"
|
||||||
OTHER_LDFLAGS = $(inherited) -ObjC -l"KMPNativeCoroutinesCombine" -l"KMPNativeCoroutinesCore" -l"c++" -framework "Combine" -framework "common"
|
OTHER_LDFLAGS = $(inherited) -ObjC -l"KMPNativeCoroutinesAsync" -l"KMPNativeCoroutinesCore" -l"c++" -framework "common"
|
||||||
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCombine/KMPNativeCoroutinesCombine.modulemap" -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap"
|
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesAsync/KMPNativeCoroutinesAsync.modulemap" -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap"
|
||||||
PODS_BUILD_DIR = ${BUILD_DIR}
|
PODS_BUILD_DIR = ${BUILD_DIR}
|
||||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||||
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
|
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
|
||||||
PODS_ROOT = ${SRCROOT}/Pods
|
PODS_ROOT = ${SRCROOT}/Pods
|
||||||
SWIFT_INCLUDE_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCombine" "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore"
|
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
|
||||||
|
SWIFT_INCLUDE_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesAsync" "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore"
|
||||||
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
|
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
|
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
|
||||||
|
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
|
||||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../../common/build/cocoapods/framework"
|
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../../common/build/cocoapods/framework"
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||||
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCombine" "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore"
|
LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesAsync" "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore" /usr/lib/swift
|
||||||
OTHER_CFLAGS = $(inherited) -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCombine/KMPNativeCoroutinesCombine.modulemap" -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap"
|
OTHER_CFLAGS = $(inherited) -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesAsync/KMPNativeCoroutinesAsync.modulemap" -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap"
|
||||||
OTHER_LDFLAGS = $(inherited) -ObjC -l"KMPNativeCoroutinesCombine" -l"KMPNativeCoroutinesCore" -l"c++" -framework "Combine" -framework "common"
|
OTHER_LDFLAGS = $(inherited) -ObjC -l"KMPNativeCoroutinesAsync" -l"KMPNativeCoroutinesCore" -l"c++" -framework "common"
|
||||||
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCombine/KMPNativeCoroutinesCombine.modulemap" -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap"
|
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesAsync/KMPNativeCoroutinesAsync.modulemap" -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap"
|
||||||
PODS_BUILD_DIR = ${BUILD_DIR}
|
PODS_BUILD_DIR = ${BUILD_DIR}
|
||||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||||
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
|
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
|
||||||
PODS_ROOT = ${SRCROOT}/Pods
|
PODS_ROOT = ${SRCROOT}/Pods
|
||||||
SWIFT_INCLUDE_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCombine" "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore"
|
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
|
||||||
|
SWIFT_INCLUDE_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesAsync" "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore"
|
||||||
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
|
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Acknowledgements
|
# Acknowledgements
|
||||||
This application makes use of the following third party libraries:
|
This application makes use of the following third party libraries:
|
||||||
|
|
||||||
## KMPNativeCoroutinesCombine
|
## KMPNativeCoroutinesAsync
|
||||||
|
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ SOFTWARE.
|
||||||
<key>License</key>
|
<key>License</key>
|
||||||
<string>MIT</string>
|
<string>MIT</string>
|
||||||
<key>Title</key>
|
<key>Title</key>
|
||||||
<string>KMPNativeCoroutinesCombine</string>
|
<string>KMPNativeCoroutinesAsync</string>
|
||||||
<key>Type</key>
|
<key>Type</key>
|
||||||
<string>PSGroupSpecifier</string>
|
<string>PSGroupSpecifier</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
|
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
|
||||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../../common/build/cocoapods/framework"
|
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../../common/build/cocoapods/framework"
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||||
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCombine" "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore"
|
LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesAsync" "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore" /usr/lib/swift
|
||||||
OTHER_CFLAGS = $(inherited) -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCombine/KMPNativeCoroutinesCombine.modulemap" -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap"
|
OTHER_CFLAGS = $(inherited) -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesAsync/KMPNativeCoroutinesAsync.modulemap" -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap"
|
||||||
OTHER_LDFLAGS = $(inherited) -ObjC -l"KMPNativeCoroutinesCombine" -l"KMPNativeCoroutinesCore" -l"c++" -framework "Combine" -framework "common"
|
OTHER_LDFLAGS = $(inherited) -ObjC -l"KMPNativeCoroutinesAsync" -l"KMPNativeCoroutinesCore" -l"c++" -framework "common"
|
||||||
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCombine/KMPNativeCoroutinesCombine.modulemap" -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap"
|
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesAsync/KMPNativeCoroutinesAsync.modulemap" -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap"
|
||||||
PODS_BUILD_DIR = ${BUILD_DIR}
|
PODS_BUILD_DIR = ${BUILD_DIR}
|
||||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||||
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
|
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
|
||||||
PODS_ROOT = ${SRCROOT}/Pods
|
PODS_ROOT = ${SRCROOT}/Pods
|
||||||
SWIFT_INCLUDE_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCombine" "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore"
|
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
|
||||||
|
SWIFT_INCLUDE_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesAsync" "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore"
|
||||||
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
|
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
|
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
|
||||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../../common/build/cocoapods/framework"
|
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../../common/build/cocoapods/framework"
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||||
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCombine" "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore"
|
LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesAsync" "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore" /usr/lib/swift
|
||||||
OTHER_CFLAGS = $(inherited) -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCombine/KMPNativeCoroutinesCombine.modulemap" -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap"
|
OTHER_CFLAGS = $(inherited) -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesAsync/KMPNativeCoroutinesAsync.modulemap" -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap"
|
||||||
OTHER_LDFLAGS = $(inherited) -ObjC -l"KMPNativeCoroutinesCombine" -l"KMPNativeCoroutinesCore" -l"c++" -framework "Combine" -framework "common"
|
OTHER_LDFLAGS = $(inherited) -ObjC -l"KMPNativeCoroutinesAsync" -l"KMPNativeCoroutinesCore" -l"c++" -framework "common"
|
||||||
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCombine/KMPNativeCoroutinesCombine.modulemap" -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap"
|
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesAsync/KMPNativeCoroutinesAsync.modulemap" -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore/KMPNativeCoroutinesCore.modulemap"
|
||||||
PODS_BUILD_DIR = ${BUILD_DIR}
|
PODS_BUILD_DIR = ${BUILD_DIR}
|
||||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||||
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
|
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
|
||||||
PODS_ROOT = ${SRCROOT}/Pods
|
PODS_ROOT = ${SRCROOT}/Pods
|
||||||
SWIFT_INCLUDE_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCombine" "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore"
|
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
|
||||||
|
SWIFT_INCLUDE_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesAsync" "${PODS_CONFIGURATION_BUILD_DIR}/KMPNativeCoroutinesCore"
|
||||||
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
|
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
APPLICATION_EXTENSION_API_ONLY = YES
|
APPLICATION_EXTENSION_API_ONLY = YES
|
||||||
|
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
|
||||||
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/common
|
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/common
|
||||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../../common/build/cocoapods/framework"
|
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../../common/build/cocoapods/framework"
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||||
|
@ -7,6 +8,7 @@ PODS_BUILD_DIR = ${BUILD_DIR}
|
||||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||||
PODS_ROOT = ${SRCROOT}
|
PODS_ROOT = ${SRCROOT}
|
||||||
PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../../common
|
PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../../common
|
||||||
|
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
||||||
PRODUCT_MODULE_NAME = common
|
PRODUCT_MODULE_NAME = common
|
||||||
SKIP_INSTALL = YES
|
SKIP_INSTALL = YES
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
APPLICATION_EXTENSION_API_ONLY = YES
|
APPLICATION_EXTENSION_API_ONLY = YES
|
||||||
|
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
|
||||||
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/common
|
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/common
|
||||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../../common/build/cocoapods/framework"
|
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../../common/build/cocoapods/framework"
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||||
|
@ -7,6 +8,7 @@ PODS_BUILD_DIR = ${BUILD_DIR}
|
||||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||||
PODS_ROOT = ${SRCROOT}
|
PODS_ROOT = ${SRCROOT}
|
||||||
PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../../common
|
PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../../common
|
||||||
|
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
||||||
PRODUCT_MODULE_NAME = common
|
PRODUCT_MODULE_NAME = common
|
||||||
SKIP_INSTALL = YES
|
SKIP_INSTALL = YES
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<key>PeopleInSpace.xcscheme_^#shared#^_</key>
|
<key>PeopleInSpace.xcscheme_^#shared#^_</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>2</integer>
|
<integer>0</integer>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
<key>SuppressBuildableAutocreation</key>
|
<key>SuppressBuildableAutocreation</key>
|
||||||
|
|
|
@ -9,20 +9,34 @@
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false/>
|
<false/>
|
||||||
</dict>
|
</dict>
|
||||||
|
<key>KMPNativeCoroutinesCombine.xcscheme_^#shared#^_</key>
|
||||||
|
<dict>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>4</integer>
|
||||||
|
</dict>
|
||||||
<key>KMPNativeCoroutinesCore.xcscheme</key>
|
<key>KMPNativeCoroutinesCore.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false/>
|
<false/>
|
||||||
</dict>
|
</dict>
|
||||||
|
<key>KMPNativeCoroutinesCore.xcscheme_^#shared#^_</key>
|
||||||
|
<dict>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>3</integer>
|
||||||
|
</dict>
|
||||||
<key>Pods-PeopleInSpace.xcscheme</key>
|
<key>Pods-PeopleInSpace.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false/>
|
<false/>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>2</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>common.xcscheme</key>
|
<key>common.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false/>
|
<false/>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>1</integer>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
<key>SuppressBuildableAutocreation</key>
|
<key>SuppressBuildableAutocreation</key>
|
||||||
|
|
|
@ -11,5 +11,5 @@ rootProject.name = "PeopleInSpace"
|
||||||
include(":app", ":common", ":compose-desktop")
|
include(":app", ":common", ":compose-desktop")
|
||||||
include(":web")
|
include(":web")
|
||||||
include(":compose-web")
|
include(":compose-web")
|
||||||
include(":backend")
|
//include(":backend")
|
||||||
include(":wearApp")
|
include(":wearApp")
|
||||||
|
|
|
@ -18,7 +18,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
composeOptions {
|
composeOptions {
|
||||||
kotlinCompilerExtensionVersion = Versions.compose
|
kotlinCompilerExtensionVersion = Versions.composeCompiler
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
|
@ -53,6 +53,7 @@ dependencies {
|
||||||
}
|
}
|
||||||
|
|
||||||
with(Deps.Compose) {
|
with(Deps.Compose) {
|
||||||
|
implementation(compiler)
|
||||||
implementation(wearFoundation)
|
implementation(wearFoundation)
|
||||||
implementation(wearMaterial)
|
implementation(wearMaterial)
|
||||||
implementation(wearNavigation)
|
implementation(wearNavigation)
|
||||||
|
|
Loading…
Reference in a new issue