Add Starlark flags attribute to remaining Android rules and test rules. When `--incompatible_remove_ctx_android_fragment` is enabled, `ctx.fragments.android` is no longer available and `read_possibly_native_flag` reads Android flags exclusively from `ctx.attr._wrapped_flags`. Add `_attrs.FLAGS_ATTRS` to `ANDROID_APPLICATION_ATTRS` and `android_archive`'s `ATTRS`, and add `_wrapped_flags` to the resource and dex test rules that invoke `read_possibly_native_flag` so they succeed without the native `android` configuration fragment. PiperOrigin-RevId: 995749866 Change-Id: Ib7dcbf28cf2e9fb7ca7403d21804e06979d8f174
diff --git a/rules/android_application/attrs.bzl b/rules/android_application/attrs.bzl index 42116be..e6fa966 100644 --- a/rules/android_application/attrs.bzl +++ b/rules/android_application/attrs.bzl
@@ -83,6 +83,7 @@ ), ), _attrs.ANDROID_SDK, + _attrs.FLAGS_ATTRS, ) ANDROID_FEATURE_MODULE_ATTRS = dict(
diff --git a/test/rules/resources/test.bzl b/test/rules/resources/test.bzl index f85fdf2..39eaf64 100644 --- a/test/rules/resources/test.bzl +++ b/test/rules/resources/test.bzl
@@ -380,6 +380,7 @@ _manifest_merge_order = attr.label( default = "//rules/flags:manifest_merge_order", ), + _wrapped_flags = ANDROID_BINARY_ATTRS.get("_wrapped_flags"), ), toolchains = [ "//toolchains/android:toolchain_type",