From 6a685b67a8b745f1b3f5be1495d7e2e7a96a44fc Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Tue, 23 May 2023 09:18:50 -0600 Subject: [PATCH 1/6] Document some manifest build options The --extra-manifest-xml and --extra-manifest-application-arguments options are currently only handled by the sdl2 bootstrap while the --manifest-placeholders option is handled in the common build.gradle template. --- doc/source/buildoptions.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/source/buildoptions.rst b/doc/source/buildoptions.rst index 6497cc1d4e..ca650e9bdd 100644 --- a/doc/source/buildoptions.rst +++ b/doc/source/buildoptions.rst @@ -91,6 +91,12 @@ options (this list may not be exhaustive): - ``--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 AndroidX support library. +- ``--extra-manifest-xml``: Extra xml to write directly inside the + ```` element of AndroidManifest.xml. +- ``--extra-manifest-application-arguments``: Extra arguments to be + added to the ```` tag of AndroidManifest.xml. +- ``--manifest-placeholders``: Inject build variables into the manifest + via the ``manifestPlaceholders`` property. - ``--enable-google-services``: Enable the Google Services Gradle plugin. This option requires a ``google-services.json`` file in root of the project directory. @@ -160,6 +166,8 @@ ready. - ``add-source``: Add a source directory to the app's Java code. - ``--port``: The port on localhost that the WebView will access. Defaults to 5000. +- ``--manifest-placeholders``: Inject build variables into the manifest + via the ``manifestPlaceholders`` property. - ``--enable-google-services``: Enable the Google Services Gradle plugin. This option requires a ``google-services.json`` file in root of the project directory. From 455c5af021d453e37fa2ab7f5c44992bb9de5197 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Tue, 23 May 2023 11:12:12 -0600 Subject: [PATCH 2/6] Support --extra-manifest-xml in webview and service_only bootstraps --- doc/source/buildoptions.rst | 2 ++ .../service_only/build/templates/AndroidManifest.tmpl.xml | 2 ++ .../bootstraps/webview/build/templates/AndroidManifest.tmpl.xml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/doc/source/buildoptions.rst b/doc/source/buildoptions.rst index ca650e9bdd..4f6b3a5aa3 100644 --- a/doc/source/buildoptions.rst +++ b/doc/source/buildoptions.rst @@ -166,6 +166,8 @@ ready. - ``add-source``: Add a source directory to the app's Java code. - ``--port``: The port on localhost that the WebView will access. Defaults to 5000. +- ``--extra-manifest-xml``: Extra xml to write directly inside the + ```` element of AndroidManifest.xml. - ``--manifest-placeholders``: Inject build variables into the manifest via the ``manifestPlaceholders`` property. - ``--enable-google-services``: Enable the Google Services Gradle plugin. diff --git a/pythonforandroid/bootstraps/service_only/build/templates/AndroidManifest.tmpl.xml b/pythonforandroid/bootstraps/service_only/build/templates/AndroidManifest.tmpl.xml index d19ed32931..cc94327eda 100644 --- a/pythonforandroid/bootstraps/service_only/build/templates/AndroidManifest.tmpl.xml +++ b/pythonforandroid/bootstraps/service_only/build/templates/AndroidManifest.tmpl.xml @@ -35,6 +35,8 @@ {% endif %} + {{ args.extra_manifest_xml }} +