Skip to content
This repository has been archived by the owner on Apr 17, 2021. It is now read-only.

Commit

Permalink
Closes #831: Use new versionCodeOverride API to fix dynamic versionCo…
Browse files Browse the repository at this point in the history
…des.

This broke when we updated the Android gradle plugin. This code is
inspired by Focus: mozilla-mobile/focus-android#2371

I confirmed this worked by looking at the contents of the
app/build/outputs/apk/amazonWebview/release/output.json file to verify
the versionCode was no longer 11.
  • Loading branch information
mcomella committed Apr 18, 2018
1 parent 5a1672a commit 8d08cf0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ android.applicationVariants.all { variant ->
def isBetaOrRelease = buildType == "release" || buildType == "beta"

if (isBetaOrRelease) {
variant.mergedFlavor.versionCode = generatedVersionCode
variant.outputs.all { output ->
setVersionCodeOverride(generatedVersionCode)
}
}

println("Build type: " + buildType + " (versionCode = " + variant.mergedFlavor.versionCode + ")")
Expand Down

0 comments on commit 8d08cf0

Please sign in to comment.