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 (fixes #923)
  • Loading branch information
Vakhid Betrakhmadov committed Sep 24, 2024
1 parent 9e72bb6 commit ac2ed50
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 ac2ed50

Please sign in to comment.