Skip to content

Commit

Permalink
Select device_families by platform_type in precompiled_apple_resource…
Browse files Browse the repository at this point in the history
…_bundle (#924)

Fixes: #923

Co-authored-by: Vakhid Betrakhmadov <[email protected]>
  • Loading branch information
vakhidbetrakhmadov and Vakhid Betrakhmadov authored Nov 4, 2024
1 parent 9e72bb6 commit 18cd914
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion rules/precompiled_apple_resource_bundle.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ _FAKE_BUNDLE_PRODUCT_TYPE_BY_PLATFORM_TYPE = {
"watchos": apple_product_type.watch2_application,
}

_DEVICE_FAMILIES_BY_PLATFORM_TYPE = {
"ios": ["iphone", "ipad"],
"macos": ["mac"],
"tvos": ["tv"],
"visionos": ["vision"],
"watchos": ["watch"],
}

def _precompiled_apple_resource_bundle_impl(ctx):
bundle_name = ctx.attr.bundle_name or ctx.label.name

Expand All @@ -37,7 +45,7 @@ def _precompiled_apple_resource_bundle_impl(ctx):
platform_prerequisites = platform_support.platform_prerequisites(
apple_fragment = ctx.fragments.apple,
config_vars = ctx.var,
device_families = ["iphone", "ipad"],
device_families = _DEVICE_FAMILIES_BY_PLATFORM_TYPE[platform_type],
explicit_minimum_os = None,
explicit_minimum_deployment_os = None,
objc_fragment = None,
Expand Down

0 comments on commit 18cd914

Please sign in to comment.