Programmatically change dependency versions?


(Jing Xue) #1

I’m trying implement a “bleeding edge mode”. Normally the dependencies are pinned down to a specific release version, but in this mode I’d like to set all internal dependencies (i.e. other modules developed by the same team) to ‘latest.integration’.

I tried setting dependency.version to ‘latest.integration’ in afterEvaluation, but that of course turns out to be read-only. I can always declare a version property for each module and sets it based on the mode, but before I go down that route, is there any other more automagic way to achieve this?

Or in general, is there a better way to achieve such a “bleeding edge mode”? Thanks.


(Peter Niederwieser) #2

I’d probably go with dependency resolve rules. See “50.8.2. Using dependency resolve rules” in the Gradle User Guide.


(Jing Xue) #3

Wonderful… exactly what I was looking for. Thanks.