Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix aar build #1444

Merged
merged 2 commits into from
Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion buildozer/default.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
2 changes: 1 addition & 1 deletion buildozer/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
mzakharo marked this conversation as resolved.
Show resolved Hide resolved
self.buildozer.build()

def cmd_release(self, *args):
Expand Down
5 changes: 4 additions & 1 deletion buildozer/targets/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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'\'" ,'
Expand Down