casolorz
casolorz

Reputation: 9544

Is there a way to know what version of each gradle dependency I had on a certain build?

Recently I had a crash popup with MoPub all of the sudden between two releases in which I didn't touch MoPub. Turns out their suggested configuration for gradle is com.mopub:mopub-sdk:+@aar and it had updated without me noticing. It took me a while to notice that MoPub had updated.

If I could commit some file that has all the versions of gradle dependencies the app used then I could more easily compare between builds.

Is there a file that has all that information?

Thanks.

Upvotes: 0

Views: 458

Answers (1)

Nick Rundle
Nick Rundle

Reputation: 639

You could generate a resolved dependency report and save it:

./gradlew dependencies

Or you could use dependency locking and check this in to your SCM so that you can rebuild an older version with the exact dependencies used at release time.

You add this to your build.gradle

dependencyLocking {
    lockAllConfigurations()
}

Then you generate the lock files using ./gradlew dependencies --write-locks and check those in to your source control. If the lock file is present, then those versions override anything in the build.gradle. You can update the locked version on future releases by passing the --write-locks option and committing the changes back to your SCM.

Upvotes: 1

Related Questions