diff --git a/buildozer/default.spec b/buildozer/default.spec index 677b59be4..36d28bcfd 100644 --- a/buildozer/default.spec +++ b/buildozer/default.spec @@ -283,9 +283,12 @@ android.allow_backup = True # (bool) disables the compilation of py to pyc/pyo files when packaging # android.no-compile-pyo = True -# (str) The format used to package the app for release mode (aab or apk). +# (str) The format used to package the app for release mode (aab or apk or aar). # android.release_artifact = aab +# (str) The format used to package the app for debug mode (apk or aar). +# android.debug_artifact = apk + # # Python for android (p4a) specific # diff --git a/buildozer/target.py b/buildozer/target.py index b9515f61f..a70b60f27 100644 --- a/buildozer/target.py +++ b/buildozer/target.py @@ -102,7 +102,7 @@ def cmd_update(self, *args): def cmd_debug(self, *args): self.buildozer.prepare_for_build() self.build_mode = 'debug' - self.artifact_format = 'apk' + self.artifact_format = self.buildozer.config.getdefault('app', 'android.debug_artifact', 'apk') self.buildozer.build() def cmd_release(self, *args): diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index 6d15b7ace..3722b5b61 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -992,7 +992,7 @@ def execute_build_package(self, build_cmd): def get_release_mode(self): # aab, also if unsigned is named as *-release - if self.check_p4a_sign_env() or self.artifact_format == "aab": + if self.check_p4a_sign_env() or self.artifact_format in ["aab", "aar"]: return "release" return "release-unsigned" @@ -1322,6 +1322,9 @@ def build_package(self): artifact_dir = join(dist_dir, "build", "outputs", "apk", mode_sign) elif self.artifact_format == "aab": artifact_dir = join(dist_dir, "build", "outputs", "bundle", mode_sign) + elif self.artifact_format == "aar": + artifact_dir = join(dist_dir, "build", "outputs", "aar") + else: # on ant, the apk use the title, and have version bl = u'\'" ,'