Last active
October 27, 2023 10:20
-
-
Save nerro/41cd6f8273a05b3da7cad1f2e9caf1c7 to your computer and use it in GitHub Desktop.
Gradle: task 'resolveDependencies' for CI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task resolveDependencies { | |
setDescription "Resolves all projects dependencies from the repository." | |
setGroup "Build Server" | |
doLast { | |
rootProject.allprojects { project -> | |
project.buildscript.configurations.forEach { configuration -> | |
if (configuration.canBeResolved) { | |
configuration.resolve() | |
} | |
} | |
project.configurations.forEach { configuration -> | |
if (configuration.canBeResolved) { | |
configuration.resolve() | |
} | |
} | |
} | |
} | |
} |
thx, very useful!
Helped me with a docker build issue throwing randomly SSL shut down incorrectly errors and also caching downloads of course
thx, code with kotlin
build.gradle.kts
task("resolveDependencies") {
description = "Resolves all projects dependencies from the repository."
group = "Build Server"
doLast {
rootProject.allprojects {
(project.buildscript.configurations + project.configurations).forEach { configuration ->
if (configuration.isCanBeResolved) {
configuration.resolve()
}
}
}
}
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nice task, helped me a lot! small refactoring: