Skip to content

fix: Gradle plugin metamodel wiring for every source set and the javadoc preview flag - #449

Merged
zantvoort merged 1 commit into
mainfrom
fix/gradle-plugin-test-source-sets
Aug 11, 2026
Merged

fix: Gradle plugin metamodel wiring for every source set and the javadoc preview flag#449
zantvoort merged 1 commit into
mainfrom
fix/gradle-plugin-test-source-sets

Conversation

@zantvoort

Copy link
Copy Markdown
Collaborator

Fixes #415

The plugin wired the metamodel processor onto the configurations literally named annotationProcessor and ksp only. Those configurations never extend each other, so entities declared in test or custom source sets silently got no metamodel. And --enable-preview covered JavaCompile, Test and JavaExec but not Javadoc, so ./gradlew javadoc failed on the Java path: javadoc embeds the javac front end, which rejects storm-java21's preview class files without the flag.

Changes

  • The plugin iterates the source-set container instead of hardcoding configuration names: storm-metamodel-processor goes on every source set's annotation-processor configuration (annotationProcessor, testAnnotationProcessor, custom equivalents), and storm-metamodel-ksp on every source set's KSP configuration (ksp, kspTest, ksp<Custom>), keeping the eager-add plus afterEvaluate opt-out pattern KSP requires. The metamodel.set(false) opt-out covers all of them.
  • On the Java path with javaPreview enabled, every Javadoc task gets --enable-preview plus -source 21; an explicitly configured source level is left untouched.
  • The functional tests back the declared Gradle 8.5+ support with a pinned version matrix: the declared minimum (8.5) and the last of the 8.x line (8.14.3) on both language paths via withGradleVersion; the wrapper's 9.6.1 covers the current major through all other tests.

Tests

  • Functional: processor wiring asserted for testAnnotationProcessor, kspTest, and a custom integration source 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) because addBooleanOption has no public read accessor.
  • Smoke (gated, runs in CI): a Kotlin entity in src/test/kotlin generates its metamodel under build/generated/ksp/test, a Java entity in src/test/java generates through testAnnotationProcessor, and a real ./gradlew javadoc run succeeds against a source referencing st.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).

@zantvoort
zantvoort merged commit 2e5af55 into main Aug 11, 2026
7 checks passed
@zantvoort
zantvoort deleted the fix/gradle-plugin-test-source-sets branch August 11, 2026 14:25
@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

Gradle plugin: test source sets get no metamodel, and the javadoc task misses the preview flag

1 participant