Skip to content

feat: declare configuration-cache compatibility for the Gradle plugin#271

Merged
zantvoort merged 1 commit into
mainfrom
feat/gradle-plugin-configuration-cache
Jul 14, 2026
Merged

feat: declare configuration-cache compatibility for the Gradle plugin#271
zantvoort merged 1 commit into
mainfrom
feat/gradle-plugin-configuration-cache

Conversation

@zantvoort

Copy link
Copy Markdown
Collaborator

Declares Gradle Configuration cache compatibility for the st.orm plugin, backed by functional-test coverage rather than a bare flag.

What changed

  • Plugin metadata (build.gradle.kts): compatibility { features { configurationCache = true } } on the plugin declaration. This writes compatibility.feature.configuration-cache=DECLARED_SUPPORTED into META-INF/gradle-plugins/st.orm.properties, which the Plugin Portal reads on publish. In Kotlin DSL the block is an extension function from org.gradle.plugin:compatibility-plugin (auto-applied by plugin-publish 2.1.x) and needs an explicit import org.gradle.plugin.compatibility.compatibility.
  • ConfigurationCacheFunctionalTest (new): builds with --configuration-cache on both language paths. Configuration-cache problems fail the build by default on Gradle 9, so a green first run proves the plugin's configuration-time wiring is clean; the second run must reuse the entry and replay the dependency dump captured at configuration time.
  • SmokeCompileTest: the real compiles against the locally installed snapshots now run with --configuration-cache, twice each, so the full task graph (KSP respectively the annotation processor and the preview-flag argument providers) is proven to serialize and be reusable. A Java-path smoke test joins the existing Kotlin one: a record entity compiled with the metamodel annotation processor and --enable-preview, asserting the generated City_ metamodel.
  • FunctionalTestSupport: the stormDump helper task previously read configurations and tasks inside doLast; it now captures the dump at configuration time and the action only replays strings, making the helper itself configuration-cache compatible.

StormPlugin needed no changes: all of its wiring (dependency callbacks, afterEvaluate validations, Kotlin version detection) runs at configuration time, and PreviewArgs only carries a serializable Provider.

Verification

./gradlew build -Dstorm.smoke=true (the CI invocation) is green: 16 functional tests including both new configuration-cache tests and both smoke compiles with store + reuse. The built jar's plugin descriptor contains compatibility.feature.configuration-cache=DECLARED_SUPPORTED.

The remaining acceptance criterion, the Portal dropping its "consider declaring compatibility" suggestion, can only be observed on the next publish; the descriptor change rides along with whichever version is uploaded next.

Fixes #248

The plugin's wiring already runs entirely at configuration time, so the
declaration is backed by tests rather than fixes: new functional tests
build with --configuration-cache on both language paths and assert the
entry is stored and reused, the smoke compiles now run twice under the
configuration cache (proving the serialized task graph, including the
preview-flag argument providers, round-trips), and a Java-path smoke
test joins the existing Kotlin one. The stormDump test helper captures
its dump at configuration time so the task action no longer touches the
Project. The compatibility block writes
compatibility.feature.configuration-cache=DECLARED_SUPPORTED into the
plugin descriptor; in Kotlin DSL it needs an explicit import of
org.gradle.plugin.compatibility.compatibility.
@zantvoort zantvoort merged commit b3be1c8 into main Jul 14, 2026
7 checks passed
@zantvoort zantvoort deleted the feat/gradle-plugin-configuration-cache branch July 14, 2026 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Declare Configuration cache compatibility for the Gradle plugin

1 participant