gradle / gradle

Adaptable, fast automation for all
https://gradle.org
Apache License 2.0
16.92k stars 4.74k forks source link

Remove `Buildable` interface #30534

Open asodja opened 2 months ago

asodja commented 2 months ago

That way we could move Provider/Property/FileCollection interfaces out of :core-api. Also we could use Provider API in :process-services project (ProcessForkOptions, ExecSpec, BaseExecSpec).

https://github.com/gradle/gradle/blob/b0032a8a355379e5868b22d660f8be5cf857168e/subprojects/core-api/src/main/java/org/gradle/api/Buildable.java#L24

Adam It was originally intended to represent some abstract buildable "thing" so you could wire in a dependency on a logical thing without knowing which tasks produce that thing. This has been superseded by providers, which carry both the thing and its producers (and more). We should kill off Buildable

mlopatkin commented 1 month ago

Related to #29528

lptr commented 1 month ago

If we kill Buildable, I think we should also kill TaskDependency. (I've never really understood how that thing worked anyway, but it's problematic for other reasons, too, e.g. because it assumes things can only be built by Tasks specifically.)

There are other types that have a TaskDependency getBuildDependencies() method, some without implementing Buildable:

Some types already have their getBuildDependencies() methods deprecated:

We also have these as @Incubating: