From cb0599882ab4bf7f7348123d7ad9cdcd2e6fdc48 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 8e51d9b3c..6b5229637 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 yo're doing +# android.numeric_version = 1 + # # Python for android (p4a) specific # diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index 73a206b3d..a7eef954e 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -1143,6 +1143,11 @@ def build_package(self): 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", )]