forked from openMF/mobile-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/dev' into dev
- Loading branch information
Showing
232 changed files
with
24,651 additions
and
1,616 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
build-logic/convention/src/main/kotlin/AndroidFeatureConventionPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
|
||
import com.android.build.gradle.LibraryExtension | ||
import com.google.devtools.ksp.gradle.KspExtension | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.configure | ||
import org.gradle.kotlin.dsl.dependencies | ||
import org.gradle.kotlin.dsl.kotlin | ||
import org.mifospay.libs | ||
|
||
class AndroidFeatureConventionPlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
pluginManager.apply { | ||
apply("mifospay.android.library") | ||
apply("mifospay.android.koin") | ||
} | ||
|
||
extensions.configure<LibraryExtension> { | ||
defaultConfig { | ||
// set custom test runner | ||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
testOptions.animationsDisabled = true | ||
} | ||
|
||
extensions.configure<KspExtension> { | ||
arg("KOIN_USE_COMPOSE_VIEWMODEL","true") | ||
} | ||
|
||
dependencies { | ||
add("implementation", project(":core:ui")) | ||
add("implementation", project(":core:designsystem")) | ||
add("implementation", project(":core:data")) | ||
|
||
add("implementation", project(":libs:material3-navigation")) | ||
|
||
add("implementation", libs.findLibrary("androidx.navigation.compose").get()) | ||
add("implementation", libs.findLibrary("kotlinx.collections.immutable").get()) | ||
add("implementation", libs.findLibrary("androidx.lifecycle.runtimeCompose").get()) | ||
add("implementation", libs.findLibrary("androidx.lifecycle.viewModelCompose").get()) | ||
add("implementation", libs.findLibrary("androidx.tracing.ktx").get()) | ||
|
||
add("implementation", platform(libs.findLibrary("koin-bom").get())) | ||
add("implementation", libs.findLibrary("koin-android").get()) | ||
add("implementation", libs.findLibrary("koin.androidx.compose").get()) | ||
|
||
add("implementation", libs.findLibrary("koin.android").get()) | ||
add("implementation", libs.findLibrary("koin.androidx.navigation").get()) | ||
add("implementation", libs.findLibrary("koin.androidx.compose").get()) | ||
add("implementation", libs.findLibrary("koin.core.viewmodel").get()) | ||
|
||
add("androidTestImplementation", libs.findLibrary("androidx.lifecycle.runtimeTesting").get()) | ||
|
||
add("testImplementation", kotlin("test")) | ||
|
||
add("testImplementation", libs.findLibrary("koin.test").get()) | ||
add("testImplementation", libs.findLibrary("koin.test.junit4").get()) | ||
|
||
add("debugImplementation", libs.findLibrary("androidx.compose.ui.test.manifest").get()) | ||
add("androidTestImplementation", libs.findLibrary("androidx.navigation.testing").get()) | ||
add("androidTestImplementation", libs.findLibrary("androidx.compose.ui.test").get()) | ||
} | ||
} | ||
} | ||
} |
34 changes: 19 additions & 15 deletions
34
build-logic/convention/src/main/kotlin/KMPLibraryConventionPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,48 @@ | ||
|
||
import com.android.build.api.variant.LibraryAndroidComponentsExtension | ||
import com.android.build.gradle.LibraryExtension | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.configure | ||
import org.gradle.kotlin.dsl.dependencies | ||
import org.gradle.kotlin.dsl.kotlin | ||
import org.mifospay.configureFlavors | ||
import org.mifospay.configureKotlinAndroid | ||
import org.mifospay.configureKotlinMultiplatform | ||
import org.mifospay.configurePrintApksTask | ||
import org.mifospay.disableUnnecessaryAndroidTests | ||
import org.mifospay.libs | ||
|
||
class KMPLibraryConventionPlugin: Plugin<Project> { | ||
class AndroidLibraryConventionPlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
with(pluginManager) { | ||
apply("com.android.library") | ||
apply("org.jetbrains.kotlin.multiplatform") | ||
apply("mifospay.kmp.koin") | ||
apply("org.jetbrains.kotlin.android") | ||
apply("mifospay.android.lint") | ||
apply("mifos.detekt.plugin") | ||
apply("mifos.spotless.plugin") | ||
apply("mifos.ktlint.plugin") | ||
apply("mifospay.android.koin") | ||
} | ||
|
||
configureKotlinMultiplatform() | ||
|
||
extensions.configure<LibraryExtension> { | ||
configureKotlinAndroid(this) | ||
defaultConfig.targetSdk = 34 | ||
testOptions.animationsDisabled = true | ||
configureFlavors(this) | ||
// The resource prefix is derived from the module name, | ||
// so resources inside ":core:module1" must be prefixed with "core_module1_" | ||
resourcePrefix = path | ||
.split("""\W""".toRegex()) | ||
.drop(1).distinct() | ||
.joinToString(separator = "_") | ||
.lowercase() + "_" | ||
resourcePrefix = path.split("""\W""".toRegex()).drop(1).distinct().joinToString(separator = "_").lowercase() + "_" | ||
} | ||
|
||
extensions.configure<LibraryAndroidComponentsExtension> { | ||
configurePrintApksTask(this) | ||
disableUnnecessaryAndroidTests(target) | ||
} | ||
|
||
dependencies { | ||
add("commonTestImplementation", libs.findLibrary("kotlin.test").get()) | ||
add("commonTestImplementation", libs.findLibrary("kotlinx.coroutines.test").get()) | ||
add("testImplementation", kotlin("test")) | ||
add("implementation", libs.findLibrary("androidx.tracing.ktx").get()) | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
core/analytics/src/main/kotlin/org/mifospay/core/analytics/di/AnalyticsModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* 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.core.analytics.di | ||
|
||
import com.google.firebase.analytics.ktx.analytics | ||
import com.google.firebase.ktx.Firebase | ||
import org.koin.dsl.module | ||
import org.mifospay.core.analytics.AnalyticsHelper | ||
|
||
val AnalyticsModule = module { | ||
|
||
single { | ||
Firebase.analytics | ||
} | ||
single<AnalyticsHelper> { | ||
FirebaseAnalyticsHelper(firebaseAnalytics = get()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.