Attach per-version properties to parameterized Gradle versions#51
Merged
Attach per-version properties to parameterized Gradle versions#51
Conversation
Introduce @GradleVersion(version, properties = [@Property(...)]) so tests can attach metadata (e.g. a minimum Kotlin version) to each parameterized Gradle version. Both @testkit and @ParameterizedWithGradleVersions accept the richer form alongside the existing Array<String> path, and TestProject.property(key) exposes the values to test bodies. Generated with Claude Code
Generated with Claude Code
2 tasks
ogolberg
added a commit
that referenced
this pull request
May 8, 2026
## Summary - Documents the `@GradleVersion` / `@Property` parameterization introduced in #51, including the `project.property(key)` accessor and the per-version display-name format. - Deprecates `@TestKit.gradleVersions` and `@ParameterizedWithGradleVersions.value` in favor of the `versions` array (`ReplaceWith("versions")`), and notes the resolution priority in the README. ## Test plan - [ ] `./gradlew :junit5:compileKotlin` succeeds with no new warnings - [ ] Full CI green (existing `TestKitIntegrationTest` still exercises the legacy `gradleVersions = [...]` form) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.
Summary
@GradleVersion(version, properties = [@Property(key, value)])sub-annotation so each Gradle version in a parameterized test can carry extra metadata (e.g. a matching Kotlin version to pair with an older Gradle).@TestKitand@ParameterizedWithGradleVersionsgain aversions: Array<GradleVersion>field alongside the existingArray<String>form. Resolution priority: methodversions→ methodvalue→ classversions→ classgradleVersions. Fully backward compatible.GradleVersionArgumentcarries the properties;ProjectKeyincludes them so the per-versionTestProjectcache stays correct.TestProject.property(key)exposes the metadata to test bodies.project(gradle: 8.6 [kotlin=1.9.24]).Example
Test plan
GradleVersionPropertiesIntegrationTestexercises the feature and passesTestKitIntegrationTeststill uses the legacygradleVersions = [...]form unchangedproject(gradle: 8.6 [kotlin=1.9.24]):junit5module🤖 Generated with Claude Code