diff --git a/apple/internal/resource_rules/apple_precompiled_resource_bundle.bzl b/apple/internal/resource_rules/apple_precompiled_resource_bundle.bzl index 6ac7624a1..f09aa602e 100644 --- a/apple/internal/resource_rules/apple_precompiled_resource_bundle.bzl +++ b/apple/internal/resource_rules/apple_precompiled_resource_bundle.bzl @@ -112,11 +112,40 @@ def _apple_precompiled_resource_bundle_impl(ctx): "rule_label": label, } + if ctx.files.infoplists: + infoplists = resources.collect( + attr = ctx.attr, + res_attrs = ["infoplists"], + ) + else: + infoplists = resources.collect( + attr = ctx.attr, + res_attrs = ["_fallback_infoplist"], + ) + + bucketized_owners, unowned_resources, buckets = resources.bucketize_typed_data( + bucket_type = "infoplists", + owner = owner, + parent_dir_param = bundle_name, + resources = infoplists, + **bucketize_args + ) + apple_resource_infos.append( + resources.process_bucketized_data( + bucketized_owners = bucketized_owners, + buckets = buckets, + platform_prerequisites = platform_prerequisites, + processing_owner = owner, + resource_types_to_process = ["infoplists"], + unowned_resources = unowned_resources, + **process_args + ), + ) + resource_files = resources.collect( attr = ctx.attr, res_attrs = ["resources"], ) - if resource_files: bucketized_owners, unowned_resources, buckets = resources.bucketize_data( resources = resource_files, @@ -183,37 +212,6 @@ def _apple_precompiled_resource_bundle_impl(ctx): ), ) - if ctx.files.infoplists: - infoplists = resources.collect( - attr = ctx.attr, - res_attrs = ["infoplists"], - ) - else: - infoplists = resources.collect( - attr = ctx.attr, - res_attrs = ["_fallback_infoplist"], - ) - - if infoplists and apple_resource_infos: - bucketized_owners, unowned_resources, buckets = resources.bucketize_typed_data( - bucket_type = "infoplists", - owner = owner, - parent_dir_param = bundle_name, - resources = infoplists, - **bucketize_args - ) - apple_resource_infos.append( - resources.process_bucketized_data( - bucketized_owners = bucketized_owners, - buckets = buckets, - platform_prerequisites = platform_prerequisites, - processing_owner = owner, - resource_types_to_process = ["infoplists"], - unowned_resources = unowned_resources, - **process_args - ), - ) - # Get the providers from dependencies inherited_apple_resource_infos = [ x[AppleResourceInfo]