ResolutionStrategy can be used to fine-tune the dependencies.
I’d like to write a task to know if my project is releasable. One of the prerequisite is that all of its first-level dependencies are already released, with the same RELEASE_NAME.
In other words, if my component FOO must be released with the RELEASE_NAME name, I need to find RELEASE_NAME versions of all its first level dependencies.
I thought about using resolutionStrategy for this
configurations.checkRelease.resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if ( **first level dependency** ) {
details.useVersion "${project.RELEASE_NAME}"
}
}
And then resolve the checkRelease configuration, and see if it fails or not to find the dependencies
Is there a way to apply this only to first level dependencies ?
Do you see another way to achieve my check ?