Skip to content

Make GenerateJavaTask.schemaPaths lazy instead of @Input List<Any> #952

Description

@NielsDoucet

The schemaPaths input property of the GenerateJavaTask currently doesn't accept a Provider or a FileCollection.
If you resolve the graphql schema from an external dependency, that means you have to resolve that configuration at configuration time.
It is also a set of path string annotated with @Input rather than a set of files annotated with @InputFiles or @Classpath, so Gradle cannot determine whether files are up-to-date for task avoidance.
The plugin already does this correctly for the dgsCodegenClasspath ConfigurableFileCollection input in the same class annotated with @Classpath, making this inconsistent.

Can this be adjusted, so we can

  • avoid configuration-time dependency resolution
  • benefit from content-based up-to-date checking
  • have type-safe input checking: a Set<File> accidentally passed as a single list element converted to the String literal [/path/to/schema.graphqls], brackets included, and the first sign of the mistake was a compilation failure in a downstream consumer.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions