Skip to content

Commit

Permalink
Merge pull request #1720 from OptimusGREEN/master
Browse files Browse the repository at this point in the history
Generate android version code accounting for arch and min sdk
  • Loading branch information
inclement authored Feb 25, 2019
2 parents 36b418c + 27a87ce commit abb4703
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pythonforandroid/bootstraps/common/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,17 @@ def make_package(args):

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

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

0 comments on commit abb4703

Please sign in to comment.