From 782de2b966ddd33d84425d61ae64247f3ce35287 Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Thu, 20 Aug 2026 17:15:49 -0400 Subject: [PATCH] build(codes): declare the kikcode lint tasks' dependency on generated fixtures `commonTest`'s `kotlin.srcDir(generateTestFixtures)` carries the task dependency to the Kotlin compile tasks only. AGP's `lintAnalyzeAndroidHostTest` and `generateAndroidHostTestLintModel` read the same source directories straight off disk, so Gradle failed the build on an undeclared dependency on `build/generated/testFixtures` whenever both landed in one task graph -- which is exactly what CI's `flipcashTestDebug :apps:flipcash:app:lintDebug` does. Wire the dependency on those lint tasks explicitly. --- libs/codes/kikcode/build.gradle.kts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/codes/kikcode/build.gradle.kts b/libs/codes/kikcode/build.gradle.kts index 2907456ca..35a1a5633 100644 --- a/libs/codes/kikcode/build.gradle.kts +++ b/libs/codes/kikcode/build.gradle.kts @@ -68,6 +68,12 @@ val generateTestFixtures = tasks.register("generateTestFix outputDirectory.set(layout.buildDirectory.dir("generated/testFixtures")) } +// `srcDir(taskProvider)` below carries the task dependency to the Kotlin compile tasks only; AGP's +// lint tasks read the same source directories straight off disk, so Gradle fails the build over an +// undeclared dependency on the generated fixtures. Wire it up by hand. +tasks.matching { it.name.startsWith("lint") || it.name.endsWith("LintModel") } + .configureEach { dependsOn(generateTestFixtures) } + kotlin { android { namespace = "com.getcode.codes.kikcode"