Skip to content

Commit

Permalink
Adding support for specifying additional am instrument args in Inst…
Browse files Browse the repository at this point in the history
…rumentationArgs.

PiperOrigin-RevId: 636703536
Change-Id: Ie97e4a3878966e9c6421da0cff4bf5839e241b29
  • Loading branch information
A Googler authored and copybara-github committed May 23, 2024
1 parent fa29e70 commit 0fd5dbc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion launcher/instrumentation.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ InstrumentationArgsInfo = provider(
"enable_debug": "Enable debugging.",
"no_window_animation": "Disable window animation.",
"use_test_storage_service": "Add '-e useTestStorageService true' to 'am instrument'.",
"args": "Extra options to pass to adb instrument with -e.",
"additional_args": "([str]) Add these args directly to 'am instrument'.",
"args": "({str:str}) Extra options to pass to am instrument with -e.",
},
)

Expand All @@ -162,6 +163,8 @@ def instrumentation_args_message(target):
for k, v in info.args.items()
],
)
if info.additional_args:
message["additional_args"] = info.additional_args
return struct(**message)

def _instrumentation_args_impl(ctx):
Expand All @@ -170,6 +173,7 @@ def _instrumentation_args_impl(ctx):
no_window_animation = ctx.attr.no_window_animation,
use_test_storage_service = ctx.attr.use_test_storage_service,
args = ctx.attr.args,
additional_args = ctx.attr.additional_args,
)]

instrumentation_args = rule(
Expand All @@ -190,5 +194,8 @@ instrumentation_args = rule(
args = attr.string_dict(
doc = "Extra instrumentation options to pass with -e.",
),
additional_args = attr.string_list(
doc = "Add these args directly to `am instrument`.",
),
),
)

0 comments on commit 0fd5dbc

Please sign in to comment.