Hi, I am developing a gradle plugin for android apps that integrate our library.
The idea is that our library needs some specific versions of some depenendencies that the host app can contain. If the versions dont match it can cause a lot of commotion.
To make it easier I decided to write a plugin that the app will apply that will check the apps resolved dependencies and detect if it contains those specific libraries and checks if the versions are ok. This plugin should run every time the app is being assembled.
I tried a lot of stuff and nothing works, currently I have:
override fun apply(target: Project) {
target.task("CheckDependencies") {
target.configurations.getByName("implementation").forEach {file ->
println("dep name = ${file.name}")
}
}
}
This produces:
Resolving dependency configuration ‘implementation’ is not allowed as it is defined as ‘canBeResolved=false’.
Instead, a resolvable (‘canBeResolved=true’) dependency configuration that extends ‘implementation’ should be resolved.
how can I check the resolved dependencies versions inside a plugin task ?