Subodh Nijsure
04/13/2024, 6:54 PMbuildscript {
….
dependencyLocking {
lockMode = LockMode.STRICT
lockAllConfigurations()
}
}
Also added following task
tasks.register("resolveAndLockAll") {
notCompatibleWithConfigurationCache("Filters configurations at execution time")
doFirst {
require(gradle.startParameter.isWriteDependencyLocks) { "$path must be run from the command line with the
--write-locks` flag" }`
}
doLast {
configurations.filter {
// Add any custom filtering on the configurations to be resolved
it.isCanBeResolved
}.forEach { it.resolve() }
}
}
When I execute task
./gradlew resolveAndLockAll --write-locks
It does create lock file settings-gradle.lockfile , buildscript-gradle.lockfile
However, buildscript-gradle.lockfile is not listing all dependencies — example one of my module feature_networking depends on - com.squareup.okhttp3:okhttp but I don’t see that dependency in the lockfile.
However, same package depends on com.google.code.gson:gson and I see dependency like this: com.google.code.gsongson2.10=classpath in the lockfile.
Is it wrong to expect that lockfile should list all package dependencies? -
Do you I need to rebuild the app and then generate the lockfile?Vampire
04/13/2024, 9:46 PMVampire
04/13/2024, 9:46 PMSubodh Nijsure
04/14/2024, 5:54 PM// Add any custom filtering on the configurations to be resolved
it.isCanBeResolved
Vampire
04/14/2024, 5:55 PM