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

Support overriding debuggable in AndroidManifest #13801 #238

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
7 changes: 1 addition & 6 deletions rules/flags/flags.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,7 @@ def native_bool_flag_macro(name, description):
)

def _get_bool(v):
v = v.lower()
if v == "true":
return True
if v == "false":
return False
fail("Unknown bool: " + v)
return utils.get_bool(v)

def _bool_impl(ctx):
if ctx.label.name in ctx.var:
Expand Down
3 changes: 2 additions & 1 deletion rules/resources.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ def _package(
resource_files_zip = ctx.actions.declare_file(
"_migrated/" + ctx.label.name + "_files/resource_files.zip",
)
debug = utils.get_bool(manifest_values["debuggable"]) if "debuggable" in manifest_values else None
_busybox.package(
ctx,
out_file = resource_apk,
Expand Down Expand Up @@ -785,7 +786,7 @@ def _package(
aapt = aapt,
busybox = busybox,
host_javabase = host_javabase,
debug = compilation_mode != _compilation_mode.OPT,
debug = compilation_mode != _compilation_mode.OPT if debug == None else debug,
should_throw_on_conflict = should_throw_on_conflict,
)

Expand Down
9 changes: 9 additions & 0 deletions rules/utils.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,14 @@ def _get_compilation_mode(ctx):
"""
return ctx.var["COMPILATION_MODE"]

def _get_bool(v):
v = v.lower()
if v == "true":
return True
if v == "false":
return False
fail("Unknown bool: " + v)

compilation_mode = struct(
DBG = "dbg",
FASTBUILD = "fastbuild",
Expand All @@ -466,6 +474,7 @@ utils = struct(
list_or_depset_to_list = _list_or_depset_to_list,
add_cls_prefix = _add_cls_prefix,
get_cls = _get_cls,
get_bool = _get_bool
)

log = struct(
Expand Down