From 5cb29988d8ebb4c9625af6452f7931d0e68d1cb7 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 2 Nov 2026 11:09:19 +0100 Subject: build: update to Gradle 9.8.2, AGP 9.5.0, Kotlin 2.4.21, Hilt 2.60.1 AGP 9 migration: - Configure the shared Android setup through the new DSL (CommonExtension, ApplicationExtension) instead of the removed TestedExtension and BaseAppModuleExtension; targetSdk moves to the application extension. - Stop applying the Kotlin Android plugin; AGP 9 compiles Kotlin itself. - Replace kapt with KSP 2.3.13 for Hilt, which built-in Kotlin requires, and carry the Dagger compiler options over as KSP arguments. - AGP 9 now applies packaging excludes to unit-test resources, which stripped the diceware word list (**/*.txt) from its tests; lift that exclude in the diceware module. - Use resources.directories instead of the deprecated srcDir. Plugin updates required by Gradle 9 / AGP 9: Sentry Gradle plugin 6.25.0 (sentry-android 8.62.0), metalava plugin 0.5.1, maven-publish 0.37.0, spotless 8.10.4, version-catalog-update 1.1.2, download task 5.7.0, foojay resolver 1.0.0, with their API changes. Newer metalava models Kotlin properties, so autofill-parser/api.txt is regenerated; the diff is representation only, no API was added or removed. Fix new Kotlin 2.4 and lint findings (explicit return type in a function with an early return, UseKtx in autofill-parser), drop deprecated Kotlin Gradle properties, and make the AGENTS.md pre-commit command cover every task CI runs (both flavors, lint on all modules). Co-Authored-By: Claude Opus 5.5 --- app/build.gradle.kts | 12 ++++++++++-- .../util/viewmodel/SearchableRepositoryViewModel.kt | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 206a3972..bff7d73a 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -7,11 +7,11 @@ plugins { id("com.github.android-password-store.android-application") id("com.github.android-password-store.kotlin-android") - id("com.github.android-password-store.kotlin-kapt") id("com.github.android-password-store.versioning-plugin") id("com.github.android-password-store.sentry") id("com.github.android-password-store.rename-artifacts") alias(libs.plugins.hilt) + alias(libs.plugins.ksp) alias(libs.plugins.kotlin.composeCompiler) } @@ -35,9 +35,17 @@ android { } } +ksp { + // https://dagger.dev/dev-guide/compiler-options + arg("dagger.fastInit", "enabled") + arg("dagger.experimentalDaggerErrorMessages", "enabled") + arg("dagger.hilt.shareTestComponents", "true") + arg("dagger.moduleBindingValidation", "ERROR") +} + dependencies { implementation(platform(libs.compose.bom)) - kapt(libs.dagger.hilt.compiler) + ksp(libs.dagger.hilt.compiler) implementation(libs.androidx.annotation) coreLibraryDesugaring(libs.android.desugarJdkLibs) implementation(projects.autofillParser) diff --git a/app/src/main/java/app/passwordstore/util/viewmodel/SearchableRepositoryViewModel.kt b/app/src/main/java/app/passwordstore/util/viewmodel/SearchableRepositoryViewModel.kt index 2bd75aba..48804e7a 100644 --- a/app/src/main/java/app/passwordstore/util/viewmodel/SearchableRepositoryViewModel.kt +++ b/app/src/main/java/app/passwordstore/util/viewmodel/SearchableRepositoryViewModel.kt @@ -268,7 +268,7 @@ constructor( } .flowOn(dispatcherProvider.io()) - private fun shouldTake(file: File) = + private fun shouldTake(file: File): Boolean = with(file) { if (showHiddenContents) { return !file.name.startsWith(".git") -- cgit v1.2.3