Cross posting this from the gradle slack because i...
# ktlint
r
Cross posting this from the gradle slack because it’s sepcifically the ktlint plugin that’s giving me the issue. I’ve been using this gradle task to try and make my build runnable with no network connection:
Copy code
fun 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?
Got an answer on the gradle slack - this seems likely to work:
Copy code
fun 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()
  }
}
t
yes, it creates separate configurations for ktlint itself, rules and reporters