-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #176 from icerockdev/develop
Release 0.13.0
- Loading branch information
Showing
118 changed files
with
5,947 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Pod::Spec.new do |s| | ||
s.name = 'mokoMvvmFlowSwiftUI' | ||
s.version = '0.13.0' | ||
s.summary = 'MOKO MVVM SwiftUI additions for Flow' | ||
s.description = 'some description here' | ||
s.homepage = 'localhost' | ||
s.license = { :type => 'Apache 2' } | ||
s.authors = 'IceRock Development' | ||
s.source = { | ||
:http => "https://repo1.maven.org/maven2/dev/icerock/moko/mvvm-flow-swiftui/#{s.version}/mvvm-flow-swiftui-#{s.version}.zip", | ||
:type => "zip" | ||
} | ||
|
||
s.platform = :ios | ||
s.ios.deployment_target = '13.0' | ||
s.ios.vendored_framework = 'mokoMvvmFlowSwiftUI.xcframework' | ||
|
||
s.requires_arc = true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright 2022 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
plugins { | ||
id("org.jetbrains.kotlin.multiplatform") | ||
id("detekt-convention") | ||
id("org.jetbrains.compose") | ||
id("javadoc-stub-convention") | ||
id("publication-convention") | ||
} | ||
|
||
java { | ||
toolchain { | ||
languageVersion.set(JavaLanguageVersion.of(11)) | ||
} | ||
} | ||
|
||
kotlin { | ||
jvm() | ||
js(IR) { | ||
browser() | ||
} | ||
|
||
sourceSets { | ||
commonMain { | ||
dependencies { | ||
api(projects.mvvmFlow) | ||
|
||
api(compose.runtime) | ||
} | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
mvvm-flow-compose/src/commonMain/kotlin/dev/icerock/moko/mvvm/flow/compose/FlowActions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright 2022 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package dev.icerock.moko.mvvm.flow.compose | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.LaunchedEffect | ||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.flow.collect | ||
import kotlinx.coroutines.flow.onEach | ||
|
||
@Composable | ||
fun <T> Flow<T>.observeAsActions(onEach: (T) -> Unit) { | ||
val flow = this | ||
LaunchedEffect(key1 = flow) { | ||
flow.onEach(onEach).collect() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework | ||
import org.jetbrains.kotlin.konan.target.HostManager | ||
|
||
plugins { | ||
id("detekt-convention") | ||
id("org.jetbrains.kotlin.multiplatform") | ||
id("dev.icerock.mobile.multiplatform.apple-framework") | ||
id("publication-convention") | ||
} | ||
|
||
kotlin { | ||
iosArm64() | ||
iosX64() | ||
iosSimulatorArm64() | ||
macosX64() | ||
|
||
val xcf = XCFramework("MultiPlatformLibrary") | ||
targets.withType<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget>() | ||
.configureEach { | ||
binaries.withType<org.jetbrains.kotlin.gradle.plugin.mpp.Framework>().configureEach { | ||
xcf.add(this) | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
commonMainImplementation(libs.coroutines) | ||
|
||
commonMainApi(libs.mokoResources) | ||
commonMainApi(projects.mvvmFlow) | ||
commonMainApi(projects.mvvmCore) | ||
} | ||
|
||
framework { | ||
export(projects.mvvmCore) | ||
export(projects.mvvmFlow) | ||
export(libs.mokoResources) | ||
} | ||
|
||
val swiftXCFrameworkProject = File(projectDir, "xcode/mokoMvvmFlow.xcodeproj") | ||
val swiftXCFrameworkOutput = File(projectDir, "xcode/xcframework") | ||
val swiftXCFramework = File(swiftXCFrameworkOutput, "mokoMvvmFlowSwiftUI.xcframework") | ||
val swiftXCFrameworkArchive = File(swiftXCFrameworkOutput, "mokoMvvmFlowSwiftUI.xcframework.zip") | ||
|
||
val compileTask = tasks.create("compileMokoFlowSwiftUIXCFramework", Exec::class) { | ||
group = "xcode" | ||
|
||
commandLine = listOf( | ||
"xcodebuild", | ||
"-scheme", | ||
"mokoMvvmFlowSwiftUI", | ||
"-project", | ||
swiftXCFrameworkProject.absolutePath, | ||
"build" | ||
) | ||
|
||
dependsOn("assembleMultiPlatformLibraryDebugXCFramework") | ||
|
||
onlyIf { HostManager.hostIsMac } | ||
} | ||
|
||
val archiveTask = tasks.create("archiveMokoFlowSwiftUIXCFramework", Zip::class) { | ||
group = "xcode" | ||
|
||
from(swiftXCFramework) | ||
into(swiftXCFramework.name) | ||
|
||
archiveFileName.set(swiftXCFrameworkArchive.name) | ||
destinationDirectory.set(swiftXCFrameworkOutput) | ||
|
||
dependsOn(compileTask) | ||
|
||
onlyIf { HostManager.hostIsMac } | ||
} | ||
|
||
val publicationName = "swiftuiAdditions" | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>(publicationName) { | ||
artifactId = "mvvm-flow-swiftui" | ||
|
||
artifact(archiveTask.archiveFile) { | ||
extension = "zip" | ||
} | ||
|
||
pom { | ||
packaging = "zip" | ||
} | ||
} | ||
} | ||
} | ||
|
||
tasks.withType<AbstractPublishToMaven>() | ||
.configureEach { | ||
if (publication.name != publicationName) enabled = false | ||
else onlyIf { HostManager.hostIsMac } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* Copyright 2022 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package dev.icerock.moko.mvvm.flow.apple | ||
|
||
// just for compile this module | ||
fun helloWorld() = println("hello world") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
xcframework/ |
11 changes: 11 additions & 0 deletions
11
mvvm-flow/apple/xcode/Shared/Assets.xcassets/AccentColor.colorset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Oops, something went wrong.