Is this the right place to ask for extending Depen...
# dependency-management
r
Is this the right place to ask for extending DependencyHandler to have in addition to
DependencyHandler#addProvider(String,Provider<Object)
also support sth like
DependencyHandler#addProvider(String,Provider<Collection<Object>>)
We try to be good citicen using the provider api where possible but often we break at certain gradle api boundaries. E.g. we have a
Provider<Collection<String>>
representing a set of dependencies. what I now end up doing is mapping this explicitly to a dependencySet "early" and do
Copy code
myConfiguration.defaultDependencies(t -> {
                psService.get()
                    myDepsProvider.get()
                    .forEach(path -> t.add(depsHandler.project(Map.of("path", path))));
            });
which feels just wrong and a misuse of defaultDependencies. Ideally I'd be able to do
Copy code
dependencyHandler.addProvider("myConfiguration", myDeps.map(deps -> deps.collect(d -> dependencyHandler.project(Map.of("path", d)))))
Or do i miss something here to make that simpler?
v
How about
Copy code
configurations.myConfiguration {
    dependencies.addAllLater(yourProviderOfIterable)
}
?
Other than that, I'd guess the best way to actually request an API change is a feature request ticket. 🤷‍♂️
r
that worked. thank you! I missed that api somehow ¯\_(ツ)_/¯
👌 1