Support lazy file collections for GenerateJavaTask.schemaPaths - #957
Merged
Merged
Conversation
jiholee17
marked this pull request as ready for review
September 21, 2026 19:51
jiholee17
requested review from
asibross,
iparadiso,
iuliiasobolevska,
jjacobs44,
kilink,
kzwang,
paulbakker and
srinivasankavitha
as code owners
September 21, 2026 19:51
iuliiasobolevska
approved these changes
Sep 21, 2026
Strengthen lazy schema path test coverage
This branch was successfully deployed
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.
Closes #952
Summary
Update
GenerateJavaTask.schemaPathsto support lazy Gradle file inputs while preserving compatibility with existing consumers.Why
Schema paths may come from a resolvable dependency configuration. Requiring callers to convert that configuration to files eagerly causes dependency resolution during Gradle’s configuration phase.
The previous path conversion also called
toString()on each list element. If a collection such asSet<File>was accidentally added as one element, it became a path containing literal brackets—for example,[/path/to/schema.graphqls].Changing
schemaPathsdirectly to aConfigurableFileCollectionwas considered, but that changed the JVM return type ofgetSchemaPaths(). Downstream plugins compiled against the existing mutableListAPI then failed withNoSuchMethodError.What changed
schemaPathsasMutableList<Any>to preserve source and binary compatibility.schemaPathsdirectly with@InputFiles.FileCollection, including resolvableConfigurationinstancesProvider<out Iterable<Any>>FileCollectionnotation handling.schemaFilesinput property, simplifying the implementation while preserving content-based up-to-date checking.Relative paths now use Gradle’s normal file-collection semantics and resolve against the project that owns the
generateJavatask.Compatibility
getSchemaPaths()continues to returnjava.util.List, so existing integrations using calls such as the following remain compatible:This avoids breaking convention plugins already compiled against the existing API.
Tests
Added functional coverage for:
ProviderresolutionConfiguration/FileCollectioninputsSet<File>flatteningFilepaths in multi-project builds