This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse the repository at this point in the history
Making Android versionCodeOverride for new apps using the template hu…
…man-readable (#29808) Summary: The current calculation on versionCodeOverride is not human-readable. Imagine if we have an android app with **versionName** `4.0` and **version code** `4`. In the current implementation, the result of **versionCode** `4` for `armeabi-v7a` will be the seemingly arbitrary **1048580**. This makes the version code to be seemingly arbitrary and hard to read for humans. This PR proposes to change this calculation closer to google implementation of build number in Flutter (`abiVersionCode * 1000 + variant.versionCode`). https://github.com/flutter/flutter/blob/39d7a019c150ca421b980426e85b254a0ec63ebd/packages/flutter_tools/gradle/flutter.gradle#L643-L647 With this change, our app with `versionCode 4 versionName "4.0"` for `armeabi-v7a` will have **1004** as the version code instead of the seemingly arbitrary **1048580**. As you can see adopting the flutter style implementation make the version code easier to read and debug. **1004** **1** - The ABI Type `["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]` **004** - Our versionCode. Hopefully, this can prevent future issues like this #29790. ## Changelog [Android] [Changed] - Making Android versionCodeOverride for new apps using the template human-readable Pull Request resolved: #29808 Reviewed By: sammy-SC Differential Revision: D23804632 Pulled By: fkgozali fbshipit-source-id: 89b2c196b3bfe01fa608dfb595db6d3314ca1d63
- Loading branch information
Showing 1 changed file with 2 additions and 1 deletion.