Skip to content

Commit

Permalink
android_test also needs the legacy behavior in RuleContext.getPrerequ…
Browse files Browse the repository at this point in the history
…isites.

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
  • Loading branch information
katre authored and laurentlb committed Oct 2, 2020
1 parent 32c88da commit db9fc88
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,9 @@ public List<? extends TransitiveInfoCollection> getPrerequisites(String attribut
}

List<ConfiguredTargetAndData> 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
Expand Down

0 comments on commit db9fc88

Please sign in to comment.