Skip to content

Commit 00214ac

Browse files
authored
MM-102 KMP dependencies setup (openMF#2729)
1 parent fefc6ec commit 00214ac

File tree

45 files changed

+1620
-360
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1620
-360
lines changed

.github/workflows/master_dev_ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Workflow for master/development branches
22

33
on:
44
pull_request:
5+
branches:
6+
- 'development'
7+
- 'master'
58
push:
69
branches:
710
- 'development'

.github/workflows/pr-check.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Workflow for master/development branches
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- 'kmp-impl'
7+
push:
8+
branches:
9+
- 'kmp-impl'
10+
11+
concurrency:
12+
group: build-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
permissions:
16+
contents: read
17+
pull-requests: write
18+
19+
jobs:
20+
setup:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: actions/setup-java@v4
25+
with:
26+
distribution: 'zulu'
27+
java-version: 17
28+
- uses: gradle/actions/setup-gradle@v4
29+
30+
- name: Cache Gradle and build outputs
31+
uses: actions/cache@v4
32+
with:
33+
path: |
34+
~/.gradle/caches
35+
~/.gradle/wrapper
36+
build
37+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
38+
restore-keys: ${{ runner.os }}-gradle-
39+
40+
checks:
41+
needs: setup
42+
runs-on: ubuntu-latest
43+
strategy:
44+
matrix:
45+
check: [ build_logic, spotless, detekt ]
46+
steps:
47+
- uses: actions/checkout@v4
48+
- uses: actions/setup-java@v4
49+
with:
50+
distribution: 'zulu'
51+
java-version: 17
52+
- name: Run ${{ matrix.check }}
53+
id: run_check
54+
run: |
55+
if [ "${{ matrix.check }}" = "build_logic" ]; then
56+
./gradlew check -p build-logic
57+
elif [ "${{ matrix.check }}" = "spotless" ]; then
58+
./gradlew spotlessCheck --no-configuration-cache --no-daemon
59+
elif [ "${{ matrix.check }}" = "detekt" ]; then
60+
./gradlew detekt
61+
fi
62+
63+
- name: Upload Detekt Reports
64+
if: ${{ matrix.check == 'detekt' && steps.run_check.outcome == 'success' }}
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: detekt-reports
68+
path: |
69+
**/build/reports/detekt/detekt.md
70+
71+
dependency_guard:
72+
needs: setup
73+
runs-on: ubuntu-latest
74+
steps:
75+
- uses: actions/checkout@v4
76+
- uses: actions/setup-java@v4
77+
with:
78+
distribution: 'zulu'
79+
java-version: 17
80+
81+
- name: Check Dependency Guard
82+
id: dependencyguard_verify
83+
continue-on-error: true
84+
run: ./gradlew dependencyGuard
85+
86+
- name: Prevent updating Dependency Guard baselines if this is a fork
87+
id: checkfork_dependencyguard
88+
if: steps.dependencyguard_verify.outcome == 'failure' && github.event.pull_request.head.repo.full_name != github.repository
89+
run: |
90+
echo "::error::Dependency Guard failed, please update baselines with: ./gradlew dependencyGuardBaseline" && exit 1
91+
92+
# Runs if previous job failed
93+
- name: Generate new Dependency Guard baselines if verification failed and it's a PR
94+
id: dependencyguard_baseline
95+
if: steps.dependencyguard_verify.outcome == 'failure' && github.event_name == 'pull_request'
96+
run: |
97+
./gradlew dependencyGuardBaseline
98+
99+
- name: Push new Dependency Guard baselines if available
100+
uses: stefanzweifel/git-auto-commit-action@v5
101+
if: steps.dependencyguard_baseline.outcome == 'success'
102+
with:
103+
file_pattern: '**/dependencies/*.txt'
104+
disable_globbing: true
105+
commit_message: "🤖 Updates baselines for Dependency Guard"

androidApp/build.gradle.kts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
*
88
* See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
99
*/
10+
import org.mifos.mobile.MifosBuildType
1011
import org.mifos.mobile.dynamicVersion
1112

1213
plugins {
1314
alias(libs.plugins.mifos.android.application)
1415
alias(libs.plugins.mifos.android.application.compose)
16+
alias(libs.plugins.mifos.android.application.flavors)
1517
alias(libs.plugins.mifos.android.hilt)
16-
alias(libs.plugins.mifos.android.application.firebase)
1718
id("com.google.android.gms.oss-licenses-plugin")
18-
alias(libs.plugins.roborazzi)
1919
}
2020

2121
android {
@@ -45,11 +45,16 @@ android {
4545
}
4646

4747
buildTypes {
48+
debug {
49+
applicationIdSuffix = MifosBuildType.DEBUG.applicationIdSuffix
50+
}
51+
4852
release {
4953
isDebuggable = false
5054
isMinifyEnabled = true
5155
isShrinkResources = true
5256
signingConfig = signingConfigs.getByName("release")
57+
applicationIdSuffix = MifosBuildType.RELEASE.applicationIdSuffix
5358
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
5459
}
5560
}
@@ -61,10 +66,10 @@ android {
6166
}
6267

6368
dependencyGuard {
64-
configuration("releaseRuntimeClasspath"){
65-
modules = true
66-
tree = true
67-
}
69+
configuration("demoDebugRuntimeClasspath")
70+
configuration("demoReleaseRuntimeClasspath")
71+
configuration("prodDebugRuntimeClasspath")
72+
configuration("prodReleaseRuntimeClasspath")
6873
}
6974

7075
dependencies {

0 commit comments

Comments
 (0)