-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
Description
Describe the bug
The Gordon Gradle plugin creates a temporary file named PLACEHOLDER_DYNAMIC_MODULE_MANIFEST as a placeholder for the dynamicFeatureModuleManifest input property of GordonTestTask. However, because this is created as a temporary file, its name changes with each Gradle daemon process, which invalidates incremental builds and the build cache unnecessarily.
Impact
Build cache is invalidated on every daemon restart
Incremental builds don't work correctly
CI/CD pipelines and local development experience degraded performance
To Reproduce
- Apply Gordon to an Android [app|library|feature] module.
- no special setup
- Run the following gradle task with these arguments: "--no-daemon"
- All Tests are executed again without any change to the Tests or Code
Expected behavior
The second run of Gordon should not run any tests but be up-to-date instead.
Additional context
Workaround:
afterEvaluate {
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
tasks.withType<com.banno.gordon.GordonTestTask>().configureEach {
if(dynamicFeatureModuleManifest.get().asFile.name.startsWith("PLACEHOLDER_DYNAMIC_MODULE_MANIFEST")) {
val placeholder = File(rootProject.layout.buildDirectory.get().asFile, "MY_PLACEHOLDER_DYNAMIC_MODULE_MANIFEST").apply { parentFile.mkdirs(); createNewFile() }
dynamicFeatureModuleManifest.set(placeholder)
}
}
}