Index: build/config/android/internal_rules.gni |
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni |
index 90867ed48b160c22a1fab68aa46d0f3f180111b1..60f276e0c03b6957f70cf9c8e5e4cac8c5624f3d 100644 |
--- a/build/config/android/internal_rules.gni |
+++ b/build/config/android/internal_rules.gni |
@@ -452,6 +452,11 @@ template("write_build_config") { |
rebase_path(invoker.proguard_info, root_build_dir), |
] |
} |
+ |
+ if (defined(invoker.apk_path)) { |
+ _rebased_apk_path = rebase_path(invoker.apk_path, root_build_dir) |
+ args += [ "--apk-path=$_rebased_apk_path" ] |
+ } |
} |
if (defined(invoker.srcjar)) { |
@@ -530,8 +535,8 @@ template("process_java_prebuilt") { |
group(target_name) { |
forward_variables_from(invoker, [ "visibility" ]) |
public_deps = [ |
- ":${target_name}__ijar", |
":$_output_jar_target", |
+ ":${target_name}__ijar", |
] |
} |
} |
@@ -1754,10 +1759,18 @@ template("test_runner_script") { |
invoker.test_suite, |
] |
} else if (_test_type == "instrumentation") { |
- assert(defined(invoker.test_apk)) |
+ deps = [ |
+ "${invoker.apk_target}__build_config", |
+ ] |
+ _build_config = |
+ get_label_info(invoker.apk_target, "target_gen_dir") + "/" + |
+ get_label_info(invoker.apk_target, "name") + ".build_config" |
+ _rebased_build_config = rebase_path(_build_config, root_build_dir) |
test_runner_args += [ |
"--test-apk", |
- invoker.test_apk, |
+ "@FileArg($_rebased_build_config:deps_info:apk_path)", |
+ "--apk-under-test", |
+ "@FileArg($_rebased_build_config:deps_info:tested_apk_path)", |
] |
} else { |
assert(false, "Invalid test type: $_test_type.") |