migrating from hilt to koin clean up commit

This commit is contained in:
Nagarjuna0033 2024-09-22 15:32:50 +05:30
parent bfc82f08fd
commit bb63058e49
30 changed files with 502 additions and 395 deletions

View File

@ -51,6 +51,10 @@ gradlePlugin {
id = "mifospay.android.application"
implementationClass = "AndroidApplicationConventionPlugin"
}
register("koin"){
id = "mifospay.android.koin"
implementationClass = "AndroidKoinConventionPlugin"
}
register("androidLibraryCompose") {
id = "mifospay.android.library.compose"
implementationClass = "AndroidLibraryComposeConventionPlugin"
@ -87,10 +91,6 @@ gradlePlugin {
id = "mifospay.android.application.flavors"
implementationClass = "AndroidApplicationFlavorsConventionPlugin"
}
register("androidKoin") {
id = "mifospay.android.koin"
implementationClass = "AndroidKoinConventionPlugin"
}
register("detekt") {
id = "mifos.detekt.plugin"
implementationClass = "MifosDetektConventionPlugin"

View File

@ -31,6 +31,7 @@ class AndroidKoinConventionPlugin : Plugin<Project> {
arg("USE_COMPOSE_VIEWMODEL", "false")
arg("KOIN_USE_COMPOSE_VIEWMODEL", "true")
}
}
}
}

View File

@ -8,6 +8,7 @@ import org.gradle.kotlin.dsl.named
internal fun Project.configureDetekt(extension: DetektExtension) = extension.apply {
tasks.named<Detekt>("detekt") {
jvmTarget = "17"
reports {
xml.required.set(true)
html.required.set(true)

View File

@ -4,7 +4,9 @@ buildscript {
classpath(libs.google.oss.licenses.plugin) {
exclude(group = "com.google.protobuf")
}
}
}
plugins {

View File

@ -7,6 +7,18 @@
*
* See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md
*/
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
/*
* 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.android.library)
alias(libs.plugins.mifospay.android.library.compose)

View File

@ -9,6 +9,7 @@
*/
plugins {
alias(libs.plugins.mifospay.android.library)
id("com.google.devtools.ksp")
}
android {
@ -18,4 +19,5 @@ android {
dependencies {
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.coroutines.android)
}

View File

@ -45,4 +45,5 @@ dependencies {
implementation(libs.kotlinx.serialization.json)
implementation(libs.koin.android)
}

View File

@ -10,14 +10,16 @@
package org.mifospay.core.data.domain.usecase.history
import com.mifospay.core.model.domain.Transaction
import org.mifospay.core.data.base.TaskLooper
import org.mifospay.core.data.base.UseCase.UseCaseCallback
import org.mifospay.core.data.base.UseCaseFactory
import org.mifospay.core.data.base.UseCaseHandler
import org.mifospay.core.data.domain.usecase.account.FetchAccountTransactions
class TransactionsHistory(
private val mUseCaseHandler: UseCaseHandler,
private val fetchAccountTransactionsUseCase: FetchAccountTransactions,
) {
) {
var delegate: HistoryContract.TransactionsHistoryAsync? = null
private var transactions: List<Transaction>?

View File

@ -7,6 +7,7 @@
*
* See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md
*/
plugins {
alias(libs.plugins.mifospay.android.library)
}

View File

@ -17,8 +17,11 @@ import com.mifospay.core.model.domain.client.Client
import com.mifospay.core.model.domain.user.User
class PreferencesHelper(private val context: Context?) {
private val sharedPreferences: SharedPreferences =
PreferenceManager.getDefaultSharedPreferences(context)
private val sharedPreferences: SharedPreferences
init {
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
}
fun clear() {
sharedPreferences.edit().clear().apply()

View File

@ -20,6 +20,8 @@
plugins {
alias(libs.plugins.mifospay.android.library)
id("kotlinx-serialization")
id("mifospay.android.koin")
}
android {
@ -65,6 +67,10 @@ dependencies {
implementation(libs.kotlinx.serialization.json)
testImplementation(libs.kotlinx.coroutines.test)
implementation(platform(libs.koin.bom))
implementation(libs.koin.core)
implementation(libs.koin.androidx.compose)
implementation(libs.koin.androidx.navigation)
implementation(libs.koin.android)
}

View File

@ -10,6 +10,7 @@
plugins {
alias(libs.plugins.mifospay.android.feature)
alias(libs.plugins.mifospay.android.library.compose)
}
android {
@ -21,4 +22,10 @@ dependencies {
implementation(projects.libs.pullrefresh)
implementation(libs.play.services.auth)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.runtime)
implementation(libs.androidx.compose.ui.util)
}

View File

@ -11,12 +11,10 @@ package org.mifospay.feature.bank.accounts.di
import org.koin.core.module.dsl.viewModel
import org.koin.dsl.module
import org.mifospay.core.data.di.DataModule
import org.mifospay.feature.bank.accounts.AccountViewModel
import org.mifospay.feature.bank.accounts.link.LinkBankAccountViewModel
val AccountsModule = module {
includes(DataModule)
viewModel {
LinkBankAccountViewModel(localAssetRepository = get())
}

View File

@ -10,6 +10,8 @@
plugins {
alias(libs.plugins.mifospay.android.feature)
alias(libs.plugins.mifospay.android.library.compose)
}
android {
@ -30,4 +32,5 @@ dependencies {
implementation(libs.googleid)
implementation(libs.play.services.auth)
}

View File

@ -16,4 +16,13 @@ android {
namespace = "org.mifospay.feature.editpassword"
}
dependencies {}
dependencies {
implementation(projects.core.data)
implementation(libs.play.services.auth)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.runtime)
implementation(libs.androidx.compose.ui.util)
}

View File

@ -19,4 +19,12 @@ android {
dependencies {
implementation(projects.libs.pullrefresh)
implementation(libs.play.services.auth)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.runtime)
implementation(libs.androidx.compose.ui.util)
}

View File

@ -37,4 +37,4 @@ val HistoryModule = module {
viewModel {
TransactionDetailViewModel(mUseCaseHandler = get(), mFetchAccountTransferUseCase = get())
}
}
}

View File

@ -16,4 +16,12 @@ android {
namespace = "org.mifospay.invoices"
}
dependencies {}
dependencies {
implementation(projects.core.data)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.runtime)
implementation(libs.androidx.compose.ui.util)
}

View File

@ -25,4 +25,5 @@ dependencies {
// TODO:: this should be removed
implementation(libs.squareup.okhttp)
}

View File

@ -16,4 +16,7 @@ android {
namespace = "org.mifospay.feature.make.transfer"
}
dependencies { }
dependencies {
implementation(projects.core.data)
}

View File

@ -21,4 +21,5 @@ val NotificationModule = module {
fetchNotificationsUseCase = get(),
)
}
}
}

View File

@ -32,4 +32,4 @@ val ProfileModule = module {
updateClientUseCase = get(),
)
}
}
}

View File

@ -24,4 +24,5 @@ val SavedCardsModule = module {
deleteCardUseCase = get(),
)
}
}
}

