feat: declare configuration-cache compatibility for the Gradle plugin#271
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Declares Gradle Configuration cache compatibility for the
st.ormplugin, backed by functional-test coverage rather than a bare flag.What changed
build.gradle.kts):compatibility { features { configurationCache = true } }on the plugin declaration. This writescompatibility.feature.configuration-cache=DECLARED_SUPPORTEDintoMETA-INF/gradle-plugins/st.orm.properties, which the Plugin Portal reads on publish. In Kotlin DSL the block is an extension function fromorg.gradle.plugin:compatibility-plugin(auto-applied by plugin-publish 2.1.x) and needs an explicitimport org.gradle.plugin.compatibility.compatibility.ConfigurationCacheFunctionalTest(new): builds with--configuration-cacheon 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: arecordentity compiled with the metamodel annotation processor and--enable-preview, asserting the generatedCity_metamodel.FunctionalTestSupport: thestormDumphelper task previously readconfigurationsandtasksinsidedoLast; it now captures the dump at configuration time and the action only replays strings, making the helper itself configuration-cache compatible.StormPluginneeded no changes: all of its wiring (dependency callbacks,afterEvaluatevalidations, Kotlin version detection) runs at configuration time, andPreviewArgsonly carries a serializableProvider.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 containscompatibility.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