Is there any way to specify the latest version of ...
# gradle
f
Is there any way to specify the latest version of a library in your grade file, rather than hard coding a version number? e.g. on iOS platform we have dependency management platforms like CocoaPods that have syntax for specifying this kind of thing.
r
"group:name:+"
(or
"group:name:2.+"
for example), but this practice is discouraged as it doesn't allow you to produce repeatable builds. I'd suggest you to find and use Gradle plugin which allows you to check if dependencies are updated by invoking gradle task like https://github.com/ben-manes/gradle-versions-plugin
f
thank you! This is exactly what I was looking for.
With CocoaPods we can issue a command to see what updates, if any are available, and then selectively update whatever libraries we want
r
Gradle doesn't have this included, but it's much more open and extensible AFAICT. It's hard to do automatic updating though because Gradle config is script, not just static structured configuration, so dependencies can be added in quite obscure ways and the tool won't be able to properly change code in config file. But you can simply declare versions inline or have them all in one place as variables so manual updates are easy based on report of mentioned plugin.
If you prefer maintainability over flexibility and ease of configuration you can look into using Maven directly -- it's configured via xml and also has a great community and infrastructure.
f
thanks Andrew, this is some good info