We’re using version locking, and trying to update lockfiles across several configurations. The problem is that the recommended classes
task is only updating one of our lockfiles.
Basically, when we run:
./gradlew classes --update-locks mygroup:myproj
The only files getting updated right now is compile.lockfile
, but this dependency is in several other classpaths.
When running;
./gradlew dependencies --write-locks
All dependencies are updated, including this project’s dependencies. As a workaround right now, we just iterate through and “undo” all the other projects that get updated. But that’s very manual and not what we want.
I’ve attempted to create a task to do this, but I can’t figure out to filter out just this project, i.e.,
tasks.register("updateAProjectLocks") {
doFirst {
require(gradle.startParameter.isWriteDependencyLocks)
}
doLast {
configurations.filter { it.isCanBeResolved }.forEach { configuration ->
configuration.withDependencies
}
configurations.filter { it.isCanBeResolved }.forEach { configuration ->
configuration.files(/* I have no idea */)
}
}
}
Is this the right way to go about this? Or is there some wrinkle to my configuration I need to consider.