Skip to content

Commit

Permalink
fix #1519: lint check for individual modules
Browse files Browse the repository at this point in the history
  • Loading branch information
PratyushSingh07 authored and therajanmaurya committed Feb 14, 2024
1 parent 4270ee2 commit 13c8c64
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 37 deletions.
36 changes: 24 additions & 12 deletions .github/workflows/master_dev_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,42 @@ jobs:
path: mifospay/build/outputs/apk/debug/

lintCheck:
name: Static Analysis
name: StaticAnalysis
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/checkout@v2

# Setup JDK 17
- name: Setup JDK 17
uses: actions/setup-java@v1
with:
java-version: 17

- name: Run lint on all modules
run: ./gradlew runLintOnAllModules
- uses: actions/checkout@v2
- name: Static Analysis[Mifospay]
run: ./gradlew mifospay:lint

# Upload lint reports for all modules
- name: Upload Static Analysis Reports
- name: Upload Static Analysis Report For MifosPay Module
uses: actions/[email protected]
if: failure()
with:
name: Static Analysis Reports
path: |
**/build/reports/lint-results*.html
**/build/reports/lint-results*.xml
name: Static Analysis Report[Mifospay]
path: mifospay/build/reports/

- name: Static Analysis[Core:Datastore]
run: ./gradlew core:datastore:lint

- name: Static Analysis[Core:Data]
run: ./gradlew core:data:lint

- name: Static Analysis[Core:DesignSystem]
run: ./gradlew core:designsystem:lint

- name: Static Analysis[Core:Common]
run: ./gradlew core:common:lint

- name: Static Analysis[Feature:Auth]
run: ./gradlew feature:auth:lint

pmd:
name: PMD
Expand Down
26 changes: 1 addition & 25 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.jetbrains.kotlin.commonizer.OptimisticNumberCommonizationEnabledKey.alias

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
Expand Down Expand Up @@ -30,26 +28,4 @@ plugins {
alias(libs.plugins.secrets) apply false
alias(libs.plugins.room) apply false
alias(libs.plugins.kotlin.android) apply false
}

val runLintOnAllModules by tasks.registering {
group = "verification"
description = "Runs the Android lint task on all submodules."
doLast {
println("Lint checks completed for all modules.")
}
}

subprojects {
afterEvaluate {
if (plugins.hasPlugin("com.android.application") || plugins.hasPlugin("com.android.library")) {
val lintTaskName = "lintDebug${name.capitalize()}"
val subprojectPath = path
tasks.register(lintTaskName) {
group = "verification"
description = "Runs lintDebug on the $name module."
dependsOn("$subprojectPath:lintDebug")
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ class ReceiptActivity : BaseActivity(), ReceiptView {
requestCode: Int, permissions: Array<String>,
grantResults: IntArray
) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
when (requestCode) {
REQUEST_WRITE_EXTERNAL_STORAGE -> {

Expand Down

0 comments on commit 13c8c64

Please sign in to comment.