Skip to content

Commit

Permalink
Merge pull request #1380 from freakboy3742/naming-clash
Browse files Browse the repository at this point in the history
Resolve naming ambiguity
  • Loading branch information
freakboy3742 authored Jul 23, 2023
2 parents b021d6d + 61a1da2 commit 2b29a42
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
1 change: 1 addition & 0 deletions changes/1379.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The inadvertent override of the build_method introduced by #1377 was resolved.
39 changes: 17 additions & 22 deletions src/briefcase/platforms/android/gradle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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),
)

Expand Down

0 comments on commit 2b29a42

Please sign in to comment.