Introduce `CapabilitiesExtension`This commit adds a capabilities extension which can be applied to a project. If it's added, localcomponents gain the ability to declare capabilities. Currently, only the `java-library` pluginsupports capabilities, but it's expected that more plugins will add it (for example, the nativeplugin), which explains why the extension lives in `core`.When a project declares capabilities, they are bound to configurations. This lets us fail whenevera local component capability conflicts with a transitive module capability. It will also let uspublish capabilities for local components in a subsequent commit.
Run Configuration dependency actions only when requiredThis change fixes #3908, by deferring the execution of Configuration`withDependencies` and `defaultDependencies` actions. Previously,these were executed when constructing the LocalComponentMetadatainstance for resolving: this execution is now deferred until thedependencies or excludes for the LocalConfigurationMetadata areactually required.Fixes #3908Signed-off-by: Daz DeBoer <firstname.lastname@example.org>