From 398898bc100b62cc09098514eec6ececb7463fa6 Mon Sep 17 00:00:00 2001 From: Aleksey Mikhailov Date: Tue, 3 May 2022 10:13:52 +0700 Subject: [PATCH 1/8] gradle build action usage --- .github/workflows/compilation-check.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/compilation-check.yml b/.github/workflows/compilation-check.yml index 560ecce6..b4308576 100644 --- a/.github/workflows/compilation-check.yml +++ b/.github/workflows/compilation-check.yml @@ -18,6 +18,8 @@ jobs: uses: actions/setup-java@v1 with: java-version: 11 + - name: Gradle Build Action + uses: gradle/gradle-build-action@v2.1.5 - name: Check build run: ./run-check.sh "${{ matrix.os }}" shell: bash @@ -33,3 +35,15 @@ jobs: with: report_paths: '**/build/test-results/**/TEST-*.xml' github_token: ${{ secrets.GITHUB_TOKEN }} + - name: "Comment build scan url" + uses: actions/github-script@v5 + if: github.event_name == 'pull_request' && failure() + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '❌ ${{ github.workflow }} failed: ${{ steps.gradle.outputs.build-scan-url }}' + }) From b0746157012b89b40846cfa7ebf7c95a038e7e80 Mon Sep 17 00:00:00 2001 From: Aleksey Mikhailov Date: Tue, 3 May 2022 11:22:26 +0700 Subject: [PATCH 2/8] change just for test ci caches --- .../kotlin/dev/icerock/moko/mvvm/flow/CMutableStateFlow.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mvvm-flow/src/commonMain/kotlin/dev/icerock/moko/mvvm/flow/CMutableStateFlow.kt b/mvvm-flow/src/commonMain/kotlin/dev/icerock/moko/mvvm/flow/CMutableStateFlow.kt index d184e253..f6ed796d 100644 --- a/mvvm-flow/src/commonMain/kotlin/dev/icerock/moko/mvvm/flow/CMutableStateFlow.kt +++ b/mvvm-flow/src/commonMain/kotlin/dev/icerock/moko/mvvm/flow/CMutableStateFlow.kt @@ -9,3 +9,5 @@ import kotlinx.coroutines.flow.MutableStateFlow expect class CMutableStateFlow(flow: MutableStateFlow) : MutableStateFlow fun MutableStateFlow.cMutableStateFlow(): CMutableStateFlow = CMutableStateFlow(this) + +fun MutableStateFlow.test() {} From 28fe39d8173d79d159ecb81c33eb093a92bb788f Mon Sep 17 00:00:00 2001 From: Aleksey Mikhailov Date: Tue, 3 May 2022 11:28:50 +0700 Subject: [PATCH 3/8] Revert "change just for test ci caches" This reverts commit b0746157012b89b40846cfa7ebf7c95a038e7e80. --- .../kotlin/dev/icerock/moko/mvvm/flow/CMutableStateFlow.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/mvvm-flow/src/commonMain/kotlin/dev/icerock/moko/mvvm/flow/CMutableStateFlow.kt b/mvvm-flow/src/commonMain/kotlin/dev/icerock/moko/mvvm/flow/CMutableStateFlow.kt index f6ed796d..d184e253 100644 --- a/mvvm-flow/src/commonMain/kotlin/dev/icerock/moko/mvvm/flow/CMutableStateFlow.kt +++ b/mvvm-flow/src/commonMain/kotlin/dev/icerock/moko/mvvm/flow/CMutableStateFlow.kt @@ -9,5 +9,3 @@ import kotlinx.coroutines.flow.MutableStateFlow expect class CMutableStateFlow(flow: MutableStateFlow) : MutableStateFlow fun MutableStateFlow.cMutableStateFlow(): CMutableStateFlow = CMutableStateFlow(this) - -fun MutableStateFlow.test() {} From cab4c3718d8c077514cf4c9d6c87a80004dd4794 Mon Sep 17 00:00:00 2001 From: mdubkov Date: Mon, 8 Aug 2022 15:25:37 +0700 Subject: [PATCH 4/8] #188 event dispatcher fix bind in fragment --- .../main/kotlin/dev/icerock/moko/mvvm/MvvmEventsFragment.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mvvm-databinding/src/main/kotlin/dev/icerock/moko/mvvm/MvvmEventsFragment.kt b/mvvm-databinding/src/main/kotlin/dev/icerock/moko/mvvm/MvvmEventsFragment.kt index 25144103..93686ee4 100644 --- a/mvvm-databinding/src/main/kotlin/dev/icerock/moko/mvvm/MvvmEventsFragment.kt +++ b/mvvm-databinding/src/main/kotlin/dev/icerock/moko/mvvm/MvvmEventsFragment.kt @@ -5,14 +5,15 @@ package dev.icerock.moko.mvvm import android.os.Bundle +import android.view.View import androidx.databinding.ViewDataBinding import dev.icerock.moko.mvvm.dispatcher.EventsDispatcherOwner import dev.icerock.moko.mvvm.viewmodel.ViewModel abstract class MvvmEventsFragment : MvvmFragment() where VM : ViewModel, VM : EventsDispatcherOwner { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) @Suppress("UNCHECKED_CAST") viewModel.eventsDispatcher.bind(viewLifecycleOwner, this as Listener) From bc851dbfbba01959ed424dda0c7c8525ffd8498a Mon Sep 17 00:00:00 2001 From: Aleksey Mikhailov Date: Mon, 8 Aug 2022 21:24:57 +0700 Subject: [PATCH 5/8] Update compilation-check.yml --- .github/workflows/compilation-check.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/compilation-check.yml b/.github/workflows/compilation-check.yml index b4308576..0a045262 100644 --- a/.github/workflows/compilation-check.yml +++ b/.github/workflows/compilation-check.yml @@ -35,15 +35,3 @@ jobs: with: report_paths: '**/build/test-results/**/TEST-*.xml' github_token: ${{ secrets.GITHUB_TOKEN }} - - name: "Comment build scan url" - uses: actions/github-script@v5 - if: github.event_name == 'pull_request' && failure() - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: '❌ ${{ github.workflow }} failed: ${{ steps.gradle.outputs.build-scan-url }}' - }) From f73686a1ff172c6d81511b8eb4fde9f4daea76c8 Mon Sep 17 00:00:00 2001 From: Aleksey Mikhailov Date: Mon, 8 Aug 2022 21:28:57 +0700 Subject: [PATCH 6/8] up version --- README.md | 36 ++++++++++++++++++------------------ gradle/libs.versions.toml | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 62ccfe65..1f64f367 100755 --- a/README.md +++ b/README.md @@ -50,21 +50,21 @@ allprojects { project build.gradle ```groovy dependencies { - commonMainApi("dev.icerock.moko:mvvm-core:0.13.0") // only ViewModel, EventsDispatcher, Dispatchers.UI - commonMainApi("dev.icerock.moko:mvvm-flow:0.13.0") // api mvvm-core, CFlow for native and binding extensions - commonMainApi("dev.icerock.moko:mvvm-livedata:0.13.0") // api mvvm-core, LiveData and extensions - commonMainApi("dev.icerock.moko:mvvm-state:0.13.0") // api mvvm-livedata, ResourceState class and extensions - commonMainApi("dev.icerock.moko:mvvm-livedata-resources:0.13.0") // api mvvm-core, moko-resources, extensions for LiveData with moko-resources + commonMainApi("dev.icerock.moko:mvvm-core:0.13.1") // only ViewModel, EventsDispatcher, Dispatchers.UI + commonMainApi("dev.icerock.moko:mvvm-flow:0.13.1") // api mvvm-core, CFlow for native and binding extensions + commonMainApi("dev.icerock.moko:mvvm-livedata:0.13.1") // api mvvm-core, LiveData and extensions + commonMainApi("dev.icerock.moko:mvvm-state:0.13.1") // api mvvm-livedata, ResourceState class and extensions + commonMainApi("dev.icerock.moko:mvvm-livedata-resources:0.13.1") // api mvvm-core, moko-resources, extensions for LiveData with moko-resources - androidMainApi("dev.icerock.moko:mvvm-flow-compose:0.13.0") // api mvvm-flow, binding extensions for Jetpack Compose (jvm, js, android) - androidMainApi("dev.icerock.moko:mvvm-livedata-compose:0.13.0") // api mvvm-livedata, binding extensions for Jetpack Compose (jvm, js, android) - androidMainApi("dev.icerock.moko:mvvm-livedata-material:0.13.0") // api mvvm-livedata, Material library android extensions - androidMainApi("dev.icerock.moko:mvvm-livedata-glide:0.13.0") // api mvvm-livedata, Glide library android extensions - androidMainApi("dev.icerock.moko:mvvm-livedata-swiperefresh:0.13.0") // api mvvm-livedata, SwipeRefreshLayout library android extensions - androidMainApi("dev.icerock.moko:mvvm-databinding:0.13.0") // api mvvm-livedata, DataBinding support for Android - androidMainApi("dev.icerock.moko:mvvm-viewbinding:0.13.0") // api mvvm-livedata, ViewBinding support for Android + androidMainApi("dev.icerock.moko:mvvm-flow-compose:0.13.1") // api mvvm-flow, binding extensions for Jetpack Compose (jvm, js, android) + androidMainApi("dev.icerock.moko:mvvm-livedata-compose:0.13.1") // api mvvm-livedata, binding extensions for Jetpack Compose (jvm, js, android) + androidMainApi("dev.icerock.moko:mvvm-livedata-material:0.13.1") // api mvvm-livedata, Material library android extensions + androidMainApi("dev.icerock.moko:mvvm-livedata-glide:0.13.1") // api mvvm-livedata, Glide library android extensions + androidMainApi("dev.icerock.moko:mvvm-livedata-swiperefresh:0.13.1") // api mvvm-livedata, SwipeRefreshLayout library android extensions + androidMainApi("dev.icerock.moko:mvvm-databinding:0.13.1") // api mvvm-livedata, DataBinding support for Android + androidMainApi("dev.icerock.moko:mvvm-viewbinding:0.13.1") // api mvvm-livedata, ViewBinding support for Android - commonTestImplementation("dev.icerock.moko:mvvm-test:0.13.0") // test utilities + commonTestImplementation("dev.icerock.moko:mvvm-test:0.13.1") // test utilities } ``` @@ -74,10 +74,10 @@ kotlin { // export correct artifact to use all classes of library directly from Swift targets.withType(org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget::class.java).all { binaries.withType(org.jetbrains.kotlin.gradle.plugin.mpp.Framework::class.java).all { - export("dev.icerock.moko:mvvm-core:0.13.0") - export("dev.icerock.moko:mvvm-livedata:0.13.0") - export("dev.icerock.moko:mvvm-livedata-resources:0.13.0") - export("dev.icerock.moko:mvvm-state:0.13.0") + export("dev.icerock.moko:mvvm-core:0.13.1") + export("dev.icerock.moko:mvvm-livedata:0.13.1") + export("dev.icerock.moko:mvvm-livedata-resources:0.13.1") + export("dev.icerock.moko:mvvm-state:0.13.1") } } } @@ -93,7 +93,7 @@ generation enabled. All `LiveData` to `UIView` bindings is extensions for UI ele To use MOKO MVVM with SwiftUI set name of your kotlin framework to `MultiPlatformLibrary` and add dependency to CocoaPods: ```ruby -pod 'mokoMvvmFlowSwiftUI', :podspec => 'https://raw.githubusercontent.com/icerockdev/moko-mvvm/release/0.13.0/mokoMvvmFlowSwiftUI.podspec' +pod 'mokoMvvmFlowSwiftUI', :podspec => 'https://raw.githubusercontent.com/icerockdev/moko-mvvm/release/0.13.1/mokoMvvmFlowSwiftUI.podspec' ``` required export of `mvvm-core` and `mvvm-flow`. diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 48d1eab7..d6a0efae 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,7 +4,7 @@ androidLifecycleVersion = "2.2.0" coroutinesVersion = "1.6.0-native-mt" mokoResourcesVersion = "0.18.0" mokoTestVersion = "0.6.1" -mokoMvvmVersion = "0.13.0" +mokoMvvmVersion = "0.13.1" mokoKSwiftVersion = "0.4.0" composeVersion = "1.1.1" composeJetBrainsVersion = "1.1.1" From 1fb46b89ffe15eb7ed39ed609bc1c2d9482d75fc Mon Sep 17 00:00:00 2001 From: Aleksey Mikhailov Date: Mon, 8 Aug 2022 21:36:29 +0700 Subject: [PATCH 7/8] #188 fix viewbinding bug too --- .../dev/icerock/moko/mvvm/viewbinding/MvvmEventsFragment.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mvvm-viewbinding/src/main/kotlin/dev/icerock/moko/mvvm/viewbinding/MvvmEventsFragment.kt b/mvvm-viewbinding/src/main/kotlin/dev/icerock/moko/mvvm/viewbinding/MvvmEventsFragment.kt index 0632d562..31f6bad3 100644 --- a/mvvm-viewbinding/src/main/kotlin/dev/icerock/moko/mvvm/viewbinding/MvvmEventsFragment.kt +++ b/mvvm-viewbinding/src/main/kotlin/dev/icerock/moko/mvvm/viewbinding/MvvmEventsFragment.kt @@ -11,8 +11,8 @@ import dev.icerock.moko.mvvm.viewmodel.ViewModel abstract class MvvmEventsFragment : MvvmFragment() where VM : ViewModel, VM : EventsDispatcherOwner { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) @Suppress("UNCHECKED_CAST") viewModel.eventsDispatcher.bind(viewLifecycleOwner, this as Listener) From ef2da69465892a42cb8cf1257fdcbbd62a541eb2 Mon Sep 17 00:00:00 2001 From: Aleksey Mikhailov Date: Mon, 8 Aug 2022 22:08:03 +0700 Subject: [PATCH 8/8] #188 fix build error --- .../dev/icerock/moko/mvvm/viewbinding/MvvmEventsFragment.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/mvvm-viewbinding/src/main/kotlin/dev/icerock/moko/mvvm/viewbinding/MvvmEventsFragment.kt b/mvvm-viewbinding/src/main/kotlin/dev/icerock/moko/mvvm/viewbinding/MvvmEventsFragment.kt index 31f6bad3..80fbc3bd 100644 --- a/mvvm-viewbinding/src/main/kotlin/dev/icerock/moko/mvvm/viewbinding/MvvmEventsFragment.kt +++ b/mvvm-viewbinding/src/main/kotlin/dev/icerock/moko/mvvm/viewbinding/MvvmEventsFragment.kt @@ -5,6 +5,7 @@ package dev.icerock.moko.mvvm.viewbinding import android.os.Bundle +import android.view.View import androidx.viewbinding.ViewBinding import dev.icerock.moko.mvvm.dispatcher.EventsDispatcherOwner import dev.icerock.moko.mvvm.viewmodel.ViewModel