diff --git a/.github/actions/inflate-secrets/action.yml b/.github/actions/inflate-secrets/action.yml index df69f71de..617bd9dca 100644 --- a/.github/actions/inflate-secrets/action.yml +++ b/.github/actions/inflate-secrets/action.yml @@ -10,6 +10,9 @@ inputs: playstore-creds: description: 'The playstore credentials to inflate' required: true + firebase-creds: + description: 'The firebase credentials to inflate' + required: true runs: using: 'composite' steps: @@ -38,3 +41,10 @@ runs: CREDS: ${{ inputs.playstore-creds }} run: | echo $CREDS > mifospay-android/playStorePublishServiceCredentialsFile.json + + - name: Inflate firebaseAppDistributionServiceCredentialsFile.json + shell: bash + env: + CREDS: ${{ inputs.firebase-creds }} + run: | + echo $CREDS > mifospay-android/firebaseAppDistributionServiceCredentialsFile.json \ No newline at end of file diff --git a/.github/mockFirebaseAppDistributionServiceCredentialsFile.json b/.github/mockFirebaseAppDistributionServiceCredentialsFile.json new file mode 100644 index 000000000..9102dc082 --- /dev/null +++ b/.github/mockFirebaseAppDistributionServiceCredentialsFile.json @@ -0,0 +1,13 @@ +{ + "type": "service_account", + "project_id": "mifoswallet-baa0c", + "private_key_id": "private_key_id", + "private_key": "private_key", + "client_email": "client_email", + "client_id": "111380693391682832489", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-w3hi9%40mifoswallet-baa0c.iam.gserviceaccount.com", + "universe_domain": "googleapis.com" +} diff --git a/.github/workflows/internal_or_beta_release.yml b/.github/workflows/internal_or_beta_release.yml index 19efb8b9f..2fcf1da91 100644 --- a/.github/workflows/internal_or_beta_release.yml +++ b/.github/workflows/internal_or_beta_release.yml @@ -42,7 +42,7 @@ jobs: run: ./gradlew packageReleaseDistributionForCurrentOS app_build: - name: Github, Firebase, and Sentry Release + name: Github, Firebase Release needs: [ build_desktop_app ] runs-on: ubuntu-latest permissions: @@ -76,6 +76,7 @@ jobs: keystore: ${{ secrets.ORIGINAL_KEYSTORE_FILE }} google-services: ${{ secrets.GOOGLESERVICES }} playstore-creds: ${{ secrets.PLAYSTORECREDS }} + firebase-creds: ${{ secrets.FIREBASECREDS }} - uses: ./.github/actions/create-release-notes name: Create Release Notes @@ -121,6 +122,15 @@ jobs: ./mifospay-desktop/build/compose/binaries/main-release/msi/*.msi ./mifospay-desktop/build/compose/binaries/main-release/deb/*.deb ./mifospay-desktop/build/compose/binaries/main-release/dmg/*.dmg + + + - name: ☁️ Deploy to Firebase + env: + KEYSTORE_PASSWORD: ${{ secrets.ORIGINAL_KEYSTORE_FILE_PASSWORD }} + KEYSTORE_ALIAS: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS }} + KEYSTORE_ALIAS_PASSWORD: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS_PASSWORD }} + VERSION_CODE: ${{ steps.rel_number.outputs.version-code }} + run: ./gradlew appDistributionUploadProdRelease --no-configuration-cache - name: Print `git status` run: git status @@ -161,6 +171,7 @@ jobs: keystore: ${{ secrets.UPLOAD_KEYSTORE_FILE }} google-services: ${{ secrets.GOOGLESERVICES }} playstore-creds: ${{ secrets.PLAYSTORECREDS }} + firebase-creds: ${{ secrets.FIREBASECREDS }} - uses: ./.github/actions/create-release-notes name: Create Release Notes @@ -177,6 +188,12 @@ jobs: run: | ./gradlew :mifospay-android:bundleRelease + - name: Archive Build + uses: actions/upload-artifact@v4 + with: + name: release-aabs + path: ./**/*.aab + - name: Deploy to Playstore Internal run: bundle exec fastlane deploy_internal diff --git a/.github/workflows/make_site.yaml b/.github/workflows/make_site.yaml index 8e2ce42ff..199c27fdd 100644 --- a/.github/workflows/make_site.yaml +++ b/.github/workflows/make_site.yaml @@ -25,7 +25,7 @@ jobs: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest + runs-on: windows-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 @@ -46,4 +46,4 @@ jobs: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/master_dev_ci.yml b/.github/workflows/master_dev_ci.yml index cc31e1069..c60533cb0 100644 --- a/.github/workflows/master_dev_ci.yml +++ b/.github/workflows/master_dev_ci.yml @@ -64,6 +64,7 @@ jobs: + dependency_guard: needs: setup runs-on: ubuntu-latest @@ -100,32 +101,8 @@ jobs: disable_globbing: true commit_message: "🤖 Updates baselines for Dependency Guard" - tests_and_lint: - needs: setup - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: 'zulu' - java-version: 17 - - name: Run tests - run: | - ./gradlew :mifospay-android:testDemoDebug -# ./gradlew testDemoDebug :lint:test :mifospay-android:lintProdRelease :lint:lint - - name: Upload reports - if: always() - uses: actions/upload-artifact@v4 - with: - name: test-and-lint-reports - path: | - **/build/reports/lint-results-*.html - **/build/test-results/test*UnitTest/**.xml - - - build: - needs: [ checks, dependency_guard, tests_and_lint ] + needs: [ checks, dependency_guard ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -145,11 +122,11 @@ jobs: - name: Upload APKs uses: actions/upload-artifact@v4 with: - name: APKs + name: Android APKs path: '**/build/outputs/apk/**/*.apk' build_desktop_app: - needs: [ checks, dependency_guard, tests_and_lint ] + needs: [ checks, dependency_guard ] strategy: matrix: os: @@ -174,7 +151,7 @@ jobs: if: matrix.os == 'windows-latest' uses: actions/upload-artifact@v4 with: - name: Windows-App + name: Windows-Apps path: | ./mifospay-desktop/build/compose/binaries/main/exe/*.exe ./mifospay-desktop/build/compose/binaries/main/msi/*.msi @@ -183,12 +160,12 @@ jobs: if: matrix.os == 'ubuntu-latest' uses: actions/upload-artifact@v4 with: - name: Windows-App + name: Linux-App path: './mifospay-desktop/build/compose/binaries/main/deb/*.deb' - name: Upload MacOS App if: matrix.os == 'macos-latest' uses: actions/upload-artifact@v4 with: - name: Windows-App + name: MacOS-App path: './mifospay-desktop/build/compose/binaries/main/dmg/*.dmg' \ No newline at end of file diff --git a/.github/workflows/release_to_production.yml b/.github/workflows/release_to_production.yml index 347ccc4ba..c9360d923 100644 --- a/.github/workflows/release_to_production.yml +++ b/.github/workflows/release_to_production.yml @@ -26,6 +26,7 @@ jobs: keystore: ${{ secrets.ORIGINAL_KEYSTORE_FILE }} google-services: ${{ secrets.GOOGLESERVICES }} playstore-creds: ${{ secrets.PLAYSTORECREDS }} + firebase-creds: ${{ secrets.FIREBASECREDS }} - name: Promote Beta to Production Play Store run: bundle exec fastlane promote_to_production diff --git a/.github/workflows/weekly.yaml b/.github/workflows/weekly.yaml index 992cd0011..e6ff7e291 100644 --- a/.github/workflows/weekly.yaml +++ b/.github/workflows/weekly.yaml @@ -21,7 +21,7 @@ jobs: - name: Tag Weekly Release env: - GITHUB_TOKEN: ${{ secrets.TAG_PUSH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: ./gradlew :reckonTagPush -Preckon.stage=final - name: Trigger Workflow diff --git a/build.gradle.kts b/build.gradle.kts index 84a0026c2..c30d5aa33 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,6 +16,7 @@ plugins { alias(libs.plugins.kotlin.parcelize) apply false alias(libs.plugins.dependencyGuard) apply false alias(libs.plugins.firebase.crashlytics) apply false + alias(libs.plugins.firebase.appdistribution) apply false alias(libs.plugins.firebase.perf) apply false alias(libs.plugins.gms) apply false alias(libs.plugins.ksp) apply false diff --git a/core/data/build.gradle.kts b/core/data/build.gradle.kts index 23a406caa..4a9444f8b 100644 --- a/core/data/build.gradle.kts +++ b/core/data/build.gradle.kts @@ -34,11 +34,6 @@ kotlin { implementation(libs.kotlinx.serialization.json) } - commonTest.dependencies { - implementation(libs.multiplatform.settings) - implementation(libs.multiplatform.settings.test) - } - androidMain.dependencies { implementation(libs.androidx.core.ktx) implementation(libs.androidx.tracing.ktx) diff --git a/core/datastore-proto/.gitignore b/core/datastore-proto/.gitignore deleted file mode 100644 index 42afabfd2..000000000 --- a/core/datastore-proto/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/core/datastore-proto/README.md b/core/datastore-proto/README.md deleted file mode 100644 index 19ed58239..000000000 --- a/core/datastore-proto/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# :core:datastore-proto module -## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_core_datastore_proto.svg) diff --git a/core/datastore-proto/build.gradle.kts b/core/datastore-proto/build.gradle.kts deleted file mode 100644 index 51683868e..000000000 --- a/core/datastore-proto/build.gradle.kts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2024 Mifos Initiative - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md - */ -plugins { - alias(libs.plugins.mifospay.kmp.library) - alias(libs.plugins.protobuf) - id("kotlinx-serialization") -} - -android { - namespace = "org.mifos.mobilewallet.mifospay.core.datastore.proto" -} - -// Setup protobuf configuration, generating lite Java and Kotlin classes -protobuf { - protoc { - artifact = libs.protobuf.protoc.get().toString() - } - generateProtoTasks { - all().forEach { task -> - task.builtins { - register("kotlin") { - option("lite") - } - } - } - } -} - -kotlin { - sourceSets { - commonMain.dependencies { - api(libs.protobuf.kotlin.lite) - implementation(libs.kotlinx.serialization.core) - } - } -} \ No newline at end of file diff --git a/core/datastore-proto/src/commonMain/kotlin/proto/org/mifospay/core/datastore/proto/client_info.proto b/core/datastore-proto/src/commonMain/kotlin/proto/org/mifospay/core/datastore/proto/client_info.proto deleted file mode 100644 index f845e980c..000000000 --- a/core/datastore-proto/src/commonMain/kotlin/proto/org/mifospay/core/datastore/proto/client_info.proto +++ /dev/null @@ -1,13 +0,0 @@ -syntax = "proto3"; - -option java_package = "org.mifospay.core.datastore.proto"; -option java_multiple_files = true; - -message Client { - string name = 1; - string image = 2; - string external_id = 3; - int64 client_id = 4; - string display_name = 5; - string mobile_no = 6; -} \ No newline at end of file diff --git a/core/datastore-proto/src/commonMain/kotlin/proto/org/mifospay/core/datastore/proto/role_info.proto b/core/datastore-proto/src/commonMain/kotlin/proto/org/mifospay/core/datastore/proto/role_info.proto deleted file mode 100644 index b9756aa52..000000000 --- a/core/datastore-proto/src/commonMain/kotlin/proto/org/mifospay/core/datastore/proto/role_info.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto3"; - -option java_package = "org.mifospay.core.datastore.proto"; -option java_multiple_files = true; - -message Role { - string id = 1; - string name = 2; - string description = 3; - bool disabled = 4; -} \ No newline at end of file diff --git a/core/datastore-proto/src/commonMain/kotlin/proto/org/mifospay/core/datastore/proto/user_info.proto b/core/datastore-proto/src/commonMain/kotlin/proto/org/mifospay/core/datastore/proto/user_info.proto deleted file mode 100644 index 9d38f3d91..000000000 --- a/core/datastore-proto/src/commonMain/kotlin/proto/org/mifospay/core/datastore/proto/user_info.proto +++ /dev/null @@ -1,20 +0,0 @@ -syntax = "proto3"; - -import "proto/org/mifospay/core/datastore/proto/role_info.proto"; - -option java_package = "org.mifospay.core.datastore.proto"; -option java_multiple_files = true; - -message User { - string username = 1; - int64 userId = 2; - string base64EncodedAuthenticationKey = 3; - bool authenticated = 4; - int32 officeId = 5; - string officeName = 6; - repeated Role roles = 7; - repeated string permissions = 8; - repeated int64 clients = 9; - bool shouldRenewPassword = 10; - bool isTwoFactorAuthenticationRequired = 11; -} \ No newline at end of file diff --git a/core/datastore/build.gradle.kts b/core/datastore/build.gradle.kts index 154a4d55b..260a9a00f 100644 --- a/core/datastore/build.gradle.kts +++ b/core/datastore/build.gradle.kts @@ -9,6 +9,7 @@ */ plugins { alias(libs.plugins.mifospay.kmp.library) + id("kotlinx-serialization") } android { @@ -33,7 +34,6 @@ kotlin { implementation(libs.kotlinx.serialization.core) implementation(projects.core.model) implementation(projects.core.common) - implementation(projects.core.datastoreProto) } commonTest.dependencies { diff --git a/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/PreferencesMapper.kt b/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/PreferencesMapper.kt index 4825e32fc..856c08b04 100644 --- a/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/PreferencesMapper.kt +++ b/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/PreferencesMapper.kt @@ -9,9 +9,9 @@ */ package org.mifospay.core.datastore -import org.mifospay.core.datastore.proto.ClientPreferences -import org.mifospay.core.datastore.proto.RolePreferences -import org.mifospay.core.datastore.proto.UserInfoPreferences +import org.mifospay.core.datastore.model.ClientPreferences +import org.mifospay.core.datastore.model.RolePreferences +import org.mifospay.core.datastore.model.UserInfoPreferences import org.mifospay.core.model.client.Client import org.mifospay.core.model.user.RoleInfo import org.mifospay.core.model.user.UserInfo diff --git a/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/UserPreferencesDataSource.kt b/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/UserPreferencesDataSource.kt index 2c8b7a2ad..004a4288d 100644 --- a/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/UserPreferencesDataSource.kt +++ b/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/UserPreferencesDataSource.kt @@ -22,8 +22,8 @@ import kotlinx.coroutines.flow.map import kotlinx.coroutines.withContext import kotlinx.serialization.ExperimentalSerializationApi import org.mifospay.core.datastore.UserPreferencesDataSource.Companion.DEFAULT_ACCOUNT -import org.mifospay.core.datastore.proto.ClientPreferences -import org.mifospay.core.datastore.proto.UserInfoPreferences +import org.mifospay.core.datastore.model.ClientPreferences +import org.mifospay.core.datastore.model.UserInfoPreferences import org.mifospay.core.model.account.DefaultAccount import org.mifospay.core.model.client.Client import org.mifospay.core.model.client.UpdatedClient diff --git a/core/datastore-proto/src/commonMain/kotlin/org/mifospay/core/datastore/proto/ClientPreferences.kt b/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/model/ClientPreferences.kt similarity index 97% rename from core/datastore-proto/src/commonMain/kotlin/org/mifospay/core/datastore/proto/ClientPreferences.kt rename to core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/model/ClientPreferences.kt index 1bc5477f4..46fc7d75d 100644 --- a/core/datastore-proto/src/commonMain/kotlin/org/mifospay/core/datastore/proto/ClientPreferences.kt +++ b/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/model/ClientPreferences.kt @@ -7,7 +7,7 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package org.mifospay.core.datastore.proto +package org.mifospay.core.datastore.model import kotlinx.serialization.Serializable diff --git a/core/datastore-proto/src/commonMain/kotlin/org/mifospay/core/datastore/proto/RolePreferences.kt b/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/model/RolePreferences.kt similarity index 94% rename from core/datastore-proto/src/commonMain/kotlin/org/mifospay/core/datastore/proto/RolePreferences.kt rename to core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/model/RolePreferences.kt index 17269b376..04389643b 100644 --- a/core/datastore-proto/src/commonMain/kotlin/org/mifospay/core/datastore/proto/RolePreferences.kt +++ b/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/model/RolePreferences.kt @@ -7,7 +7,7 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package org.mifospay.core.datastore.proto +package org.mifospay.core.datastore.model import kotlinx.serialization.Serializable diff --git a/core/datastore-proto/src/commonMain/kotlin/org/mifospay/core/datastore/proto/UserInfoPreferences.kt b/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/model/UserInfoPreferences.kt similarity index 96% rename from core/datastore-proto/src/commonMain/kotlin/org/mifospay/core/datastore/proto/UserInfoPreferences.kt rename to core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/model/UserInfoPreferences.kt index 32ab5c4a4..a3268f5fc 100644 --- a/core/datastore-proto/src/commonMain/kotlin/org/mifospay/core/datastore/proto/UserInfoPreferences.kt +++ b/core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/model/UserInfoPreferences.kt @@ -7,7 +7,7 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package org.mifospay.core.datastore.proto +package org.mifospay.core.datastore.model import kotlinx.serialization.Serializable diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 88a3b49e7..ba67c9623 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -68,6 +68,7 @@ fineractSdk = "1.0.3" firebaseBom = "33.6.0" firebaseCrashlyticsPlugin = "3.0.2" firebasePerfPlugin = "1.4.2" +firebaseAppdistributionGradle = "5.0.0" # Kotlin KMP Dependencies kotlin = "2.0.21" @@ -109,6 +110,11 @@ composeNavigation = "2.8.0-alpha10" jbCoreBundle = "1.0.1" jbSavedState = "1.2.2" +# Desktop Version +packageName = "MifosWallet" +packageNamespace = "org.mifospay.desktop" +packageVersion = "1.0.0" + [libraries] accompanist-pager = { group = "com.google.accompanist", name = "accompanist-pager", version.ref = "accompanist" } accompanist-permissions = { module = "com.google.accompanist:accompanist-permissions", version.ref = "accompanist" } @@ -348,6 +354,7 @@ mifos-spotless-plugin = { id = "mifos.spotless.plugin", version = "unspecified" firebase-crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "firebaseCrashlyticsPlugin" } firebase-perf = { id = "com.google.firebase.firebase-perf", version.ref = "firebasePerfPlugin" } +firebase-appdistribution = { id = "com.google.firebase.appdistribution", version.ref = "firebaseAppdistributionGradle" } protobuf = { id = "com.google.protobuf", version.ref = "protobufPlugin" } roborazzi = { id = "io.github.takahirom.roborazzi", version.ref = "roborazzi" } diff --git a/mifospay-android/build.gradle.kts b/mifospay-android/build.gradle.kts index 106ff7daf..f7f54b297 100644 --- a/mifospay-android/build.gradle.kts +++ b/mifospay-android/build.gradle.kts @@ -7,6 +7,7 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ +import com.google.gms.googleservices.GoogleServicesPlugin.GoogleServicesPluginConfig import org.mifospay.MifosBuildType import org.mifospay.dynamicVersion @@ -27,13 +28,15 @@ plugins { alias(libs.plugins.roborazzi) id("com.google.android.gms.oss-licenses-plugin") id("com.google.devtools.ksp") + id("com.google.gms.google-services") + alias(libs.plugins.firebase.appdistribution) } android { - namespace = "org.mifospay" + namespace = "org.mifospay.android" defaultConfig { - applicationId = "org.mifospay" + applicationId = "org.mifospay.android" versionName = project.dynamicVersion versionCode = System.getenv("VERSION_CODE")?.toIntOrNull() ?: 1 vectorDrawables.useSupportLibrary = true @@ -139,4 +142,15 @@ dependencyGuard { modules = true tree = true } +} + +firebaseAppDistribution { + serviceCredentialsFile = "mifospay-android/firebaseAppDistributionServiceCredentialsFile.json" + releaseNotesFile = "./mifospay-android/build/outputs/changelogBeta" + groups = "continuous-deployment" +} + +// Disable to fix memory leak and be compatible with the configuration cache. +configure { + disableVersionCheck = true } \ No newline at end of file diff --git a/mifospay-android/dependencies/prodReleaseRuntimeClasspath.tree.txt b/mifospay-android/dependencies/prodReleaseRuntimeClasspath.tree.txt index 553c93d77..bf5b8af37 100644 --- a/mifospay-android/dependencies/prodReleaseRuntimeClasspath.tree.txt +++ b/mifospay-android/dependencies/prodReleaseRuntimeClasspath.tree.txt @@ -957,16 +957,7 @@ | | | | | +--- org.jetbrains.kotlin:kotlin-stdlib:2.0.20 -> 2.0.21 (*) | | | | | \--- org.jetbrains.kotlinx:kotlinx-serialization-core:1.7.3 (*) | | | | \--- org.jetbrains.kotlin:kotlin-parcelize-runtime:2.0.21 (*) -| | | +--- project :core:common (*) -| | | \--- project :core:datastore-proto -| | | +--- com.google.protobuf:protobuf-kotlin-lite:4.26.0 -| | | | +--- com.google.protobuf:protobuf-javalite:4.26.0 -| | | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.6.0 -> 2.0.21 (*) -| | | +--- org.jetbrains.kotlin:kotlin-stdlib:2.0.21 (*) -| | | +--- io.insert-koin:koin-bom:4.0.0 (*) -| | | +--- io.insert-koin:koin-core:4.0.0 (*) -| | | +--- io.insert-koin:koin-annotations:1.4.0-RC4 (*) -| | | \--- org.jetbrains.kotlinx:kotlinx-serialization-core:1.7.3 (*) +| | | \--- project :core:common (*) | | +--- project :core:model (*) | | +--- org.jetbrains.kotlin:kotlin-stdlib:2.0.21 (*) | | +--- io.insert-koin:koin-bom:4.0.0 (*) @@ -1679,7 +1670,9 @@ | | +--- io.insert-koin:koin-androidx-compose:4.0.0 (*) | | +--- io.insert-koin:koin-androidx-navigation:4.0.0 (*) | | +--- io.insert-koin:koin-core-viewmodel:4.0.0 (*) -| | +--- com.google.protobuf:protobuf-kotlin-lite:4.26.0 (*) +| | +--- com.google.protobuf:protobuf-kotlin-lite:4.26.0 +| | | +--- com.google.protobuf:protobuf-javalite:4.26.0 +| | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.6.0 -> 2.0.21 (*) | | +--- io.insert-koin:koin-core:4.0.0 (*) | | +--- io.insert-koin:koin-annotations:1.4.0-RC4 (*) | | +--- project :core:ui (*) diff --git a/mifospay-android/dependencies/prodReleaseRuntimeClasspath.txt b/mifospay-android/dependencies/prodReleaseRuntimeClasspath.txt index 39e629960..53d3bfa6e 100644 --- a/mifospay-android/dependencies/prodReleaseRuntimeClasspath.txt +++ b/mifospay-android/dependencies/prodReleaseRuntimeClasspath.txt @@ -2,7 +2,6 @@ :core:common :core:data :core:datastore -:core:datastore-proto :core:designsystem :core:domain :core:model diff --git a/mifospay-android/google-services.json b/mifospay-android/google-services.json index 9a4001bd2..0aaf19f25 100644 --- a/mifospay-android/google-services.json +++ b/mifospay-android/google-services.json @@ -1,123 +1,83 @@ { "project_info": { - "project_number": "728434912738", - "project_id": "mifos-mobile-apps", - "storage_bucket": "mifos-mobile-apps.appspot.com" + "project_number": "581746068392", + "project_id": "mifos-wallet", + "storage_bucket": "mifos-wallet.firebasestorage.app" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:728434912738:android:49282a75468730891a1dbb", + "mobilesdk_app_id": "1:581746068392:android:923dc7e0ae51eab358ab9d", "android_client_info": { - "package_name": "org.mifospay" + "package_name": "org.mifospay.android" } }, - "oauth_client": [ - { - "client_id": "728434912738-4sc51o624viccn8oi14f2mi77tljrdns.apps.googleusercontent.com", - "client_type": 3 - } - ], + "oauth_client": [], "api_key": [ { - "current_key": "AIzaSyCUz3P8uUExMFcPHa1Ga3DBKhjK5zxNn70" + "current_key": "AIzaSyD-ak7NSId25dSXr4cvgj7YVKh0f_4LhG0" } ], "services": { "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "728434912738-4sc51o624viccn8oi14f2mi77tljrdns.apps.googleusercontent.com", - "client_type": 3 - } - ] + "other_platform_oauth_client": [] } } }, { "client_info": { - "mobilesdk_app_id": "1:728434912738:android:ef7156e455c6a1a41a1dbb", + "mobilesdk_app_id": "1:581746068392:android:923dc7e0ae51eab358ab9d", "android_client_info": { - "package_name": "org.mifospay.demo.debug" + "package_name": "org.mifospay.android.demo.debug" } }, - "oauth_client": [ - { - "client_id": "728434912738-4sc51o624viccn8oi14f2mi77tljrdns.apps.googleusercontent.com", - "client_type": 3 - } - ], + "oauth_client": [], "api_key": [ { - "current_key": "AIzaSyCUz3P8uUExMFcPHa1Ga3DBKhjK5zxNn70" + "current_key": "AIzaSyD-ak7NSId25dSXr4cvgj7YVKh0f_4LhG0" } ], "services": { "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "728434912738-4sc51o624viccn8oi14f2mi77tljrdns.apps.googleusercontent.com", - "client_type": 3 - } - ] + "other_platform_oauth_client": [] } } }, { "client_info": { - "mobilesdk_app_id": "1:728434912738:android:0490c291986f0a691a1dbb", + "mobilesdk_app_id": "1:581746068392:android:923dc7e0ae51eab358ab9d", "android_client_info": { - "package_name": "org.mifospay.debug" + "package_name": "org.mifospay.android.debug" } }, - "oauth_client": [ - { - "client_id": "728434912738-4sc51o624viccn8oi14f2mi77tljrdns.apps.googleusercontent.com", - "client_type": 3 - } - ], + "oauth_client": [], "api_key": [ { - "current_key": "AIzaSyCUz3P8uUExMFcPHa1Ga3DBKhjK5zxNn70" + "current_key": "AIzaSyD-ak7NSId25dSXr4cvgj7YVKh0f_4LhG0" } ], "services": { "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "728434912738-4sc51o624viccn8oi14f2mi77tljrdns.apps.googleusercontent.com", - "client_type": 3 - } - ] + "other_platform_oauth_client": [] } } }, { "client_info": { - "mobilesdk_app_id": "1:728434912738:android:48ccd9153349f31e1a1dbb", + "mobilesdk_app_id": "1:581746068392:android:923dc7e0ae51eab358ab9d", "android_client_info": { - "package_name": "org.mifospay.demo" + "package_name": "org.mifospay.android.demo" } }, - "oauth_client": [ - { - "client_id": "728434912738-4sc51o624viccn8oi14f2mi77tljrdns.apps.googleusercontent.com", - "client_type": 3 - } - ], + "oauth_client": [], "api_key": [ { - "current_key": "AIzaSyCUz3P8uUExMFcPHa1Ga3DBKhjK5zxNn70" + "current_key": "AIzaSyD-ak7NSId25dSXr4cvgj7YVKh0f_4LhG0" } ], "services": { "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "728434912738-4sc51o624viccn8oi14f2mi77tljrdns.apps.googleusercontent.com", - "client_type": 3 - } - ] + "other_platform_oauth_client": [] } } } diff --git a/mifospay-android/prodRelease-badging.txt b/mifospay-android/prodRelease-badging.txt index fbaccbcfc..6bb39e10d 100644 --- a/mifospay-android/prodRelease-badging.txt +++ b/mifospay-android/prodRelease-badging.txt @@ -1,4 +1,4 @@ -package: name='org.mifospay' versionCode='1' versionName='0.0.4-beta.0.57' platformBuildVersionName='15' platformBuildVersionCode='35' compileSdkVersion='35' compileSdkVersionCodename='15' +package: name='org.mifospay.android' versionCode='1' versionName='0.0.4-beta.0.62' platformBuildVersionName='15' platformBuildVersionCode='35' compileSdkVersion='35' compileSdkVersionCodename='15' sdkVersion:'26' targetSdkVersion:'34' uses-permission: name='android.permission.INTERNET' @@ -13,7 +13,7 @@ uses-permission: name='android.permission.WAKE_LOCK' uses-permission: name='com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE' uses-permission: name='android.permission.ACCESS_ADSERVICES_ATTRIBUTION' uses-permission: name='android.permission.ACCESS_ADSERVICES_AD_ID' -uses-permission: name='org.mifospay.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION' +uses-permission: name='org.mifospay.android.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION' application-label:'Mifos Pay' application-label-af:'Mifos Pay' application-label-am:'Mifos Pay' @@ -106,7 +106,7 @@ application-icon-320:'res/mipmap/ic_launcher.png' application-icon-480:'res/mipmap/ic_launcher.png' application-icon-640:'res/mipmap/ic_launcher.png' application: label='Mifos Pay' icon='res/mipmap/ic_launcher.png' -launchable-activity: name='org.mifospay.MainActivity' label='' icon='' +launchable-activity: name='org.mifospay.android.MainActivity' label='' icon='' property: name='android.adservices.AD_SERVICES_CONFIG' resource='res/xml/ga_ad_services_config.xml' uses-library-not-required:'androidx.window.extensions' uses-library-not-required:'androidx.window.sidecar' diff --git a/mifospay-android/src/androidTest/java/org/mifospay/ExampleInstrumentedTest.kt b/mifospay-android/src/androidTest/java/org/mifospay/ExampleInstrumentedTest.kt deleted file mode 100644 index 504fdba19..000000000 --- a/mifospay-android/src/androidTest/java/org/mifospay/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2024 Mifos Initiative - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md - */ -package org.mifospay - -import androidx.test.ext.junit.runners.AndroidJUnit4 -import androidx.test.platform.app.InstrumentationRegistry -import org.junit.Assert -import org.junit.Test -import org.junit.runner.RunWith - -/** - * Instrumentation test, which will execute on an Android device. - * - * @see [Testing documentation](http://d.android.com/tools/testing) - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - @Throws(Exception::class) - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().context - Assert.assertEquals("org.mifospay", appContext.packageName) - } -} diff --git a/mifospay-android/src/main/kotlin/org/mifospay/MainActivity.kt b/mifospay-android/src/main/kotlin/org/mifospay/android/MainActivity.kt similarity index 98% rename from mifospay-android/src/main/kotlin/org/mifospay/MainActivity.kt rename to mifospay-android/src/main/kotlin/org/mifospay/android/MainActivity.kt index ea83ed32d..5275e033f 100644 --- a/mifospay-android/src/main/kotlin/org/mifospay/MainActivity.kt +++ b/mifospay-android/src/main/kotlin/org/mifospay/android/MainActivity.kt @@ -7,7 +7,7 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package org.mifospay +package org.mifospay.android import android.os.Bundle import androidx.activity.ComponentActivity diff --git a/mifospay-android/src/main/kotlin/org/mifospay/MifosPayApp.kt b/mifospay-android/src/main/kotlin/org/mifospay/android/MifosPayApp.kt similarity index 96% rename from mifospay-android/src/main/kotlin/org/mifospay/MifosPayApp.kt rename to mifospay-android/src/main/kotlin/org/mifospay/android/MifosPayApp.kt index de10c0aba..a85752977 100644 --- a/mifospay-android/src/main/kotlin/org/mifospay/MifosPayApp.kt +++ b/mifospay-android/src/main/kotlin/org/mifospay/android/MifosPayApp.kt @@ -7,7 +7,7 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package org.mifospay +package org.mifospay.android import android.app.Application import org.koin.android.ext.koin.androidContext diff --git a/mifospay-desktop/build.gradle.kts b/mifospay-desktop/build.gradle.kts index 054d165cb..6d3a0ca89 100644 --- a/mifospay-desktop/build.gradle.kts +++ b/mifospay-desktop/build.gradle.kts @@ -42,39 +42,17 @@ kotlin { } } -fun String.formatToValidVersion(): String { - // Remove any text after '-' or '+' - val cleanVersion = this.split(Regex("[-+]")).first() - - // Split version numbers - val parts = cleanVersion.split(".") - - return when { - // If starts with 0, change to 1 - parts[0] == "0" -> { - val newParts = parts.toMutableList() - newParts[0] = "1" - // Take only up to 3 parts (MAJOR.MINOR.PATCH) - newParts.take(3).joinToString(".") - } - // If valid, take only up to 3 parts - else -> parts.take(3).joinToString(".") - } -} - -val Project.dynamicVersion - get() = project.version.toString().formatToValidVersion() - -val productName = "MifosWallet" -val productNameSpace = "org.mifos.pay" +val packageName: String = libs.versions.packageName.get() +val packageNameSpace: String = libs.versions.packageNamespace.get() +val packageVersion: String = libs.versions.packageVersion.get() compose.desktop { application { mainClass = "MainKt" nativeDistributions { targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Exe, TargetFormat.Deb) - packageName = productName - packageVersion = project.dynamicVersion + packageName = this@Build_gradle.packageName + packageVersion = this@Build_gradle.packageVersion description = "Mifos Wallet Desktop Application" copyright = "© 2024 Mifos Initiative. All rights reserved." vendor = "Mifos Initiative" @@ -82,8 +60,8 @@ compose.desktop { includeAllModules = true macOS { - bundleID = productNameSpace - dockName = productName + bundleID = packageNameSpace + dockName = this@Build_gradle.packageName iconFile.set(project.file("icons/ic_launcher.icns")) notarization { val providers = project.providers @@ -94,7 +72,7 @@ compose.desktop { } windows { - menuGroup = productName + menuGroup = this@Build_gradle.packageName shortcut = true dirChooser = true perUserInstall = true diff --git a/mifospay-web/build.gradle.kts b/mifospay-web/build.gradle.kts index 46bc4de05..6e4db8a68 100644 --- a/mifospay-web/build.gradle.kts +++ b/mifospay-web/build.gradle.kts @@ -1,5 +1,4 @@ import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl -import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig plugins { alias(libs.plugins.kotlinMultiplatform) @@ -21,19 +20,9 @@ kotlin { @OptIn(ExperimentalWasmDsl::class) wasmJs { moduleName = "mifospay-wasm" - val projectPath: String = project.rootDir.path browser { commonWebpackConfig { outputFileName = "mifospay-wasm.js" - devServer = (devServer ?: KotlinWebpackConfig.DevServer()).apply { - static = (static ?: mutableListOf()).apply { - add(projectPath) - add("$projectPath/mifospay-shared/") - add("$projectPath/mifospay-web/") - add("$projectPath/core/designsystem") - add("$projectPath/core/ui") - } - } } } binaries.executable() @@ -46,11 +35,20 @@ kotlin { dependsOn(commonMain.get()) dependencies { implementation(projects.mifospayShared) + implementation(projects.core.common) + implementation(projects.core.data) + implementation(projects.core.model) + implementation(projects.core.datastore) + implementation(compose.runtime) implementation(compose.ui) implementation(compose.foundation) implementation(compose.material3) implementation(compose.components.resources) + + implementation(libs.multiplatform.settings) + implementation(libs.multiplatform.settings.serialization) + implementation(libs.multiplatform.settings.coroutines) } } diff --git a/mifospay-web/src/jsMain/kotlin/Application.kt b/mifospay-web/src/jsMain/kotlin/Application.kt index a3d5d4954..38556bb99 100644 --- a/mifospay-web/src/jsMain/kotlin/Application.kt +++ b/mifospay-web/src/jsMain/kotlin/Application.kt @@ -2,6 +2,7 @@ import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.window.ComposeViewport import kotlinx.browser.document +import org.jetbrains.skiko.wasm.onWasmReady import org.mifospay.shared.MifosPaySharedApp import org.mifospay.shared.di.initKoin @@ -9,7 +10,9 @@ import org.mifospay.shared.di.initKoin fun main() { initKoin() - ComposeViewport(document.body!!) { - MifosPaySharedApp() + onWasmReady { + ComposeViewport(document.body!!) { + MifosPaySharedApp() + } } } \ No newline at end of file diff --git a/mifospay-web/src/jsMain/resources/favicon.ico b/mifospay-web/src/jsMain/resources/favicon.ico new file mode 100644 index 000000000..09036b594 Binary files /dev/null and b/mifospay-web/src/jsMain/resources/favicon.ico differ diff --git a/mifospay-web/src/jsMain/resources/index.html b/mifospay-web/src/jsMain/resources/index.html index 5df6be6fb..b7c4c1732 100644 --- a/mifospay-web/src/jsMain/resources/index.html +++ b/mifospay-web/src/jsMain/resources/index.html @@ -3,8 +3,36 @@ Mifos Wallet - + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/mifospay-web/src/wasmJsMain/resources/favicon.ico b/mifospay-web/src/wasmJsMain/resources/favicon.ico new file mode 100644 index 000000000..09036b594 Binary files /dev/null and b/mifospay-web/src/wasmJsMain/resources/favicon.ico differ diff --git a/settings.gradle.kts b/settings.gradle.kts index 19df9d5f1..01128d4d5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -49,7 +49,6 @@ include(":core:common") include(":core:network") include(":core:network") include(":core:model") -include(":core:datastore-proto") include(":core:analytics") include(":feature:home")