From db9fc88fed387f09067a9250a731f8bf9ad74b05 Mon Sep 17 00:00:00 2001 From: jcater Date: Fri, 11 Sep 2020 12:06:02 -0700 Subject: [PATCH] android_test also needs the legacy behavior in RuleContext.getPrerequisites. android_test inherits from android_binary and thus also has a split transition on "deps". I inspected the codebase and no other native rules have this issue. PiperOrigin-RevId: 331195354 --- .../com/google/devtools/build/lib/analysis/RuleContext.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java b/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java index 197bd38e1e5e5d..d08e51ccc6dfc5 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java @@ -1026,7 +1026,9 @@ public List getPrerequisites(String attribut } List prerequisiteConfiguredTargets; - if (getRule().getRuleClass().equals("android_binary") + // android_binary and android_test override deps to use a split transition. + if ((getRule().getRuleClass().equals("android_binary") + || getRule().getRuleClass().equals("android_test")) && attributeName.equals("deps") && attributes().getAttributeDefinition(attributeName).getTransitionFactory().isSplit()) { // TODO(b/168038145): Restore legacy behavior of returning the prerequisites from the first