Skip to content

Commit

Permalink
Fix broken builds with Bazel < 6.4.0
Browse files Browse the repository at this point in the history
Which doesn't have `visionos` in the platform type API.
  • Loading branch information
thii committed Jan 23, 2024
1 parent ed2a4dd commit 99ea01b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion apple/internal/partials/app_assets_validation.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ load(
"partial",
)

_supports_visionos = hasattr(apple_common.platform_type, "visionos")

def _app_assets_validation_partial_impl(
*,
app_icons,
Expand Down Expand Up @@ -72,7 +74,8 @@ def _app_assets_validation_partial_impl(
extension = "brandassets",
files = app_icons,
)
elif platform_prerequisites.platform_type == apple_common.platform_type.visionos:
elif (_supports_visionos and
platform_prerequisites.platform_type == apple_common.platform_type.visionos):
message = ("visionOS apps must use visionOS app icon layers grouped in " +
".solidimagestack bundles, not traditional App Icon Sets")
bundling_support.ensure_single_xcassets_type(
Expand Down
5 changes: 4 additions & 1 deletion apple/internal/resource_actions/actool.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ load(
"paths",
)

_supports_visionos = hasattr(apple_common.platform_type, "visionos")

def _actool_args_for_special_file_types(
*,
asset_files,
Expand Down Expand Up @@ -107,7 +109,8 @@ def _actool_args_for_special_file_types(
elif platform_prerequisites.platform_type == apple_common.platform_type.tvos:
appicon_extension = "brandassets"
icon_files = [f for f in asset_files if ".brandassets/" in f.path]
elif platform_prerequisites.platform_type == apple_common.platform_type.visionos:
elif (_supports_visionos and
platform_prerequisites.platform_type == apple_common.platform_type.visionos):
appicon_extension = "solidimagestack"
icon_files = [f for f in asset_files if ".solidimagestack/" in f.path]
else:
Expand Down

0 comments on commit 99ea01b

Please sign in to comment.