diff --git a/apps/mobile-app/android/app/build.gradle b/apps/mobile-app/android/app/build.gradle index 213dcafd9..52957b678 100644 --- a/apps/mobile-app/android/app/build.gradle +++ b/apps/mobile-app/android/app/build.gradle @@ -131,6 +131,8 @@ android { xmlReport true htmlReport true lintConfig file("lint.xml") + // Focus only on app/src and exclude expo modules + disable 'InvalidPackage' } } @@ -224,7 +226,20 @@ ktlint { task lintFixAll { description = "Run all auto-fixers (ktlint and Android lint)" group = "formatting" - dependsOn ktlintFormat, lintFix + dependsOn 'ktlintFormat' +} + +task lintAll { + description = "Run all linting checks (ktlint and Android lint)" + group = "formatting" + dependsOn 'ktlintCheck' +} + +// Fix for expo-dev-menu lint model generation +afterEvaluate { + tasks.withType(com.android.build.gradle.internal.lint.LintModelWriterTask).configureEach { + dependsOn(':expo-dev-menu:copyAssets') + } } // Add a task dependency to make ktlint run before build diff --git a/apps/mobile-app/android/build.gradle b/apps/mobile-app/android/build.gradle index fb5c7869d..7f725bdaa 100644 --- a/apps/mobile-app/android/build.gradle +++ b/apps/mobile-app/android/build.gradle @@ -42,16 +42,3 @@ allprojects { maven { url 'https://www.jitpack.io' } } } - -// Configure ktlint -ktlint { - android = true - verbose = true - outputToConsole = true - ignoreFailures = false - enableExperimentalRules = true - filter { - exclude("**/generated/**") - include("**/kotlin/**") - } -} diff --git a/docs/misc/dev/mobile-apps/android.md b/docs/misc/dev/mobile-apps/android.md index 807169569..44aed1af7 100644 --- a/docs/misc/dev/mobile-apps/android.md +++ b/docs/misc/dev/mobile-apps/android.md @@ -50,12 +50,7 @@ Linting is ran automatically during normal Android app build. You can however al ### Kotlin ```bash -./gradlew ktlintCheck -``` - -### Java -```bash -./gradlew lint +./gradlew lintAll ``` ### Auto fix linting issues