Skip to content

[pull] master from facebook:master#313

Merged
pull[bot] merged 1 commit intoAlan-love:masterfrom
facebook:master
Sep 21, 2020
Merged

[pull] master from facebook:master#313
pull[bot] merged 1 commit intoAlan-love:masterfrom
facebook:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull bot commented Sep 21, 2020

See Commits and Changes for more details.


Created by pull[bot]. Want to support this open source service? Please star it : )

…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
@pull pull bot added the ⤵️ pull label Sep 21, 2020
@pull pull bot merged commit e1bf515 into Alan-love:master Sep 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant