Configuration Cache support (#164)#187
Conversation
Per spec AC-5a: experiment proves propagation is broken on AGP 9.1. Generated proguard-featured.pro never reaches R8 — empty merge output, no section in mapping/configuration.txt. Per AC-5b: keep the tasks.configureEach fallback in AndroidProguardWiring.kt unchanged. Document in README under AC-6.
Review Summary by QodoAdd Configuration Cache support with comprehensive verification and AGP gap documentation
WalkthroughsDescription• Implement Configuration Cache support for Gradle 9+ and AGP 9+ • Parametrize integration tests over CC scenarios with cache reuse verification • Document AGP 9.x proguardFiles provider propagation gap and fallback workaround • Fix pre-existing dependency leak by exposing :core as API from :sample:shared Diagramflowchart LR
A["Integration Tests"] -->|parametrized over CC| B["CC Disabled Scenario"]
A -->|parametrized over CC| C["CC Enabled Scenario"]
C -->|verifies| D["Cache Store Run 1"]
C -->|verifies| E["Cache Load Run 2"]
F["AGP 9.1 Audit"] -->|discovers| G["proguardFiles Provider Gap"]
G -->|requires| H["tasks.configureEach Fallback"]
I["Documentation"] -->|covers| J["CC Support Statement"]
I -->|covers| K["AGP Gap Workaround"]
I -->|covers| L["Verification Artifacts"]
M["Dependency Fix"] -->|changes| N["sample:shared api dep"]
File Changes1. featured-gradle-plugin/src/test/kotlin/dev/androidbroadcast/featured/gradle/FeaturedPluginIntegrationTest.kt
|
Code Review by Qodo
1. wireToRootAggregator uses rootProject
|
| Source: `FeaturedPlugin.kt:157` — `wireToRootAggregator()` calls | ||
| `target.rootProject` to lazily register the `scanAllLocalFlags` aggregator on | ||
| the root project. Cross-project mutation from a non-root project violates the | ||
| isolated-projects contract. |
There was a problem hiding this comment.
1. wiretorootaggregator uses rootproject 📎 Requirement gap ☼ Reliability
wireToRootAggregator() still calls target.rootProject to register and mutate the root aggregator task, which breaks isolated-projects compatibility. This violates the requirement to avoid root project access in this wiring path.
Agent Prompt
## Issue description
`wireToRootAggregator()` uses `target.rootProject` to register/mutate the root task, which violates the isolated-projects contract and fails the compliance requirement.
## Issue Context
The PR adds documentation acknowledging that `wireToRootAggregator()` calls `target.rootProject`, and the current implementation in `FeaturedPlugin.kt` confirms this.
## Fix Focus Areas
- featured-gradle-plugin/src/main/kotlin/dev/androidbroadcast/featured/gradle/FeaturedPlugin.kt[153-165]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
Pull request overview
This PR adds Configuration Cache verification and documentation for featured-gradle-plugin, along with a sample dependency visibility fix needed for sample desktop compilation.
Changes:
- Adds automated Configuration Cache coverage to the Android fixture integration test.
- Adds README/changelog/known-limitations documentation and CC verification reports.
- Changes
:sample:sharedto expose:coreas an API dependency.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
sample/shared/build.gradle.kts |
Exposes :core via api for downstream sample consumers. |
README.md |
Adds Configuration Cache support documentation and verification links. |
featured-gradle-plugin/src/test/kotlin/dev/androidbroadcast/featured/gradle/FeaturedPluginIntegrationTest.kt |
Adds CC-enabled and CC-disabled integration test paths. |
docs/known-limitations.md |
Documents Configuration Cache and isolated-projects limitations. |
docs/cc-verification/sample-report-2026-05-17.md |
Adds sample module CC verification report. |
docs/cc-verification/fixture-report-2026-05-17.md |
Adds fixture CC verification report. |
docs/cc-verification/agp-propagation-check-2026-05-16.md |
Adds AGP proguardFiles propagation audit. |
CHANGELOG.md |
Adds Configuration Cache support entry. |
Comments suppressed due to low confidence (1)
docs/known-limitations.md:47
- This sample audit reference uses the nonexistent
sample-report-2026-05-16.mdpath; the added report is dated2026-05-17, so this should be updated to avoid a stale/broken documentation reference.
sample audit (`docs/cc-verification/sample-report-2026-05-16.md`) when they
| - `docs/cc-verification/fixture-report-2026-05-16.md` — fixture project audit | ||
| - `docs/cc-verification/sample-report-2026-05-16.md` — sample modules audit |
| **Propagation does NOT work on AGP 9.1.** The `tasks.configureEach { … | ||
| dependsOn(proguardTask) }` fallback in `AndroidProguardWiring.kt:30–34` is | ||
| LOAD-BEARING — removing it produces a green build whose R8 invocation silently | ||
| ignores our `-assumevalues` rules. | ||
|
|
||
| Per spec AC-5b: **keep fallback unchanged**, and document the AGP 9.x gap in the | ||
| README "Configuration cache" section (AC-6). | ||
|
|
| `featured-gradle-plugin` retains a `tasks.configureEach { … }` fallback inside [`AndroidProguardWiring.kt`](featured-gradle-plugin/src/main/kotlin/dev/androidbroadcast/featured/gradle/AndroidProguardWiring.kt) that explicitly establishes the task dependency. The fallback is CC-safe (no `Project` reference at execution time, no eager configuration). It will be revisited on every AGP minor and removed when the upstream provider propagation gap is fixed. | ||
|
|
||
| Audit artefact: [`docs/cc-verification/agp-propagation-check-2026-05-16.md`](docs/cc-verification/agp-propagation-check-2026-05-16.md). |
| // generateProguardRules must have run as part of the release build. | ||
| val proguardOutcome = result.task(":generateProguardRules")?.outcome | ||
| assertTrue( | ||
| proguardOutcome == TaskOutcome.SUCCESS || proguardOutcome == TaskOutcome.UP_TO_DATE, | ||
| "Expected :generateProguardRules to participate in assembleRelease, got $proguardOutcome\n${result.output}", | ||
| proguardOutcome == TaskOutcome.SUCCESS || | ||
| proguardOutcome == TaskOutcome.UP_TO_DATE || | ||
| proguardOutcome == TaskOutcome.FROM_CACHE, | ||
| "Expected :generateProguardRules to participate in assembleRelease (cc=$cc), got $proguardOutcome\n${result.output}", |
| `pluginManagement.repositories` and `dependencyResolutionManagement.repositories`. | ||
| 4. In `/tmp/featured-fixture-ac3/build.gradle.kts`, change the Featured plugin declaration | ||
| to `id("dev.androidbroadcast.featured") version "0.1.0-SNAPSHOT"`. | ||
| 5. Add `local.properties` with `sdk.dir=/Users/krozov/dev/android-sdk`. |
Code reviewFound 1 issue:
Featured/docs/known-limitations.md Lines 11 to 16 in c4e5498 Featured/docs/known-limitations.md Lines 46 to 48 in c4e5498 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Implements per docs/specs/2026-05-16-gradle-plugin-cc-support.md.
Per-AC status
docs/cc-verification/fixture-report-2026-05-17.md— 0 violations,--problems=fail, Gradle 9.4.1 / AGP 9.1.0docs/cc-verification/sample-report-2026-05-17.md— all 3 sample targets (:sample:android-app,:sample:desktop,:sample:shared) build with 0 CC violationsdocs/cc-verification/agp-propagation-check-2026-05-16.md. Assertion 2 failed: marker absent fromconfiguration.txt/ R8 input.tasks.configureEach { dependsOn(proguardTask) }inAndroidProguardWiring.kt:30–34KEPT unchanged — confirmed load-bearing by AC-5a experiment[Unreleased]→### Addedin CHANGELOG.mddocs/known-limitations.md+ linked issue #186 (isolated projects / wireToRootAggregator)Test framework
JUnit 4 path: two test methods (
testCcDisabled,testCcEnabled) sharing a private helper (per Prerequisite #5). Parametrization is structural (two explicit methods), not JUnit 4@Parameterized, for TestKit compatibility.Pre-existing #182 dep bug fix
Inline Option A: changed
implementation(project(":core"))→api(project(":core"))insample/shared/build.gradle.kts. Required to unblock:sample:desktopcompilation for AC-4 (the:coretypes were transitively needed byMain.Desktop.ktbut not exposed). 1-line architectural fix.Spec deviations
None.
Closes #164