From c0235237c52fd0d74856a2e55b392b9f1040e9f4 Mon Sep 17 00:00:00 2001 From: RobertFlatt Date: Mon, 28 Dec 2020 15:46:25 -1000 Subject: [PATCH 01/11] Enable AndroidX --- doc/source/buildoptions.rst | 1 + pythonforandroid/bootstraps/common/build/build.py | 7 +++++++ .../bootstraps/common/build/templates/gradle.properties | 2 ++ 3 files changed, 10 insertions(+) create mode 100644 pythonforandroid/bootstraps/common/build/templates/gradle.properties diff --git a/doc/source/buildoptions.rst b/doc/source/buildoptions.rst index 13a7649027..5e798eb3dd 100644 --- a/doc/source/buildoptions.rst +++ b/doc/source/buildoptions.rst @@ -92,6 +92,7 @@ options (this list may not be exhaustive): run. See :ref:`arbitrary_scripts_services`. - ``--add-source``: Add a source directory to the app's Java code. - ``--no-compile-pyo``: Do not optimise .py files to .pyo. +- ``--enable-androidx``: Enable the AndroidX support library. webview diff --git a/pythonforandroid/bootstraps/common/build/build.py b/pythonforandroid/bootstraps/common/build/build.py index 7d54a6f02b..8cc9e36d44 100644 --- a/pythonforandroid/bootstraps/common/build/build.py +++ b/pythonforandroid/bootstraps/common/build/build.py @@ -327,6 +327,9 @@ def make_package(args): join(res_dir, 'drawable/icon.png') ) + if args.enable_androidx: + shutil.copy('templates/gradle.properties','gradle.properties') + if get_bootstrap_name() != "service_only": lottie_splashscreen = join(res_dir, 'raw/splashscreen.json') if args.presplash_lottie: @@ -679,6 +682,10 @@ def parse_args_and_make_package(args=None): 'topics/manifest/' 'activity-element.html')) + ap.add_argument('--enable-androidx', dest='enable_androidx', + action='store_true', + help=('Enable the AndroidX support library, ' + 'requires api = 28 or greater')) ap.add_argument('--android-entrypoint', dest='android_entrypoint', default='org.kivy.android.PythonActivity', help='Defines which java class will be used for startup, usually a subclass of PythonActivity') diff --git a/pythonforandroid/bootstraps/common/build/templates/gradle.properties b/pythonforandroid/bootstraps/common/build/templates/gradle.properties new file mode 100644 index 0000000000..646c51b977 --- /dev/null +++ b/pythonforandroid/bootstraps/common/build/templates/gradle.properties @@ -0,0 +1,2 @@ +android.useAndroidX=true +android.enableJetifier=true From 378b0251a7f941f88df1afea64e48abe605fb1eb Mon Sep 17 00:00:00 2001 From: RobertFlatt Date: Mon, 28 Dec 2020 16:00:39 -1000 Subject: [PATCH 02/11] pep8 whitespace --- pythonforandroid/bootstraps/common/build/build.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pythonforandroid/bootstraps/common/build/build.py b/pythonforandroid/bootstraps/common/build/build.py index 8cc9e36d44..f1c3812811 100644 --- a/pythonforandroid/bootstraps/common/build/build.py +++ b/pythonforandroid/bootstraps/common/build/build.py @@ -328,8 +328,8 @@ def make_package(args): ) if args.enable_androidx: - shutil.copy('templates/gradle.properties','gradle.properties') - + shutil.copy('templates/gradle.properties', 'gradle.properties') + if get_bootstrap_name() != "service_only": lottie_splashscreen = join(res_dir, 'raw/splashscreen.json') if args.presplash_lottie: From 137411f7b6ef3a7cf34f9417bf2e557c9b806314 Mon Sep 17 00:00:00 2001 From: RobertFlatt Date: Sun, 24 Jan 2021 10:13:08 -1000 Subject: [PATCH 03/11] Add support for Kotlin packages --- .../bootstraps/common/build/templates/build.tmpl.gradle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pythonforandroid/bootstraps/common/build/templates/build.tmpl.gradle b/pythonforandroid/bootstraps/common/build/templates/build.tmpl.gradle index c7305298f3..b59ee6df41 100644 --- a/pythonforandroid/bootstraps/common/build/templates/build.tmpl.gradle +++ b/pythonforandroid/bootstraps/common/build/templates/build.tmpl.gradle @@ -76,8 +76,13 @@ android { } compileOptions { + {% if args.enable_androidx %} + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + {% else %} sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 + {% endif %} {%- for option in args.compile_options %} {{option}} {%- endfor %} From 899afae7d31aea8a8657e706794d7d4f38a7dfb3 Mon Sep 17 00:00:00 2001 From: RobertFlatt Date: Thu, 11 Feb 2021 14:15:48 -1000 Subject: [PATCH 04/11] Build option default ON for demo. --- pythonforandroid/bootstraps/common/build/build.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pythonforandroid/bootstraps/common/build/build.py b/pythonforandroid/bootstraps/common/build/build.py index f1c3812811..bb07c9c77e 100644 --- a/pythonforandroid/bootstraps/common/build/build.py +++ b/pythonforandroid/bootstraps/common/build/build.py @@ -684,6 +684,7 @@ def parse_args_and_make_package(args=None): ap.add_argument('--enable-androidx', dest='enable_androidx', action='store_true', + default=True,# TEMP for DEMO ONLY help=('Enable the AndroidX support library, ' 'requires api = 28 or greater')) ap.add_argument('--android-entrypoint', dest='android_entrypoint', From e5be9d122604554d1083b494784a8769b45eaffd Mon Sep 17 00:00:00 2001 From: RobertFlatt Date: Thu, 11 Feb 2021 14:37:37 -1000 Subject: [PATCH 05/11] My error needed a new branch first This reverts commit 899afae7d31aea8a8657e706794d7d4f38a7dfb3. --- pythonforandroid/bootstraps/common/build/build.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pythonforandroid/bootstraps/common/build/build.py b/pythonforandroid/bootstraps/common/build/build.py index bb07c9c77e..f1c3812811 100644 --- a/pythonforandroid/bootstraps/common/build/build.py +++ b/pythonforandroid/bootstraps/common/build/build.py @@ -684,7 +684,6 @@ def parse_args_and_make_package(args=None): ap.add_argument('--enable-androidx', dest='enable_androidx', action='store_true', - default=True,# TEMP for DEMO ONLY help=('Enable the AndroidX support library, ' 'requires api = 28 or greater')) ap.add_argument('--android-entrypoint', dest='android_entrypoint', From e59ab9d208ffd90ec8d43b6dab0b6cce0f0b8229 Mon Sep 17 00:00:00 2001 From: RobertFlatt Date: Thu, 11 Feb 2021 18:06:42 -1000 Subject: [PATCH 06/11] retrigger checks From 27f784543eb5465c640e5b019aa9d586144216f1 Mon Sep 17 00:00:00 2001 From: RobertFlatt Date: Sun, 21 Feb 2021 16:50:41 -1000 Subject: [PATCH 07/11] retrigger checks From 54ba2c81dd774e6f4e1457041a34adaa63c89972 Mon Sep 17 00:00:00 2001 From: RobertFlatt Date: Sun, 21 Feb 2021 16:52:36 -1000 Subject: [PATCH 08/11] retrigger checks From 28002cb3701e48848abdbea8a7bcce923a310110 Mon Sep 17 00:00:00 2001 From: RobertFlatt Date: Sun, 21 Feb 2021 16:54:53 -1000 Subject: [PATCH 09/11] trigger GitHub actions From 704b88b8729c9962164a5e3efcf56f5497fc8355 Mon Sep 17 00:00:00 2001 From: RobertFlatt Date: Sun, 21 Feb 2021 17:49:56 -1000 Subject: [PATCH 10/11] Trigger Test From cec02547975fbb714eceae8d4384d79bbe089878 Mon Sep 17 00:00:00 2001 From: RobertFlatt Date: Sun, 21 Feb 2021 18:19:28 -1000 Subject: [PATCH 11/11] Trivial to force checks --- doc/source/buildoptions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/buildoptions.rst b/doc/source/buildoptions.rst index 5e798eb3dd..8db4efdaf4 100644 --- a/doc/source/buildoptions.rst +++ b/doc/source/buildoptions.rst @@ -92,7 +92,7 @@ options (this list may not be exhaustive): run. See :ref:`arbitrary_scripts_services`. - ``--add-source``: Add a source directory to the app's Java code. - ``--no-compile-pyo``: Do not optimise .py files to .pyo. -- ``--enable-androidx``: Enable the AndroidX support library. +- ``--enable-androidx``: Enable AndroidX support library. webview