-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for alternate app icons in UIKit via actool in Xcode 14+ …
…(first introduced in 13). PiperOrigin-RevId: 578548155
- Loading branch information
1 parent
e8e7a0c
commit 6fc1952
Showing
15 changed files
with
209 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -190,6 +190,47 @@ def ios_application_resources_test_suite(name): | |
tags = [name], | ||
) | ||
|
||
# Test that when alternate app icons are declared alongside the primary app icon, that they are | ||
# bundled in expected locations with the app, that they are embedded within the plist | ||
# referencing their file names, and that they are also bundled within the asset catalog for the | ||
# application. | ||
archive_contents_test( | ||
name = "{}_alt_app_icons_test".format(name), | ||
build_type = "device", | ||
target_under_test = "//test/starlark_tests/targets_under_test/ios:app_with_alternate_app_icons", | ||
contains = [ | ||
"$BUNDLE_ROOT/[email protected]", | ||
"$BUNDLE_ROOT/app_icon76x76@2x~ipad.png", | ||
"$BUNDLE_ROOT/[email protected]", | ||
"$BUNDLE_ROOT/app_icon-bazel76x76@2x~ipad.png", | ||
], | ||
plist_test_file = "$CONTENT_ROOT/Info.plist", | ||
plist_test_values = { | ||
"CFBundleIcons:CFBundlePrimaryIcon:CFBundleIconFiles:0": "app_icon", | ||
"CFBundleIcons:CFBundleAlternateIcons:CFBundleIconFiles:0": "app_icon-bazel", | ||
}, | ||
text_test_file = "$BUNDLE_ROOT/Assets.car", | ||
text_test_values = ["app_icon", "app_icon-bazel"], | ||
tags = [name], | ||
) | ||
|
||
analysis_failure_message_test( | ||
name = "{}_alt_app_icons_missing_primary_icon_name_test".format(name), | ||
target_under_test = "//test/starlark_tests/targets_under_test/ios:app_with_alternate_app_icons_without_primary", | ||
expected_error = """ | ||
Found multiple app icons among the asset catalogs with no primary_app_icon assigned. | ||
If you intend to assign multiple app icons to this target, please declare which of these is intended | ||
to be the primary app icon with the primary_app_icon attribute on the rule itself. | ||
app_icons was assigned the following: [ | ||
third_party/bazel_rules/rules_apple/test/starlark_tests/resources/app_icons_with_alts_ios.xcassets/app_icon-bazel.appiconset, | ||
third_party/bazel_rules/rules_apple/test/starlark_tests/resources/app_icons_with_alts_ios.xcassets/app_icon.appiconset | ||
] | ||
""", | ||
tags = [name], | ||
) | ||
|
||
# Tests that apple_bundle_import files are bundled correctly with the application. | ||
archive_contents_test( | ||
name = "{}_apple_bundle_test".format(name), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+10 KB
...urces/app_icons_with_alts_ios.xcassets/app_icon-bazel.appiconset/Bazel_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions
14
..._tests/resources/app_icons_with_alts_ios.xcassets/app_icon-bazel.appiconset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Bazel_logo.png", | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"size" : "1024x1024" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...arlark_tests/resources/app_icons_with_alts_ios.xcassets/app_icon.appiconset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "app_icon.png", | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"size" : "1024x1024" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} | ||
|
Binary file added
BIN
+22.5 KB
...sts/resources/app_icons_with_alts_ios.xcassets/app_icon.appiconset/app_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
6fc1952
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#2505