diff options
author | Zhaoqing Xu <zhaoqxu@google.com> | 2024-05-10 21:09:32 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-05-10 21:10:27 -0700 |
commit | b79bca933a924c0e028628577146dad6617cdbff (patch) | |
tree | 8e3cd862fac456365923cc531aaf7e3c15b204e1 | |
parent | b2eeac80297a2cc63f8b944096cdcf7de640b29c (diff) | |
download | bazelbuild-rules_android-upstream-main.tar.gz |
Stop populating providers AndroidDexInfo and StarlarkAndroidResourcesInfo that are no longer used in the Starlark android_binary rule.upstream-main
PiperOrigin-RevId: 632683211
Change-Id: I4a89b53b133cde044a85103b7b5f342fe58bfa9d
-rw-r--r-- | rules/android_binary_internal/impl.bzl | 4 | ||||
-rw-r--r-- | rules/resources.bzl | 30 |
2 files changed, 19 insertions, 15 deletions
diff --git a/rules/android_binary_internal/impl.bzl b/rules/android_binary_internal/impl.bzl index 93812c5..c7e405a 100644 --- a/rules/android_binary_internal/impl.bzl +++ b/rules/android_binary_internal/impl.bzl @@ -426,9 +426,11 @@ def _process_dex(ctx, validation_ctx, packaged_resources_ctx, deploy_ctx, bp_ctx final_proguard_output_map = final_proguard_output_map, java_resource_jar = binary_jar if ctx.fragments.android.get_java_resources_from_optimized_jar else deploy_jar, ) - providers.append(dex_info) providers.append(AndroidPreDexJarInfo(binary_jar)) + if not acls.in_android_binary_starlark_rollout(str(ctx.label)): + providers.append(dex_info) + if postprocessing_output_map: providers.append(ProguardMappingInfo(postprocessing_output_map)) diff --git a/rules/resources.bzl b/rules/resources.bzl index 4d3575a..435a33e 100644 --- a/rules/resources.bzl +++ b/rules/resources.bzl @@ -580,6 +580,7 @@ def _package( busybox: FilesToRunProvider. The ResourceBusyBox executable or FilesToRunprovider host_javabase: A Target. The host javabase. + # TODO(b/308978693): Delete this after Starlark android_binary starlark migration is complete. add_application_resource_info_to_providers: boolean. Whether to add the AndroidApplicationResourceInfo provider to the list of providers for this processor. @@ -834,20 +835,21 @@ def _package( # Adding empty depsets to unused fields of StarlarkAndroidResourcesInfo. # Some root targets may depends on other root targets and try to access those fields. - packaged_resources_ctx[_PROVIDERS].append(StarlarkAndroidResourcesInfo( - direct_resources_nodes = depset(), - transitive_resources_nodes = depset(), - transitive_assets = depset(), - transitive_assets_symbols = depset(), - transitive_compiled_assets = depset(), - transitive_resource_files = depset(), - direct_compiled_resources = depset(), - transitive_compiled_resources = depset(), - transitive_manifests = depset(), - transitive_r_txts = depset(), - packages_to_r_txts = packages_to_r_txts, - transitive_resource_apks = depset(), - )) + if not acls.in_android_binary_starlark_rollout(str(ctx.label)): + packaged_resources_ctx[_PROVIDERS].append(StarlarkAndroidResourcesInfo( + direct_resources_nodes = depset(), + transitive_resources_nodes = depset(), + transitive_assets = depset(), + transitive_assets_symbols = depset(), + transitive_compiled_assets = depset(), + transitive_resource_files = depset(), + direct_compiled_resources = depset(), + transitive_compiled_resources = depset(), + transitive_manifests = depset(), + transitive_r_txts = depset(), + packages_to_r_txts = packages_to_r_txts, + transitive_resource_apks = depset(), + )) android_application_resource_info = AndroidApplicationResourceInfo( resource_apk = resource_apk, |