Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-model tasks that implement interfaces like PatternFilterable, JavaForkOptions, ExecSpec, CopySpec etc #29196

Open
6 tasks
asodja opened this issue May 17, 2024 · 1 comment
Labels
a:bug in:provider-api property lazy provider MapProperty ListProperty DirectoryProperty is:blocker Needs to be resolved to unblock another issue p:lazy-migration Issues covered by migration to an all-lazy API

Comments

@asodja
Copy link
Member

asodja commented May 17, 2024

We have tasks that implement very generic interfaces, like:

  • ExecSpec, JavaExecSpec, JavaForkOptions, ProcessForkOptions
  • CopySpec
  • PatternFilterable

Some examples:

  • Exec implements ExecSpec and transitively also ProcessForkOptions
  • JavaCompile implements PatternFilterable
  • Test implements PatternFilterable and JavaForkOptions
  • Checkstyle implements PatternFilterable
  • Copy implements CopySpec and transitively also PatternFilterable

We should remodel that, or drop interfaces. Let's figure out what is the best way?

Tasks

@asodja asodja added a:bug in:provider-api property lazy provider MapProperty ListProperty DirectoryProperty p:lazy-migration Issues covered by migration to an all-lazy API is:blocker Needs to be resolved to unblock another issue labels May 17, 2024
@asodja
Copy link
Member Author

asodja commented May 17, 2024

Related internal discussion:
https://gradle.slack.com/archives/C03A0MT6S/p1715944923560119?thread_ts=1715935020.579449&cid=C03A0MT6S

One important point, that if we remove interfaces, we have methods like:

  • CopySpec.with(CopySpec)
  • JavaApplication.setApplicationDistribution(CopySpec)
  • MinimalJavadocOptions.contributeCommandLineOptions(ExecSpec)
  • (Java|Groovy|Scala)CopileOptions.setForkOptions()
  • Each fork options type has its own copyTo() method (except for ForkOptions, because consistency)
  • FileTree.matching(PatternFilterable)
  • PatternSet.copyFrom(PatternFilterable)

We should add deprecations to these methods like:

if (spec instanceof Task) { DeprecationLogger....().nagUser(); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug in:provider-api property lazy provider MapProperty ListProperty DirectoryProperty is:blocker Needs to be resolved to unblock another issue p:lazy-migration Issues covered by migration to an all-lazy API
Projects
None yet
Development

No branches or pull requests

1 participant