From 0fd5dbc6da9d1d0588d30fd0bbd5a5b24c41636a Mon Sep 17 00:00:00 2001 From: A Googler Date: Thu, 23 May 2024 15:53:59 -0700 Subject: [PATCH] Adding support for specifying additional `am instrument` args in InstrumentationArgs. PiperOrigin-RevId: 636703536 Change-Id: Ie97e4a3878966e9c6421da0cff4bf5839e241b29 --- launcher/instrumentation.bzl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/launcher/instrumentation.bzl b/launcher/instrumentation.bzl index 8f8bb87..b8d93f5 100644 --- a/launcher/instrumentation.bzl +++ b/launcher/instrumentation.bzl @@ -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.", }, ) @@ -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): @@ -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( @@ -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`.", + ), ), )