Skip to content

Commit

Permalink
Fix versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
misl6 committed Sep 11, 2021
1 parent cad31be commit 3d54a35
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pythonforandroid/bootstraps/common/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,14 +408,17 @@ def make_package(args):

version_code = 0
if not args.numeric_version:
# Set version code in format (arch-minsdk-app_version)
arch_dict = {"x86_64": "9", "arm64-v8a": "8", "armeabi-v7a": "7", "x86": "6"}
arch_code = arch_dict.get(arch, '1')
"""
Set version code in format (10 + minsdk + app_version)
Historically versioning was (arch + minsdk + app_version),
with arch expressed with a single digit from 6 to 9.
Since the multi-arch support, has been changed to 10.
"""
min_sdk = args.min_sdk_version
for i in args.version.split('.'):
version_code *= 100
version_code += int(i)
args.numeric_version = "{}{}{}".format(arch_code, min_sdk, version_code)
args.numeric_version = "{}{}{}".format("10", min_sdk, version_code)

if args.intent_filters:
with open(args.intent_filters) as fd:
Expand Down

0 comments on commit 3d54a35

Please sign in to comment.