From 96a9a2baa31da9d11e3cdaf152241991ae832f35 Mon Sep 17 00:00:00 2001 From: jingwen Date: Tue, 23 Jan 2018 08:53:11 -0800 Subject: Pass the correct path of aapt_binary and merge its data runfiles into android_instrumentation_test's runfiles. GITHUB: #903 RELNOTES: None. PiperOrigin-RevId: 182940009 --- .../devtools/build/lib/rules/android/AndroidInstrumentationTest.java | 3 ++- .../build/lib/rules/android/android_instrumentation_test_template.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTest.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTest.java index 33dee6c938..96ea978498 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTest.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTest.java @@ -85,7 +85,7 @@ public class AndroidInstrumentationTest implements RuleConfiguredTargetFactory { .addTargets(runfilesDeps, RunfilesProvider.DEFAULT_RUNFILES) .addTransitiveArtifacts(AndroidCommon.getSupportApks(ruleContext)) .addTransitiveArtifacts(getAdb(ruleContext).getFilesToRun()) - .addTransitiveArtifacts(getAapt(ruleContext).getFilesToRun()) + .merge(getAapt(ruleContext).getRunfilesSupport()) .addArtifacts(getDataDeps(ruleContext)) .build(); @@ -121,6 +121,7 @@ public class AndroidInstrumentationTest implements RuleConfiguredTargetFactory { .add(Substitution.of("%workspace%", ruleContext.getWorkspaceName())) .add(Substitution.of("%test_label%", ruleContext.getLabel().getCanonicalForm())) .add(executableSubstitution("%adb%", getAdb(ruleContext))) + .add(executableSubstitution("%aapt%", getAapt(ruleContext))) .add(executableSubstitution("%device_script%", getTargetDevice(ruleContext))) .add(executableSubstitution("%test_entry_point%", getTestEntryPoint(ruleContext))) .add(artifactSubstitution("%target_apk%", getTargetApk(ruleContext))) diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/android_instrumentation_test_template.txt b/src/main/java/com/google/devtools/build/lib/rules/android/android_instrumentation_test_template.txt index 07dd76ce6b..b2863c1f35 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/android_instrumentation_test_template.txt +++ b/src/main/java/com/google/devtools/build/lib/rules/android/android_instrumentation_test_template.txt @@ -44,7 +44,7 @@ test_entry_point="%test_entry_point%" log_levels="%log_levels%" WORKSPACE_DIR="${TEST_SRCDIR}/%workspace%" adb="${WORKSPACE_DIR}/%adb%" -aapt="${WORKSPACE_DIR}/../../external/androidsdk/aapt_binary" +aapt="${WORKSPACE_DIR}/%aapt%" device_script="${WORKSPACE_DIR}/%device_script%" data_deps="%data_deps%" -- cgit v1.2.3