Hello everyone,
currently we want to introduce an include-build in our development process. We have some own gradle plugins that must distinguish between ProjectDependency
and ExternalDependency
.
Project project = ...
ConfigurationContainer configurations = project.getConfigurations();
Configuration runtimeConfiguration = configurations.getByName("runtime");
ResolvedConfiguration resolvedConfiguration = runtimeConfiguration.getResolvedConfiguration();
DomainObjectSet<Dependency> dependencies = runtimeConfiguration.getAllDependencies().withType(Dependency.class);
for (Dependency dependency : dependencies) {
if (dependency instanceof ProjectDependency) {
doSomethingWithProjectDependency((ProjectDependency) dependency);
} else if (dependency instanceof ExternalDependency) {
doSomethingWithExternalDependency((ExternalDependency) dependency);
}
}
Using include-build, our expectation is that each substituted dependency would be a ProjectDependency
, but it is still a ExternalDependency
.
What are we doing wrong?
Thanks for any advice