Skip to content

Commit abb4703

Browse files
authored
Merge pull request #1720 from OptimusGREEN/master
Generate android version code accounting for arch and min sdk
2 parents 36b418c + 27a87ce commit abb4703

File tree

1 file changed

+8
-1
lines changed
  • pythonforandroid/bootstraps/common/build

1 file changed

+8
-1
lines changed

pythonforandroid/bootstraps/common/build/build.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,17 @@ def make_package(args):
360360

361361
version_code = 0
362362
if not args.numeric_version:
363+
# Set version code in format (arch-minsdk-app_version)
364+
with open(join(dirname(__file__), 'dist_info.json'), 'r') as dist_info:
365+
dist_data = json.load(dist_info)
366+
arch = dist_data["archs"][0]
367+
arch_dict = {"arm64-v8a": "8", "armeabi-v7a": "7", "x86": "6"}
368+
arch_code = arch_dict[arch]
369+
min_sdk = args.min_sdk_version
363370
for i in args.version.split('.'):
364371
version_code *= 100
365372
version_code += int(i)
366-
args.numeric_version = str(version_code)
373+
args.numeric_version = "{}{}{}".format(arch_code, min_sdk, version_code)
367374

368375
if args.intent_filters:
369376
with open(args.intent_filters) as fd:

0 commit comments

Comments
 (0)