Skip to content

Commit a8fe45c

Browse files
nglevinswiple-rules-gardener
authored andcommitted
Add failure when building apps with .icon bundles in Xcode prior to 26.
PiperOrigin-RevId: 779343706
1 parent a46ce2f commit a8fe45c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

apple/internal/resource_actions/actool.bzl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ load(
4545

4646
visibility("@build_bazel_rules_apple//apple/internal/...")
4747

48+
# TODO: b/425967223 - Rework the validation to better account for Xcode 26, and make it a bit more
49+
# readable via helper functions as we add more conditions.
50+
4851
def _actool_args_for_special_file_types(
4952
*,
5053
asset_files,
@@ -77,6 +80,7 @@ def _actool_args_for_special_file_types(
7780
platform_prerequisites.xcode_version_config.xcode_version() >=
7881
apple_common.dotted_version("26.0")
7982
)
83+
icon_files = []
8084
icon_bundle_files = []
8185

8286
if product_type == apple_product_type.messages_extension:
@@ -119,11 +123,16 @@ def _actool_args_for_special_file_types(
119123
appicon_extension = "solidimagestack"
120124
icon_files = [f for f in asset_files if ".solidimagestack/" in f.path]
121125
else:
122-
if is_xcode_26_or_later:
123-
icon_bundle_files = [f for f in asset_files if ".icon/" in f.path]
126+
icon_bundle_files = [f for f in asset_files if ".icon/" in f.path]
124127
appicon_extension = "appiconset"
125128
icon_files = [f for f in asset_files if ".appiconset/" in f.path]
126129

130+
if not is_xcode_26_or_later and len(icon_bundle_files):
131+
fail("""
132+
Found Icon Composer .icon bundles among the assigned app_icons. These are only supported \
133+
on Xcode 26 or later.
134+
""")
135+
127136
# Add arguments for app icons, if there are any.
128137
if icon_files or icon_bundle_files:
129138
icon_dirs = group_files_by_directory(

0 commit comments

Comments
 (0)