Is there a way to get all dependent projects in the runtime configuration during configuration phase?
I’m writing a gradle plugin and I have to define some task dependencies on dependent projects of my project where the plugin is applied. To achieve that, I want do get all dependencies of the “runtime” configuration with the following code:
dependencies = p.getConfigurations().getByName(JavaPlugin.RUNTIME_CONFIGURATION_NAME).getAllDependencies().withType(DefaultProjectDependency.class);
The problem: When my plugin is applied, the returned list is always empty. (which is not correct, there are a lot of runtime dependencies) I also tried to write a BuildListener and access the dependencies in the “projectsEvaluated” method, with no success.
If I access the dependencies in the “buildFinished” method, I get all dependencies correctly! But thats of course too late.
Is there a way to access the runtime dependencies at a moment where its still possible to define my task dependencies of my build? (configuration phase or directly ‘after’ configuration?)
Thanks for any advice.