Skip to content

Commit 0bd777f

Browse files
sfreilichcopybara-github
authored andcommitted
Declare that android_local_test provides JavaInfo
It's best practice for rules to declare which providers they provide. That allows aspects to make better tradeoffs between correctness and efficiency: It's possible to restrict which targets an aspect propagates to with `aspect.required_providers`, but since that pruning is done _before_ analysis, it restricts that based on `rule.providers`, not what the rule actually returns (which can be a super-set of what's in `rule.providers`). PiperOrigin-RevId: 863236597 Change-Id: I47f15a5ed51a247a32286663ed5ba8c4609d75fe
1 parent d8336b1 commit 0bd777f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

rules/android_local_test/rule.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
load("//rules:utils.bzl", "ANDROID_SDK_TOOLCHAIN_TYPE")
1717
load("//rules:visibility.bzl", "PROJECT_VISIBILITY")
18+
load("@rules_java//java/common:java_info.bzl", "JavaInfo")
1819
load(":attrs.bzl", "ATTRS")
1920
load(":impl.bzl", "impl")
2021

@@ -52,6 +53,7 @@ def make_rule(
5253
ANDROID_SDK_TOOLCHAIN_TYPE,
5354
"@bazel_tools//tools/jdk:toolchain_type",
5455
] + additional_toolchains,
56+
provides = [JavaInfo],
5557
)
5658

5759
android_local_test = make_rule()

0 commit comments

Comments
 (0)