Rob Elliot
09/22/2020, 9:14 AMfun Configuration.isDeprecated() = this is DeprecatableConfiguration && resolutionAlternatives != null
tasks.register("downloadDependencies") {
doLast {
configurations
.filter { it.isCanBeResolved && !it.isDeprecated() }
.forEach { it.resolve() }
}
}
Idea is I run that task with a network connection, then go offline to run the actual build to prove my build will now run without a network connection.
However, using the org.jlleitschuh.gradle.ktlint
plugin I’m still getting a failure running the offline build on a clean box when it tries to download ktlint:0.36.0
(I’m setting the version explicitly to 0.39.0
).
Does the plugin contribute its dependencies to a configuration that I could resolve up front?Rob Elliot
09/22/2020, 9:50 AMfun Configuration.isDeprecated() = this is DeprecatableConfiguration && resolutionAlternatives != null
fun ConfigurationContainer.resolveAll() = this
.filter { it.isCanBeResolved && !it.isDeprecated() }
.forEach { it.resolve() }
tasks.register("downloadDependencies") {
doLast {
configurations.resolveAll()
buildscript.configurations.resolveAll()
}
}
tapchicoma
09/22/2020, 7:46 PMtapchicoma
09/22/2020, 7:47 PM