Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
niyajali committed Nov 6, 2024
2 parents c3e8b07 + 6343e7d commit 09abe15
Show file tree
Hide file tree
Showing 232 changed files with 24,651 additions and 1,616 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/master_dev_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- name: Check Dependency Guard
id: dependencyguard_verify
continue-on-error: true
run: ./gradlew :mifospay-android:dependencyGuard
run: ./gradlew dependencyGuard

- name: Prevent updating Dependency Guard baselines if this is a fork
id: checkfork_dependencyguard
Expand All @@ -88,7 +88,7 @@ jobs:
id: dependencyguard_baseline
if: steps.dependencyguard_verify.outcome == 'failure' && github.event_name == 'pull_request'
run: |
./gradlew :mifospay-android:dependencyGuardBaseline
./gradlew dependencyGuardBaseline
- name: Push new Dependency Guard baselines if available
uses: stefanzweifel/git-auto-commit-action@v5
Expand All @@ -109,8 +109,7 @@ jobs:
java-version: 17
- name: Run tests
run: |
./gradlew :mifospay-android:testDemoDebug
# ./gradlew testDemoDebug :lint:test :mifospay-android:lintProdRelease :lint:lint
./gradlew testDemoDebug :lint:test :mifospay:lintProdRelease :lint:lint
- name: Upload reports
if: always()
uses: actions/upload-artifact@v4
Expand All @@ -131,12 +130,12 @@ jobs:
java-version: 17

- name: Build APKs
run: ./gradlew :mifospay-android:assembleDemoDebug
run: ./gradlew :mifospay:assembleDemoDebug

- name: Check badging
# This step is allowed to fail, as it's not critical for the build
continue-on-error: true
run: ./gradlew :mifospay-android:checkProdReleaseBadging
run: ./gradlew :mifospay:checkProdReleaseBadging

- name: Upload APKs
uses: actions/upload-artifact@v4
Expand Down
56 changes: 38 additions & 18 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ dependencies {
compileOnly(libs.android.gradlePlugin)
compileOnly(libs.android.tools.common)
compileOnly(libs.compose.gradlePlugin)
compileOnly(libs.firebase.crashlytics.gradlePlugin)
compileOnly(libs.firebase.performance.gradlePlugin)
compileOnly(libs.kotlin.gradlePlugin)
compileOnly(libs.ksp.gradlePlugin)
compileOnly(libs.room.gradlePlugin)
compileOnly(libs.detekt.gradlePlugin)
compileOnly(libs.ktlint.gradlePlugin)
compileOnly(libs.spotless.gradle)
Expand All @@ -40,7 +43,6 @@ tasks {

gradlePlugin {
plugins {
// Android Plugins
register("androidApplicationCompose") {
id = "mifospay.android.application.compose"
implementationClass = "AndroidApplicationComposeConventionPlugin"
Expand All @@ -49,28 +51,46 @@ gradlePlugin {
id = "mifospay.android.application"
implementationClass = "AndroidApplicationConventionPlugin"
}

register("androidLibraryCompose") {
id = "mifospay.android.library.compose"
implementationClass = "AndroidLibraryComposeConventionPlugin"
}
register("androidLibrary") {
id = "mifospay.android.library"
implementationClass = "AndroidLibraryConventionPlugin"
}
register("androidFeature") {
id = "mifospay.android.feature"
implementationClass = "AndroidFeatureConventionPlugin"
}
register("androidTest") {
id = "mifospay.android.test"
implementationClass = "AndroidTestConventionPlugin"
}
register("androidRoom") {
id = "mifospay.android.room"
implementationClass = "AndroidRoomConventionPlugin"
}
register("androidFirebase") {
id = "mifospay.android.application.firebase"
implementationClass = "AndroidApplicationFirebaseConventionPlugin"
}
register("androidLint") {
id = "mifospay.android.lint"
implementationClass = "AndroidLintConventionPlugin"
}
register("jvmLibrary") {
id = "mifospay.jvm.library"
implementationClass = "JvmLibraryConventionPlugin"
}
register("androidFlavors") {
id = "mifospay.android.application.flavors"
implementationClass = "AndroidApplicationFlavorsConventionPlugin"
}

// KMP & CMP Plugins
register("cmpFeature") {
id = "mifospay.cmp.feature"
implementationClass = "CMPFeatureConventionPlugin"
register("androidKoin") {
id = "mifospay.android.koin"
implementationClass = "AndroidKoinConventionPlugin"
}

register("kmpKoin") {
id = "mifospay.kmp.koin"
implementationClass = "KMPKoinConventionPlugin"
}
register("kmpLibrary") {
id = "mifospay.kmp.library"
implementationClass = "KMPLibraryConventionPlugin"
}

// Static Analysis & Formatting Plugins
register("detekt") {
id = "mifos.detekt.plugin"
implementationClass = "MifosDetektConventionPlugin"
Expand Down
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())
}
}
}
}
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())
}
}
}
}
}
22 changes: 8 additions & 14 deletions core/analytics/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,17 @@
* See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md
*/
plugins {
alias(libs.plugins.mifospay.kmp.library)
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.mifospay.android.library)
alias(libs.plugins.mifospay.android.library.compose)
}

android {
namespace = "org.mifospay.core.analytics"
}

kotlin {
sourceSets {
commonMain.dependencies {
implementation(compose.runtime)
}
androidMain.dependencies {
implementation(project.dependencies.platform(libs.firebase.bom))
implementation(libs.firebase.analytics)
}
}
}
dependencies {
implementation(libs.androidx.compose.runtime)

implementation(platform(libs.firebase.bom))
implementation(libs.firebase.analytics)
}
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())
}
}
52 changes: 5 additions & 47 deletions core/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,14 @@
* See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md
*/
plugins {
alias(libs.plugins.mifospay.kmp.library)
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.mifospay.android.library)
}

android {
namespace = "org.mifospay.common"
}

kotlin {

listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64(),
).forEach {
it.binaries.framework {
isStatic = false
export(libs.kermit.simple)
}
}

sourceSets {
commonMain.dependencies {
implementation(libs.kotlinx.coroutines.core)
api(libs.coil.kt)
api(libs.coil.core)
api(libs.coil.svg)
api(libs.coil.network.ktor)
api(libs.kermit.logging)
api(libs.squareup.okio)
api(libs.jb.kotlin.stdlib)
api(libs.kotlinx.datetime)
}

androidMain.dependencies {
implementation(libs.kotlinx.coroutines.android)
}
commonTest.dependencies {
implementation(libs.kotlinx.coroutines.test)
}
iosMain.dependencies {
api(libs.kermit.simple)
}
desktopMain.dependencies {
implementation(libs.kotlinx.coroutines.swing)
implementation(libs.kotlin.reflect)
}
jsMain.dependencies {
api(libs.jb.kotlin.stdlib.js)
api(libs.jb.kotlin.dom)
}
}
}
dependencies {
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.coroutines.android)
}
Loading

0 comments on commit 09abe15

Please sign in to comment.