Skip to content

Commit

Permalink
Stop populating providers AndroidDexInfo and StarlarkAndroidResources…
Browse files Browse the repository at this point in the history
…Info that are no longer used in the Starlark android_binary rule.

PiperOrigin-RevId: 632683211
Change-Id: I4a89b53b133cde044a85103b7b5f342fe58bfa9d
  • Loading branch information
Zhaoqing Xu authored and copybara-github committed May 11, 2024
1 parent b2eeac8 commit b79bca9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
4 changes: 3 additions & 1 deletion rules/android_binary_internal/impl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
30 changes: 16 additions & 14 deletions rules/resources.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit b79bca9

Please sign in to comment.