From d8bdec474b767c9a7897f4cd9ef0ede92242fd4f Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sun, 23 Jul 2023 17:56:54 +0200 Subject: [PATCH 1/2] Resolve naming ambiguity. --- src/briefcase/platforms/android/gradle.py | 39 ++++++++++------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/src/briefcase/platforms/android/gradle.py b/src/briefcase/platforms/android/gradle.py index 471172c3a..2826aba8d 100644 --- a/src/briefcase/platforms/android/gradle.py +++ b/src/briefcase/platforms/android/gradle.py @@ -76,22 +76,6 @@ def __init__(self, *args, **kwargs): def project_path(self, app): return self.bundle_path(app) - def package_name(self, app) -> Path: - package_name_dict = { - "aab": Path("bundle") / "release" / "app-release.aab", - "apk": Path("apk") / "release" / "app-release-unsigned.apk", - "debug-apk": Path("apk") / "debug" / "app-debug.apk", - } - return package_name_dict[app.packaging_format] - - def build_command(self, app): - command_dict = { - "aab": "bundleRelease", - "apk": "assembleRelease", - "debug-apk": "assembleDebug", - } - return command_dict[app.packaging_format] - def binary_path(self, app): return ( self.bundle_path(app) @@ -396,17 +380,28 @@ def package_app(self, app: BaseConfig, **kwargs): ) with self.input.wait_bar("Bundling..."): try: - self.run_gradle(app, [self.build_command(app)]) + self.run_gradle( + app, + [ + { + "aab": "bundleRelease", + "apk": "assembleRelease", + "debug-apk": "assembleDebug", + }[app.packaging_format] + ], + ) except subprocess.CalledProcessError as e: raise BriefcaseCommandError("Error while building project.") from e # Move artefact to final location. + build_artefact_path = { + "aab": Path("bundle") / "release" / "app-release.aab", + "apk": Path("apk") / "release" / "app-release-unsigned.apk", + "debug-apk": Path("apk") / "debug" / "app-debug.apk", + }[app.packaging_format] + self.tools.shutil.move( - self.bundle_path(app) - / "app" - / "build" - / "outputs" - / f"{self.package_name(app)}", + self.bundle_path(app) / "app" / "build" / "outputs" / build_artefact_path, self.distribution_path(app), ) From 61a1da252243368b3fe0a2175de5e7fb8e303be5 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sun, 23 Jul 2023 18:10:07 +0200 Subject: [PATCH 2/2] Add changenote. --- changes/1379.misc.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/1379.misc.rst diff --git a/changes/1379.misc.rst b/changes/1379.misc.rst new file mode 100644 index 000000000..2c5588e3c --- /dev/null +++ b/changes/1379.misc.rst @@ -0,0 +1 @@ +The inadvertent override of the build_method introduced by #1377 was resolved.