add new task to update gradle lockfiles, and update lockfiles

This commit is contained in:
Adam 2023-07-13 14:19:02 +02:00
parent b6fbea813b
commit 05ee976d13
4 changed files with 35 additions and 29 deletions

View file

@ -21,3 +21,16 @@ dependencyLocking {
lockMode.set(LockMode.STRICT)
lockAllConfigurations()
}
tasks.register("resolveAndLockAllDependencies") {
// https://docs.gradle.org/current/userguide/dependency_locking.html#ex-resolving-all-configurations
group = "dependencies"
notCompatibleWithConfigurationCache("Filters configurations at execution time")
val resolvableConfigurations = configurations.matching { it.isCanBeResolved }
doFirst {
require(gradle.startParameter.isWriteDependencyLocks) { "$path must be run from the command line with the `--write-locks` flag" }
}
doLast {
resolvableConfigurations.forEach { it.resolve() }
}
}