From ef5e6f9fd4dedf7bdce19251b7079a1f080e89d2 Mon Sep 17 00:00:00 2001 From: Ivan Golub Date: Tue, 23 May 2023 10:40:08 -0700 Subject: [PATCH 1/2] Allow to collect resources from implementaion_deps --- apple/internal/aspects/resource_aspect.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apple/internal/aspects/resource_aspect.bzl b/apple/internal/aspects/resource_aspect.bzl index e4486186a7..ca977ba7aa 100644 --- a/apple/internal/aspects/resource_aspect.bzl +++ b/apple/internal/aspects/resource_aspect.bzl @@ -256,9 +256,9 @@ def _apple_resource_aspect_impl(target, ctx): ), ) - # Get the providers from dependencies, referenced by deps and locations for resources. + # Get the providers from dependencies, referenced by deps, impl_deps and locations for resources. inherited_providers = [] - provider_deps = ["deps"] + collect_args.get("res_attrs", []) + provider_deps = ["deps"] + ["implementation_deps"] + collect_args.get("res_attrs", []) for attr in provider_deps: if hasattr(ctx.rule.attr, attr): inherited_providers.extend([ @@ -292,7 +292,7 @@ def _apple_resource_aspect_impl(target, ctx): apple_resource_aspect = aspect( implementation = _apple_resource_aspect_impl, - attr_aspects = ["data", "deps", "resources", "structured_resources"], + attr_aspects = ["data", "deps", "implementation_deps", "resources", "structured_resources"], attrs = dicts.add( apple_support.action_required_attrs(), apple_toolchain_utils.shared_attrs(), From 279733cb98c43b0fac1937b2ee120ec594f081a5 Mon Sep 17 00:00:00 2001 From: Ivan Golub Date: Tue, 23 May 2023 12:26:37 -0700 Subject: [PATCH 2/2] Add tests --- test/ios_application_resources_test.sh | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test/ios_application_resources_test.sh b/test/ios_application_resources_test.sh index 397d1fe3da..a4d92413be 100755 --- a/test/ios_application_resources_test.sh +++ b/test/ios_application_resources_test.sh @@ -222,6 +222,42 @@ EOF assert_equals "2" "$atlasc_count" } +function test_implementation_deps_resourcess() { + create_common_files + cat >> app/BUILD < app/shared_res/foo.txt + + do_build ios //app:app || fail "Should build" + + assert_zip_contains "test-bin/app/app.ipa" \ + "Payload/app.app/foo.txt" +} + # Verify that the warning about 76x76 icons doesn't get displayed. function test_actool_hides_warning_about_76x76_icons() { create_common_files