Skip to content

Configuration Cache support (#164)#187

Merged
kirich1409 merged 9 commits into
mainfrom
feat/cc-support
May 17, 2026
Merged

Configuration Cache support (#164)#187
kirich1409 merged 9 commits into
mainfrom
feat/cc-support

Conversation

@kirich1409
Copy link
Copy Markdown
Contributor

Implements per docs/specs/2026-05-16-gradle-plugin-cc-support.md.

Per-AC status

AC Status Notes
AC-1 PASS FeaturedPluginIntegrationTest parametrized over cc:Boolean; directory-snapshot mechanism asserts STORE on run 1, LOAD on run 2
AC-2 PASS Both scenarios run in existing CI test job
AC-3 PASS See docs/cc-verification/fixture-report-2026-05-17.md — 0 violations, --problems=fail, Gradle 9.4.1 / AGP 9.1.0
AC-4 PASS See docs/cc-verification/sample-report-2026-05-17.md — all 3 sample targets (:sample:android-app, :sample:desktop, :sample:shared) build with 0 CC violations
AC-5a PASS Audit: propagation does NOT work on AGP 9.1 — see docs/cc-verification/agp-propagation-check-2026-05-16.md. Assertion 2 failed: marker absent from configuration.txt / R8 input.
AC-5b PASS Fallback tasks.configureEach { dependsOn(proguardTask) } in AndroidProguardWiring.kt:30–34 KEPT unchanged — confirmed load-bearing by AC-5a experiment
AC-6 PASS README "Configuration cache" section added with support statement + AGP 9.x gap workaround note
AC-7 PASS Entry under [Unreleased]### Added in CHANGELOG.md
AC-8 PASS docs/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")) in sample/shared/build.gradle.kts. Required to unblock :sample:desktop compilation for AC-4 (the :core types were transitively needed by Main.Desktop.kt but not exposed). 1-line architectural fix.

Spec deviations

None.

Closes #164

@kirich1409 kirich1409 marked this pull request as ready for review May 17, 2026 10:24
Copilot AI review requested due to automatic review settings May 17, 2026 10:24
@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Add Configuration Cache support with comprehensive verification and AGP gap documentation

✨ Enhancement 🧪 Tests

Grey Divider

Walkthroughs

Description
• 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
Diagram
flowchart 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"]
Loading

Grey Divider

File Changes

1. featured-gradle-plugin/src/test/kotlin/dev/androidbroadcast/featured/gradle/FeaturedPluginIntegrationTest.kt 🧪 Tests +93/-9

Parametrize tests over Configuration Cache scenarios

• Renamed existing test to testCcDisabled and extracted shared assertion logic into
 runAssembleReleaseAndAssert(cc: Boolean) helper
• Added new test testCcEnabled that verifies Configuration Cache store on first run and reuse on
 second run
• Implemented ccHashDirs() helper to snapshot top-level subdirectories under
 build/reports/configuration-cache/ for cache reuse verification
• Updated task outcome assertions to accept FROM_CACHE and UP_TO_DATE outcomes in addition to
 SUCCESS for CC scenarios

featured-gradle-plugin/src/test/kotlin/dev/androidbroadcast/featured/gradle/FeaturedPluginIntegrationTest.kt


2. sample/shared/build.gradle.kts 🐞 Bug fix +4/-1

Expose :core types as public API dependency

• Changed :core dependency from implementation to api to expose public types (ConfigValues,
 ConfigParam, InMemoryConfigValueProvider) needed by downstream consumers like :sample:desktop
• Added explanatory comment documenting the pre-existing leak from issue #182

sample/shared/build.gradle.kts


3. CHANGELOG.md 📝 Documentation +1/-0

Document Configuration Cache support in changelog

• Added entry under [Unreleased]### Added section documenting Configuration Cache support for
 Gradle 9+ and AGP 9+

CHANGELOG.md


View more (5)
4. README.md 📝 Documentation +37/-0

Add Configuration Cache support documentation and AGP gap workaround

• Added new "Configuration cache" section to table of contents
• Documented official CC support for Gradle 9+ and AGP 9+ with list of all six plugin tasks
• Explained AGP 9.x proguardFiles provider propagation gap and the tasks.configureEach fallback
 workaround
• Linked to audit artifacts under docs/cc-verification/ for fixture, sample modules, and AGP
 propagation verification
• Referenced docs/known-limitations.md for isolated-projects deferral and issue #186

README.md


5. docs/cc-verification/agp-propagation-check-2026-05-16.md 📝 Documentation +216/-0

Document AGP proguardFiles provider propagation audit

• Comprehensive audit documenting AGP 9.1.0 Variant.proguardFiles provider propagation failure
• Describes two-assertion experiment: task-graph ordering (PASS) but marker string absent from R8
 configuration.txt (FAIL)
• Concludes that tasks.configureEach { dependsOn } fallback in AndroidProguardWiring.kt is
 load-bearing and must be retained
• Provides reproducibility instructions and notes on AGP-internal API boundaries

docs/cc-verification/agp-propagation-check-2026-05-16.md


6. docs/cc-verification/fixture-report-2026-05-17.md 📝 Documentation +80/-0

Document fixture Configuration Cache verification results

• AC-3 verification artifact for test fixture Configuration Cache audit on Gradle 9.4.1 / AGP 9.1.0
• Documents procedure to isolate fixture from parent build and run with `--configuration-cache
 --configuration-cache-problems=fail`
• Reports zero violations across all six plugin tasks

docs/cc-verification/fixture-report-2026-05-17.md


7. docs/cc-verification/sample-report-2026-05-17.md 📝 Documentation +86/-0

Document sample modules Configuration Cache verification results

• AC-4 verification artifact for sample modules Configuration Cache audit on Gradle 9.4.1 / AGP
 9.1.0
• Covers three targets: :sample:android-app:assembleRelease,
 :sample:desktop:packageDistributionForCurrentOs, :sample:shared:assemble
• Reports zero violations across all sample modules with `--configuration-cache
 --configuration-cache-problems=warn`
• Notes that :sample:shared is KMP library without R8 and verifies via assemble task

docs/cc-verification/sample-report-2026-05-17.md


8. docs/known-limitations.md 📝 Documentation +49/-0

Document known limitations and deferred work

• New document tracking behaviour gaps and deferred work for plugin consumers
• Documents Configuration Cache support status with links to verification artifacts
• Explains isolated-projects limitation: wireToRootAggregator() violates isolated-projects
 contract via cross-project mutation
• References issue #186 (v1.1.0 milestone) for isolated-projects migration path

docs/known-limitations.md


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented May 17, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (1)

Grey Divider


Action required

1. wireToRootAggregator uses rootProject 📎 Requirement gap ☼ Reliability
Description
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.
Code

docs/known-limitations.md[R26-29]

+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.
Evidence
The checklist requires wireToRootAggregator to avoid target.rootProject. The PR’s new
known-limitations doc explicitly states wireToRootAggregator() calls target.rootProject, and the
current implementation shows val root = target.rootProject followed by root task
registration/mutation.

Avoid rootProject access in wireToRootAggregator to support isolated projects (per spec deferral)
docs/known-limitations.md[26-29]
featured-gradle-plugin/src/main/kotlin/dev/androidbroadcast/featured/gradle/FeaturedPlugin.kt[153-165]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## 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



Remediation recommended

2. Broken artefact filename refs ✓ Resolved 🐞 Bug ⚙ Maintainability
Description
docs/known-limitations.md points to fixture-report-2026-05-16.md and
sample-report-2026-05-16.md, but the PR adds those reports with 2026-05-17 filenames, so the
documented paths are wrong. This will mislead readers trying to locate the CC verification artefacts
and undermines the documentation’s reliability.
Code

docs/known-limitations.md[R10-16]

+`featured-gradle-plugin` officially supports the Gradle Configuration Cache
+on Gradle 9.x and AGP 9.x. Verification artefacts:
+
+- `docs/cc-verification/fixture-report-2026-05-16.md` — fixture project audit
+- `docs/cc-verification/sample-report-2026-05-16.md` — sample modules audit
+- `docs/cc-verification/agp-propagation-check-2026-05-16.md` — AGP provider
+  propagation audit (see `AndroidProguardWiring` fallback)
Evidence
The limitation doc references fixture/sample report filenames ending in 2026-05-16, but the PR
branch contains those reports as 2026-05-17, so the referenced paths do not match any committed
file names.

docs/known-limitations.md[10-16]
docs/cc-verification/fixture-report-2026-05-17.md[1-6]
docs/cc-verification/sample-report-2026-05-17.md[1-6]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`docs/known-limitations.md` references CC verification artefacts with `2026-05-16` filenames for the fixture and sample reports, but the actual committed artefacts are named `*-2026-05-17.md`. This creates incorrect/dead references.

### Issue Context
The folder `docs/cc-verification/` contains:
- `fixture-report-2026-05-17.md`
- `sample-report-2026-05-17.md`
- `agp-propagation-check-2026-05-16.md`

`docs/known-limitations.md` should reference the real filenames (or alternatively, rename the artefact files to match the `2026-05-16` naming convention—pick one approach and apply it consistently).

### Fix Focus Areas
- docs/known-limitations.md[10-16]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread docs/known-limitations.md
Comment on lines +26 to +29
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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:shared to expose :core as 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.md path; the added report is dated 2026-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

Comment thread docs/known-limitations.md Outdated
Comment on lines +13 to +14
- `docs/cc-verification/fixture-report-2026-05-16.md` — fixture project audit
- `docs/cc-verification/sample-report-2026-05-16.md` — sample modules audit
Comment on lines +190 to +197
**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).

Comment thread README.md
Comment on lines +519 to +521
`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).
Comment on lines 141 to +147
// 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`.
@kirich1409
Copy link
Copy Markdown
Contributor Author

Code review

Found 1 issue:

  1. docs/known-limitations.md references fixture-report-2026-05-16.md and sample-report-2026-05-16.md, but the actual audit artifacts added by this PR are dated -2026-05-17.md. Three dead links on merge (two in the bullet list, one in the prose at L47). Only agp-propagation-check-2026-05-16.md is correctly dated. README.md uses the right -2026-05-17 filenames already; only known-limitations.md is out of sync.

on Gradle 9.x and AGP 9.x. Verification artefacts:
- `docs/cc-verification/fixture-report-2026-05-16.md` — fixture project audit
- `docs/cc-verification/sample-report-2026-05-16.md` — sample modules audit
- `docs/cc-verification/agp-propagation-check-2026-05-16.md` — AGP provider
propagation audit (see `AndroidProguardWiring` fallback)

violations through transitive plugin application. We track such gaps in the
sample audit (`docs/cc-verification/sample-report-2026-05-16.md`) when they
surface. None of these are caused by `featured-gradle-plugin` itself; the

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@kirich1409 kirich1409 merged commit 5a76364 into main May 17, 2026
9 of 10 checks passed
@kirich1409 kirich1409 mentioned this pull request May 17, 2026
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: full Configuration Cache support

2 participants