View File

@ -16,6 +16,7 @@ import org.mifospay.feature.standing.instruction.StandingInstructionDetailsViewM
import org.mifospay.feature.standing.instruction.StandingInstructionViewModel
val StandingInstructionModule = module {
viewModel {
NewSIViewModel(
mUseCaseHandler = get(),
@ -36,7 +37,8 @@ val StandingInstructionModule = module {
viewModel {
StandingInstructionDetailsViewModel(
mUseCaseHandler = get(),
fetchStandingInstruction = get(),
fetchStandingInstruction =
get(),
updateStandingInstruction = get(),
deleteStandingInstruction = get(),
savedStateHandle = get(),

View File

@ -42,8 +42,15 @@ googleOssPlugin = "0.10.6"
googleidVersion = "1.1.1"
junitVersion = "4.13.2"
koin = "4.0.0-RC2"
koinAndroidxNavigationVersion = "4.0.0-RC2"
koinAnnotationsVersion = "1.4.0-RC4"
koinBomVersion = "4.0.0-RC2"
koinComposeMultiplatform = "1.2.0-Beta4"
koinCoreViewmodelVersion = "4.0.0-RC2"
koinKspCompilerVersion = "1.4.0-RC4"
koinTestJunit4Version = "4.0.0-RC2"
koinTestJunit5Version = "4.0.0-RC2"
koinTestVersion = "4.0.0-RC2"
kotlin = "2.0.20"
kotlinStdlibVersion = "1.9.0"
kotlinxCoroutines = "1.8.1"
@ -147,21 +154,23 @@ google-oss-licenses = { group = "com.google.android.gms", name = "play-services-
google-oss-licenses-plugin = { group = "com.google.android.gms", name = "oss-licenses-plugin", version.ref = "googleOssPlugin" }
google-play-services-code-scanner = { group = "com.google.android.gms", name = "play-services-code-scanner", version.ref = "playServicesCodeScanner" }
googleid = { group = "com.google.android.libraries.identity.googleid", name = "googleid", version.ref = "googleidVersion" }
insert-koin-koin-core = { group = "io.insert-koin", name = "koin-core" }
io-insert-koin-koin-core = { group = "io.insert-koin", name = "koin-core" }
jetbrains-kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlinStdlibVersion" }
junit = { group = "junit", name = "junit", version.ref = "junitVersion" }
koin-android = { group = "io.insert-koin", name = "koin-android", version.ref = "koin" }
koin-androidx-compose = { group = "io.insert-koin", name = "koin-androidx-compose", version.ref = "koin" }
koin-androidx-navigation = { group = "io.insert-koin", name = "koin-androidx-navigation", version.ref = "koin" }
koin-androidx-navigation = { group = "io.insert-koin", name = "koin-androidx-navigation", version.ref = "koinAndroidxNavigationVersion" }
koin-annotations = { group = "io.insert-koin", name = "koin-annotations", version.ref = "koinAnnotationsVersion" }
koin-bom = { group = "io.insert-koin", name = "koin-bom", version.ref = "koin" }
koin-bom = { group = "io.insert-koin", name = "koin-bom", version.ref = "koinBomVersion" }
koin-compose = { group = "io.insert-koin", name = "koin-compose", version.ref = "koinComposeMultiplatform" }
koin-compose-viewmodel = { group = "io.insert-koin", name = "koin-compose-viewmodel", version.ref = "koinComposeMultiplatform" }
koin-core = { group = "io.insert-koin", name = "koin-core", version.ref = "koin" }
koin-core-viewmodel = { group = "io.insert-koin", name = "koin-core-viewmodel", version.ref = "koin" }
koin-ksp-compiler = { group = "io.insert-koin", name = "koin-ksp-compiler", version.ref = "koinAnnotationsVersion" }
koin-test = { group = "io.insert-koin", name = "koin-test", version.ref = "koin" }
koin-test-junit4 = { group = "io.insert-koin", name = "koin-test-junit4", version.ref = "koin" }
koin-test-junit5 = { group = "io.insert-koin", name = "koin-test-junit5", version.ref = "koin" }
koin-core-viewmodel = { group = "io.insert-koin", name = "koin-core-viewmodel", version.ref = "koinCoreViewmodelVersion" }
koin-ksp-compiler = { group = "io.insert-koin", name = "koin-ksp-compiler", version.ref = "koinKspCompilerVersion" }
koin-test = { group = "io.insert-koin", name = "koin-test", version.ref = "koinTestVersion" }
koin-test-junit4 = { group = "io.insert-koin", name = "koin-test-junit4", version.ref = "koinTestJunit4Version" }
koin-test-junit5 = { group = "io.insert-koin", name = "koin-test-junit5", version.ref = "koinTestJunit5Version" }
kotlin-gradlePlugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" }
kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk8", version.ref = "kotlin" }
kotlinx-collections-immutable = { group = "org.jetbrains.kotlinx", name = "kotlinx-collections-immutable", version.ref = "kotlinxImmutable" }

View File

@ -28,4 +28,5 @@ internal class ValidatePhoneNumber(private val context: Context) {
} else {
false
}
}

View File

@ -32,7 +32,7 @@ dependencies {
implementation(libs.androidx.navigation.compose)
implementation(platform(libs.koin.bom))
implementation(libs.koin.core)
implementation(libs.io.insert.koin.koin.core)
implementation(libs.koin.android)
implementation(libs.koin.androidx.navigation)
implementation(libs.koin.androidx.compose)

View File

@ -7,6 +7,7 @@
*
* See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md
*/
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
@ -26,6 +27,7 @@ kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_11
}
}
dependencies {

File diff suppressed because it is too large Load Diff

View File

@ -15,6 +15,7 @@ dependencyResolutionManagement {
maven("https://www.jitpack.io")
maven("https://plugins.gradle.org/m2/")
}
}
plugins {
@ -42,7 +43,6 @@ include(":core:designsystem")
include(":core:ui")
include(":core:common")
include(":core:network")
include(":core:network")
include(":core:model")
include(":core:datastore-proto")
include(":core:analytics")
@ -61,7 +61,6 @@ include(":feature:editpassword")
include(":feature:kyc")
include(":feature:savedcards")
include(":feature:invoices")
include(":feature:invoices")
include(":feature:settings")
include(":feature:profile")
include(":feature:finance")