How I do iterate CppApplication dependencies? Also, how do I limit it to include only immediate dependencies and ignore transitive ones? I tried the following and it works for a library but not for application.
Set<String> names = new TreeSet<>(); // This works CppLibrary library = ...; library.getApiDependencies().withDependencies(ds -> ds.forEach(d -> names.add(d.getName()))); // But this doesn't CppApplication application = ...; application.getImplementationDependencies().withDependencies(ds -> ds.forEach(d -> names.add(d.getName())));
The latter throws this exception -
Caused by: org.gradle.api.InvalidUserDataException: Cannot change dependencies of configuration ':app:implementation' after it has been included in dependency resolution
Appreciate some help!