From a815afc5e078f5cf54458e35c09f1faa48257e5f Mon Sep 17 00:00:00 2001 From: Andre Miras Date: Wed, 27 May 2020 18:56:51 +0200 Subject: [PATCH] :sparkles: Adds p4a --numeric-version support This flag is available in p4a and can be useful to have buildozer side too. Also refs #1079 --- buildozer/default.spec | 4 ++++ buildozer/targets/android.py | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/buildozer/default.spec b/buildozer/default.spec index 8e51d9b..f1d7b23 100644 --- a/buildozer/default.spec +++ b/buildozer/default.spec @@ -221,6 +221,10 @@ fullscreen = 0 # (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86, x86_64 android.arch = armeabi-v7a +# (int) overrides automatic versionCode computation (used in build.gradle) +# this is not the same as app version and should only be edited if you know what you're doing +# android.numeric_version = 1 + # # Python for android (p4a) specific # diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index 73a206b..a7eef95 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -1143,6 +1143,11 @@ class TargetAndroid(Target): if launch_mode: build_cmd += [("--activity-launch-mode", launch_mode)] + # numeric version + numeric_version = config.getdefault('app', 'android.numeric_version') + if numeric_version: + build_cmd += [("--numeric-version", numeric_version)] + # build only in debug right now. if self.build_mode == 'debug': build_cmd += [("debug", )]