Skip to content

Commit d23c54a

Browse files
ajsinclaircopybara-github
authored andcommitted
Apply the Starlark Android Platforms Transition.
This applies the transition everywhere in the Android Rules where the native transition is currently applied. It also applies the transition to android_binary_internal which currently has no transition applied. Applying the transition is required for fullying Starlarkifying android_binary. This is a slight behavior change for android_binary_internal. However, since android_instrumentation_test already applies the transition, many android_binary_internal targets are already running in this config. PiperOrigin-RevId: 582713784 Change-Id: I454bc0ee588068de98615c9da0cf9d3da3287b4e
1 parent ca6df53 commit d23c54a

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

rules/android_application/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ bzl_library(
2222
name = "bzl",
2323
srcs = glob(["*.bzl"]),
2424
deps = [
25+
"//rules:android_platforms_transition_bzl",
2526
"//rules:common_bzl",
2627
"//rules/android_sandboxed_sdk:bzl",
2728
"//rules/flags:bzl",

rules/android_application/android_application_rule.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ load(
1919
_aapt = "aapt",
2020
)
2121
load("//rules:acls.bzl", _acls = "acls")
22+
load("//rules:android_platforms_transition.bzl", "android_platforms_transition")
2223
load(
2324
"//rules:bundletool.bzl",
2425
_bundletool = "bundletool",
@@ -388,7 +389,7 @@ def _impl(ctx):
388389

389390
android_application = rule(
390391
attrs = ANDROID_APPLICATION_ATTRS,
391-
cfg = android_common.android_platforms_transition,
392+
cfg = android_platforms_transition,
392393
fragments = [
393394
"android",
394395
"java",

rules/android_binary_internal/BUILD

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ filegroup(
1212
bzl_library(
1313
name = "bzl",
1414
srcs = glob(["*.bzl"]),
15+
visibility = ["//:__subpackages__"],
1516
deps = [
17+
"//rules:android_platforms_transition_bzl",
1618
"//rules:android_split_transition_bzl",
1719
"//rules:common_bzl",
1820
],
19-
visibility = ["//:__subpackages__"],
2021
)

rules/android_binary_internal/rule.bzl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414

1515
"""Starlark Android Binary for Android Rules."""
1616

17-
load(":attrs.bzl", "ATTRS")
18-
load(":impl.bzl", "impl")
17+
load("//rules:android_platforms_transition.bzl", "android_platforms_transition")
1918
load(
2019
"//rules:attrs.bzl",
2120
_attrs = "attrs",
2221
)
22+
load(":attrs.bzl", "ATTRS")
23+
load(":impl.bzl", "impl")
2324

2425
_DEFAULT_ALLOWED_ATTRS = ["name", "visibility", "tags", "testonly", "transitive_configs", "$enable_manifest_merging", "features", "exec_properties"]
2526

@@ -56,6 +57,7 @@ def make_rule(
5657
"java",
5758
"cpp",
5859
],
60+
cfg = android_platforms_transition,
5961
)
6062

6163
android_binary_internal = make_rule()

0 commit comments

Comments
 (0)