fix: Gradle plugin metamodel wiring for every source set and the javadoc preview flag - #449
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Fixes #415
The plugin wired the metamodel processor onto the configurations literally named
annotationProcessorandksponly. Those configurations never extend each other, so entities declared in test or custom source sets silently got no metamodel. And--enable-previewcoveredJavaCompile,TestandJavaExecbut notJavadoc, so./gradlew javadocfailed on the Java path: javadoc embeds the javac front end, which rejects storm-java21's preview class files without the flag.Changes
storm-metamodel-processorgoes on every source set's annotation-processor configuration (annotationProcessor,testAnnotationProcessor, custom equivalents), andstorm-metamodel-kspon every source set's KSP configuration (ksp,kspTest,ksp<Custom>), keeping the eager-add plusafterEvaluateopt-out pattern KSP requires. Themetamodel.set(false)opt-out covers all of them.javaPreviewenabled, everyJavadoctask gets--enable-previewplus-source 21; an explicitly configured source level is left untouched.withGradleVersion; the wrapper's 9.6.1 covers the current major through all other tests.Tests
testAnnotationProcessor,kspTest, and a customintegrationsource set on both paths; javadoc options asserted present, absent on opt-out and on the Kotlin path, and non-clobbering for a user-set source level; the version matrix runs the wiring dump on Gradle 8.5 and 8.14.3. The dump reads javadoc options reflectively (JavadocOptionFile.getOptions(), same shape since before the minimum Gradle version) becauseaddBooleanOptionhas no public read accessor.src/test/kotlingenerates its metamodel underbuild/generated/ksp/test, a Java entity insrc/test/javagenerates throughtestAnnotationProcessor, and a real./gradlew javadocrun succeeds against a source referencingst.orm.template.ORMTemplate, which failed before the fix.Docs: the installation page's plugin table now states the per-source-set wiring and lists javadoc among the preview-flagged tasks (docs/ only, so visible at /docs/next until the next release).