Skip to content

Commit

Permalink
migrating from hilt to koin clean up commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Nagarjuna0033 committed Sep 22, 2024
1 parent bfc82f0 commit bb63058
Show file tree
Hide file tree
Showing 30 changed files with 502 additions and 395 deletions.
8 changes: 4 additions & 4 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class AndroidKoinConventionPlugin : Plugin<Project> {
arg("USE_COMPOSE_VIEWMODEL", "false")
arg("KOIN_USE_COMPOSE_VIEWMODEL", "true")
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ buildscript {
classpath(libs.google.oss.licenses.plugin) {
exclude(group = "com.google.protobuf")
}

}

}

plugins {
Expand Down
12 changes: 12 additions & 0 deletions core/analytics/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions core/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/
plugins {
alias(libs.plugins.mifospay.android.library)
id("com.google.devtools.ksp")
}

android {
Expand All @@ -18,4 +19,5 @@ android {
dependencies {
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.coroutines.android)

}
1 change: 1 addition & 0 deletions core/data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ dependencies {

implementation(libs.kotlinx.serialization.json)
implementation(libs.koin.android)

}
Original file line number Diff line number Diff line change
Expand Up @@ -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>?

Expand Down
1 change: 1 addition & 0 deletions core/datastore/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*
* See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md
*/

plugins {
alias(libs.plugins.mifospay.android.library)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 6 additions & 0 deletions core/network/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
plugins {
alias(libs.plugins.mifospay.android.library)
id("kotlinx-serialization")
id("mifospay.android.koin")

}

android {
Expand Down Expand Up @@ -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)
}
7 changes: 7 additions & 0 deletions feature/accounts/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
plugins {
alias(libs.plugins.mifospay.android.feature)
alias(libs.plugins.mifospay.android.library.compose)

}

android {
Expand All @@ -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)

}
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down
3 changes: 3 additions & 0 deletions feature/auth/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
plugins {
alias(libs.plugins.mifospay.android.feature)
alias(libs.plugins.mifospay.android.library.compose)


}

android {
Expand All @@ -30,4 +32,5 @@ dependencies {
implementation(libs.googleid)

implementation(libs.play.services.auth)

}
11 changes: 10 additions & 1 deletion feature/editpassword/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

}
8 changes: 8 additions & 0 deletions feature/history/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)


}
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ val HistoryModule = module {
viewModel {
TransactionDetailViewModel(mUseCaseHandler = get(), mFetchAccountTransferUseCase = get())
}
}
}
10 changes: 9 additions & 1 deletion feature/invoices/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

}
1 change: 1 addition & 0 deletions feature/kyc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ dependencies {

// TODO:: this should be removed
implementation(libs.squareup.okhttp)

}
5 changes: 4 additions & 1 deletion feature/make-transfer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ android {
namespace = "org.mifospay.feature.make.transfer"
}

dependencies { }
dependencies {
implementation(projects.core.data)

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ val NotificationModule = module {
fetchNotificationsUseCase = get(),
)
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ val ProfileModule = module {
updateClientUseCase = get(),
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ val SavedCardsModule = module {
deleteCardUseCase = get(),
)
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -36,7 +37,8 @@ val StandingInstructionModule = module {
viewModel {
StandingInstructionDetailsViewModel(
mUseCaseHandler = get(),
fetchStandingInstruction = get(),
fetchStandingInstruction =
get(),
updateStandingInstruction = get(),
deleteStandingInstruction = get(),
savedStateHandle = get(),
Expand Down
23 changes: 16 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ internal class ValidatePhoneNumber(private val context: Context) {
} else {
false
}

}
2 changes: 1 addition & 1 deletion libs/mifos-passcode/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions lint/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*
* See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md
*/

import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
Expand All @@ -26,6 +27,7 @@ kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_11
}

}

dependencies {
Expand Down
Loading

0 comments on commit bb63058

Please sign in to comment.