From 6c9784e7b97e5e06a877dd15dfab3856ead63c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petrus=20Nguy=E1=BB=85n=20Th=C3=A1i=20H=E1=BB=8Dc?= Date: Mon, 2 Oct 2023 09:35:28 +0700 Subject: [PATCH] =?UTF-8?q?Kotlin=201.9.10,=20AGP=208.1.2,=20Ktlint=201.0.?= =?UTF-8?q?0,=20Kotlinx-Kover,=20SDK=2034,=20and=20others=20=E2=9D=A4?= =?UTF-8?q?=EF=B8=8F=20(#201)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * kotlin 1.9.0, AGP 8.1.0 * kotlin 1.9.0, AGP 8.1.0 * Kover * ktlint 1.0.0 * java-version: '17' * java-version: '17' * Update qodana.yml * Update qodana.yml * Update qodana.yml * Skip qodana --- .editorconfig | 27 +- .github/workflows/build.yml | 2 +- .github/workflows/gradle-versions-checker.yml | 2 +- .github/workflows/qodana.yml | 22 +- .github/workflows/review-suggest.yml | 2 +- .github/workflows/unit-test.yml | 7 +- .idea/codeStyles/Project.xml | 4 +- .idea/compiler.xml | 22 +- .idea/gradle.xml | 2 +- .idea/kotlinc.xml | 3 + .idea/misc.xml | 3 +- README.md | 2 +- app/build.gradle.kts | 53 +- app/src/main/java/com/hoc/flowmvi/App.kt | 17 +- .../java/com/hoc/flowmvi/core/CoreModule.kt | 9 +- .../com/hoc/flowmvi/core/NavigatorImpl.kt | 3 +- .../initializer/ViewBindingInitializer.kt | 3 +- .../java/com/hoc/flowmvi/CheckModulesTest.kt | 17 +- build.gradle.kts | 147 ++-- buildSrc/build.gradle.kts | 8 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- buildSrc/src/main/kotlin/deps.kt | 33 +- core-ui/build.gradle.kts | 8 +- .../java/com/hoc/flowmvi/core_ui/CollectIn.kt | 22 +- .../com/hoc/flowmvi/core_ui/FlowBinding.kt | 67 +- .../core_ui/SwipeLeftToDeleteCallback.kt | 13 +- .../com/hoc/flowmvi/core_ui/parcelable.kt | 30 + core/build.gradle.kts | 1 + .../java/com/hoc/flowmvi/core/EitherNes.kt | 7 +- .../java/com/hoc/flowmvi/core/NonEmptySet.kt | 102 +-- .../com/hoc/flowmvi/core/selfReference.kt | 9 +- .../com/hoc/flowmvi/core/NonEmptySetTest.kt | 18 +- coverage.gradle.kts | 36 - data/build.gradle.kts | 8 +- .../java/com/hoc/flowmvi/data/DataModule.kt | 77 +- .../hoc/flowmvi/data/UserRepositoryImpl.kt | 189 +++-- .../data/mapper/UserDomainToUserBodyMapper.kt | 7 +- .../flowmvi/data/mapper/UserErrorMapper.kt | 29 +- .../mapper/UserResponseToUserDomainMapper.kt | 10 +- .../hoc/flowmvi/data/remote/ErrorResponse.kt | 2 + .../hoc/flowmvi/data/remote/UserApiService.kt | 12 +- .../hoc/flowmvi/data/remote/UserResponse.kt | 2 +- .../data/UserRepositoryImplRealAPITest.kt | 86 +- .../flowmvi/data/UserRepositoryImplTest.kt | 398 ++++----- .../mapper/UserDomainToUserBodyMapperTest.kt | 22 +- .../data/mapper/UserErrorMapperTest.kt | 62 +- .../UserResponseToUserDomainMapperTest.kt | 49 +- domain/build.gradle.kts | 1 + .../com/hoc/flowmvi/domain/DomainModule.kt | 15 +- .../com/hoc/flowmvi/domain/model/Email.kt | 7 +- .../com/hoc/flowmvi/domain/model/FirstName.kt | 7 +- .../com/hoc/flowmvi/domain/model/LastName.kt | 7 +- .../java/com/hoc/flowmvi/domain/model/User.kt | 27 +- .../com/hoc/flowmvi/domain/model/UserError.kt | 15 +- .../domain/model/UserValidationError.kt | 3 +- .../flowmvi/domain/usecase/AddUserUseCase.kt | 4 +- .../flowmvi/domain/usecase/GetUsersUseCase.kt | 4 +- .../domain/usecase/RefreshGetUsersUseCase.kt | 4 +- .../domain/usecase/RemoveUserUseCase.kt | 4 +- .../domain/usecase/SearchUsersUseCase.kt | 7 +- .../com/hoc/flowmvi/domain/UseCaseTest.kt | 183 +++-- .../java/com/hoc/flowmvi/domain/UserTest.kt | 128 +-- feature-add/build.gradle.kts | 4 +- .../com/hoc/flowmvi/ui/add/AddActivity.kt | 101 +-- .../com/hoc/flowmvi/ui/add/AddContract.kt | 120 ++- .../java/com/hoc/flowmvi/ui/add/AddModule.kt | 11 +- .../main/java/com/hoc/flowmvi/ui/add/AddVM.kt | 122 +-- .../java/com/hoc/flowmvi/ui/add/AddVMTest.kt | 493 ++++++------ feature-main/build.gradle.kts | 4 +- .../com/hoc/flowmvi/ui/main/MainActivity.kt | 47 +- .../com/hoc/flowmvi/ui/main/MainContract.kt | 118 ++- .../com/hoc/flowmvi/ui/main/MainModule.kt | 7 +- .../java/com/hoc/flowmvi/ui/main/MainVM.kt | 105 +-- .../com/hoc/flowmvi/ui/main/UserAdapter.kt | 29 +- .../hoc/flowmvi/ui/main/MainContractTest.kt | 49 +- .../com/hoc/flowmvi/ui/main/MainVMTest.kt | 391 ++++----- .../java/com/hoc/flowmvi/ui/main/TestData.kt | 47 +- feature-search/build.gradle.kts | 4 +- .../hoc/flowmvi/ui/search/SearchActivity.kt | 64 +- .../hoc/flowmvi/ui/search/SearchAdapter.kt | 31 +- .../hoc/flowmvi/ui/search/SearchContract.kt | 98 ++- .../com/hoc/flowmvi/ui/search/SearchModule.kt | 11 +- .../com/hoc/flowmvi/ui/search/SearchVM.kt | 77 +- .../flowmvi/ui/search/SearchContractTest.kt | 20 +- .../com/hoc/flowmvi/ui/search/SearchVMTest.kt | 756 +++++++++--------- .../com/hoc/flowmvi/ui/search/TestData.kt | 47 +- gradle/wrapper/gradle-wrapper.properties | 2 +- mvi/mvi-base/build.gradle.kts | 8 +- .../flowmvi/mvi_base/AbstractMviActivity.kt | 10 +- .../flowmvi/mvi_base/AbstractMviViewModel.kt | 15 +- .../hoc/flowmvi/mvi_base/MviSingleEvent.kt | 1 + .../java/com/hoc/flowmvi/mvi_base/MviView.kt | 6 +- .../com/hoc/flowmvi/mvi_base/MviViewState.kt | 1 + mvi/mvi-testing/build.gradle.kts | 11 +- .../mvi_testing/BaseMviViewModelTest.kt | 136 ++-- settings.gradle.kts | 28 +- .../test_utils/TestAppCoroutineDispatchers.kt | 5 +- 97 files changed, 2712 insertions(+), 2339 deletions(-) create mode 100644 core-ui/src/main/java/com/hoc/flowmvi/core_ui/parcelable.kt delete mode 100644 coverage.gradle.kts diff --git a/.editorconfig b/.editorconfig index 4bda7f7f..098208df 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,14 +1,19 @@ -root = true - +root=true [*] -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - +indent_size=2 +end_of_line=lf +charset=utf-8 +trim_trailing_whitespace=true +insert_final_newline=true [*.{kt,kts}] -ij_kotlin_imports_layout = * - +ij_kotlin_imports_layout=* +ij_continuation_indent_size=4 +ktlint_standard_filename=disabled +ktlint_standard_package-name=disabled +ktlint_standard_property-naming=disabled +ktlint_standard_function-naming=disabled +ktlint_standard_no-empty-file=disabled +filename=disabled +ktlint_experimental=enabled [*.xml] -indent_size = 4 +indent_size=4 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 40cb3f3e..ac6fe9ec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: '11' + java-version: '17' - name: Cache gradle, wrapper and buildSrc uses: actions/cache@v3 diff --git a/.github/workflows/gradle-versions-checker.yml b/.github/workflows/gradle-versions-checker.yml index 1131a546..3f14ca2d 100644 --- a/.github/workflows/gradle-versions-checker.yml +++ b/.github/workflows/gradle-versions-checker.yml @@ -20,7 +20,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: '11' + java-version: '17' - name: Cache gradle, wrapper and buildSrc uses: actions/cache@v3 diff --git a/.github/workflows/qodana.yml b/.github/workflows/qodana.yml index 8f4f22a8..a20aa35c 100644 --- a/.github/workflows/qodana.yml +++ b/.github/workflows/qodana.yml @@ -15,14 +15,14 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: JetBrains/qodana-action@v2022.3.4 - with: - linter: jetbrains/qodana-jvm-android:latest - fail-threshold: 10 - - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ${{ runner.temp }}/qodana/results/report - destination_dir: ./ + # - name: Set up JDK + # uses: actions/setup-java@v3 + # with: + # distribution: 'zulu' + # java-version: '11' + + # - uses: JetBrains/qodana-action@v2023.2.6 + # with: + # linter: jetbrains/qodana-jvm-android:latest + # fail-threshold: 10 + # upload-result: true diff --git a/.github/workflows/review-suggest.yml b/.github/workflows/review-suggest.yml index 2ff9fc2c..32f92e64 100644 --- a/.github/workflows/review-suggest.yml +++ b/.github/workflows/review-suggest.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: '11' + java-version: '17' - name: Cache gradle, wrapper and buildSrc uses: actions/cache@v3 with: diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index f5c0d600..b240674c 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -22,7 +22,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: '11' + java-version: '17' - name: Cache gradle, wrapper and buildSrc uses: actions/cache@v3 @@ -38,10 +38,7 @@ jobs: run: chmod +x ./gradlew - name: Run Android Debug Unit Test - run: ./gradlew jacocoTestReportDebug --warning-mode all --stacktrace - - - name: Run Java/Kotlin Unit Test - run: ./gradlew jacocoTestReport --warning-mode all --stacktrace + run: ./gradlew :app:koverHtmlReport --warning-mode all --stacktrace - name: Upload Test Report uses: codecov/codecov-action@v3.1.4 diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 17eb6a80..1cae6040 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -7,8 +7,6 @@ -