Skip to content

Commit

Permalink
Add a test to ensure the Starlark-exposed Android transitions are usa…
Browse files Browse the repository at this point in the history
…ble.

(This was accidentally broken with no tests by a pending change).

Part of bazelbuild#22248.

PiperOrigin-RevId: 631447201
Change-Id: Ie099705b35aff672efe0ee71b26d28aca2836a4f
  • Loading branch information
katre authored and Kila2 committed May 13, 2024
1 parent 9333677 commit d8bf7c9
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,31 @@ def _impl(ctx):
assertThat(fooJavaInfo.getJavaPluginInfo()).isNotNull();
assertThat(barJavaInfo.getJavaPluginInfo()).isNull();
}

@Test
public void androidPlatformsTransition() throws Exception {
scratch.file(
"java/android/compatible.bzl",
"""
def _impl(ctx):
pass
my_rule = rule(
implementation = _impl,
cfg = android_common.android_platforms_transition,
)
""");
scratch.file(
"java/android/BUILD",
"""
load(":compatible.bzl", "my_rule")
my_rule(
name = "bar",
)
""");

// Just check that the rule can be analyzed.
assertThat(getConfiguredTarget("//java/android:bar")).isNotNull();
}
}

0 comments on commit d8bf7c9

Please sign in to comment.