From a2d14f88b36e7ffeacfdf274ba5db28d0564b0ce Mon Sep 17 00:00:00 2001 From: motorro Date: Mon, 15 Aug 2022 11:07:05 +0300 Subject: [PATCH] Kotlin 1.7.10, Compose compiler 1.3 --- README.md | 11 +-- androidcore/build.gradle | 1 - gradle/libs.versions.toml | 21 +++-- kotlin-js-store/yarn.lock | 76 ++++++++----------- lce/build.gradle | 2 +- .../motorro/statemachine/lce/ui/LceScreen.kt | 2 + login/build.gradle | 1 - .../model/state/PasswordEntryStateTest.kt | 1 - register/build.gradle | 1 - welcome/build.gradle | 2 +- 10 files changed, 52 insertions(+), 66 deletions(-) diff --git a/README.md b/README.md index 2534cb3..55e9bca 100644 --- a/README.md +++ b/README.md @@ -1160,8 +1160,9 @@ adopt it's output to your platform view components. ## Note on multiplatform ## Although the logic for registration flow of `Welcome` app is made common, -I've failed to implement registration view in `androidMain` source due to some Kotlin-multiplatform -glitches or misconfiguration. The problem is Android sources fail to import common dependencies -from other common modules. If anyone could help me fixing that issue and moving `register` module -to `commonregister` I'll much appreciate this. Also if someone would like to try building an iOS -sample around `commonregister` module - that will be awesome! +I've failed to implement registration view in `androidMain` source due to [some Kotlin-multiplatform +glitches](https://youtrack.jetbrains.com/issue/KTIJ-22056/KMM-Cant-reference-shared-module-commonMain-source-set-classes-from-another-modules-androidMain-source-set) +or misconfiguration. The problem is Android sources fail to import common dependencies from other +common modules. If anyone could help me fixing that issue and moving `register` module to +`commonregister` I'll much appreciate this. Also if someone would like to try building an iOS sample +around `commonregister` module - that will be awesome! diff --git a/androidcore/build.gradle b/androidcore/build.gradle index a23b326..7646df4 100644 --- a/androidcore/build.gradle +++ b/androidcore/build.gradle @@ -59,7 +59,6 @@ dependencies { implementation libs.bundles.compose.core implementation libs.compose.activity - implementation libs.compose.navigation implementation libs.compose.foundation implementation libs.compose.foundation.layouts diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c2351ba..65dfaa9 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,13 +1,13 @@ [versions] -kotlin = "1.7.0" +kotlin = "1.7.10" coroutines = "1.6.4" -compose = "1.1.1" -compose_compiler = "1.2.0" +compose = "1.2.1" +compose_compiler = "1.3.0" hilt = "2.42" [plugins] -android_app = { id = "com.android.application", version = "7.2.1" } -android_lib = { id = "com.android.library", version = "7.2.1" } +android_app = { id = "com.android.application", version = "7.2.2" } +android_lib = { id = "com.android.library", version = "7.2.2" } kotlin_jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } kotlin_android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin_kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } @@ -34,11 +34,10 @@ compose-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "co compose-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" } compose-material = { module = "androidx.compose.material:material", version.ref = "compose" } compose-test-junit = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "compose" } -compose-activity = { module = "androidx.activity:activity-compose", version.ref = "compose" } -compose-livedata = { module = "androidx.compose.runtime:runtime-livedata", version = "1.1.1" } -compose-navigation = { module = "androidx.navigation:navigation-compose", version = "2.4.2" } -compose-foundation = { module = "androidx.compose.foundation:foundation", version = "1.2.0-beta01" } -compose-foundation-layouts = { module = "androidx.compose.foundation:foundation-layout", version = "1.2.0-beta01" } +compose-activity = { module = "androidx.activity:activity-compose", version = "1.5.1" } +compose-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version = "2.5.1" } +compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "compose" } +compose-foundation-layouts = { module = "androidx.compose.foundation:foundation-layout", version.ref = "compose" } hilt_android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" } hilt_compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hilt" } @@ -64,5 +63,5 @@ test-mockk-common = { module = "io.mockk:mockk-common", version = "1.12.3" } test-kotlin-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" } [bundles] -compose-core = ["compose-ui", "compose-tooling-preview", "compose-material", "compose-livedata"] +compose-core = ["compose-ui", "compose-tooling-preview", "compose-material"] test-core = ["test-kotlin", "test-junit", "test-mockk"] \ No newline at end of file diff --git a/kotlin-js-store/yarn.lock b/kotlin-js-store/yarn.lock index a240ce3..a48deef 100644 --- a/kotlin-js-store/yarn.lock +++ b/kotlin-js-store/yarn.lock @@ -55,6 +55,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" @@ -126,10 +133,10 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -debug@4.3.3: - version "4.3.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" - integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== +debug@4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" @@ -217,11 +224,6 @@ glob@7.2.0: once "^1.3.0" path-is-absolute "^1.0.0" -growl@1.10.5: - version "1.10.5" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== - has-flag@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" @@ -284,11 +286,6 @@ is-unicode-supported@^0.1.0: resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== - js-yaml@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" @@ -311,12 +308,12 @@ log-symbols@4.1.0: chalk "^4.1.0" is-unicode-supported "^0.1.0" -minimatch@3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== +minimatch@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b" + integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== dependencies: - brace-expansion "^1.1.7" + brace-expansion "^2.0.1" minimatch@^3.0.4: version "3.1.2" @@ -325,32 +322,30 @@ minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -mocha@9.2.1: - version "9.2.1" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.2.1.tgz#a1abb675aa9a8490798503af57e8782a78f1338e" - integrity sha512-T7uscqjJVS46Pq1XDXyo9Uvey9gd3huT/DD9cYBb4K2Xc/vbKRPUWK067bxDQRK0yIz6Jxk73IrnimvASzBNAQ== +mocha@10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.0.0.tgz#205447d8993ec755335c4b13deba3d3a13c4def9" + integrity sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA== dependencies: "@ungap/promise-all-settled" "1.1.2" ansi-colors "4.1.1" browser-stdout "1.3.1" chokidar "3.5.3" - debug "4.3.3" + debug "4.3.4" diff "5.0.0" escape-string-regexp "4.0.0" find-up "5.0.0" glob "7.2.0" - growl "1.10.5" he "1.2.0" js-yaml "4.1.0" log-symbols "4.1.0" - minimatch "3.0.4" + minimatch "5.0.1" ms "2.1.3" - nanoid "3.2.0" + nanoid "3.3.3" serialize-javascript "6.0.0" strip-json-comments "3.1.1" supports-color "8.1.1" - which "2.0.2" - workerpool "6.2.0" + workerpool "6.2.1" yargs "16.2.0" yargs-parser "20.2.4" yargs-unparser "2.0.0" @@ -365,10 +360,10 @@ ms@2.1.3: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -nanoid@3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.2.0.tgz#62667522da6673971cca916a6d3eff3f415ff80c" - integrity sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA== +nanoid@3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25" + integrity sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w== normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" @@ -497,17 +492,10 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -which@2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -workerpool@6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.0.tgz#827d93c9ba23ee2019c3ffaff5c27fccea289e8b" - integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A== +workerpool@6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" + integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== wrap-ansi@^7.0.0: version "7.0.0" diff --git a/lce/build.gradle b/lce/build.gradle index 095c9b5..067c4dc 100644 --- a/lce/build.gradle +++ b/lce/build.gradle @@ -77,7 +77,7 @@ dependencies { implementation libs.bundles.compose.core implementation libs.compose.activity - implementation libs.compose.navigation + implementation libs.compose.viewmodel implementation libs.compose.foundation implementation libs.compose.foundation.layouts diff --git a/lce/src/main/java/com/motorro/statemachine/lce/ui/LceScreen.kt b/lce/src/main/java/com/motorro/statemachine/lce/ui/LceScreen.kt index a64a4b5..606b59c 100644 --- a/lce/src/main/java/com/motorro/statemachine/lce/ui/LceScreen.kt +++ b/lce/src/main/java/com/motorro/statemachine/lce/ui/LceScreen.kt @@ -13,6 +13,7 @@ package com.motorro.statemachine.lce.ui +import android.annotation.SuppressLint import androidx.activity.compose.BackHandler import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.material.* @@ -31,6 +32,7 @@ import com.motorro.statemachine.lce.data.LceUiState import com.motorro.statemachine.lce.model.LceViewModel @Composable +@SuppressLint("UnusedMaterialScaffoldPaddingParameter") fun LceScreen(onExit: @Composable () -> Unit) { val model: LceViewModel = viewModel() val state = model.state.collectAsState(LceUiState.Loading) diff --git a/login/build.gradle b/login/build.gradle index 6c16f89..4ea166e 100644 --- a/login/build.gradle +++ b/login/build.gradle @@ -65,7 +65,6 @@ dependencies { implementation libs.bundles.compose.core implementation libs.compose.activity - implementation libs.compose.navigation implementation libs.compose.foundation implementation libs.compose.foundation.layouts diff --git a/login/src/test/java/com/motorro/statemachine/login/model/state/PasswordEntryStateTest.kt b/login/src/test/java/com/motorro/statemachine/login/model/state/PasswordEntryStateTest.kt index f172db8..94c5fe9 100644 --- a/login/src/test/java/com/motorro/statemachine/login/model/state/PasswordEntryStateTest.kt +++ b/login/src/test/java/com/motorro/statemachine/login/model/state/PasswordEntryStateTest.kt @@ -108,7 +108,6 @@ internal class PasswordEntryStateTest : BaseStateTest() { @Test fun returnsToEmailEntryOnBack() { - val data = LoginDataState(GOOD) every { host.backToEmailEntry() } just Runs val state = createState() diff --git a/register/build.gradle b/register/build.gradle index 692a83d..3cc22d3 100644 --- a/register/build.gradle +++ b/register/build.gradle @@ -65,7 +65,6 @@ dependencies { implementation libs.bundles.compose.core implementation libs.compose.activity - implementation libs.compose.navigation implementation libs.compose.foundation implementation libs.compose.foundation.layouts diff --git a/welcome/build.gradle b/welcome/build.gradle index 301c9d3..df429e0 100644 --- a/welcome/build.gradle +++ b/welcome/build.gradle @@ -86,7 +86,7 @@ dependencies { implementation libs.bundles.compose.core implementation libs.compose.activity - implementation libs.compose.navigation + implementation libs.compose.viewmodel implementation libs.compose.foundation implementation libs.compose.foundation.layouts