rules_apple icon indicating copy to clipboard operation
rules_apple copied to clipboard

Support Alternate Icons in Asset Catalogs (Xcode 13+)

Open dflems opened this issue 3 years ago • 6 comments

https://katzenbaer.medium.com/alternate-app-icons-using-asset-catalogs-in-xcode-13-da6387d1cd78

Xcode 13+ lets you put alternate icons in asset catalogs now. This could be probably be supported by ios_application and friends in a backwards compatible way:

ios_application(
    name = "MyApp",
    resources = glob(["CatalogIncludingAlternateIcons.xcassets/**"]),
    appicon_name = "AppIcon",

    # equivalent of ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS
    # pass --include-all-app-icons into actool in Xcode 13+
    # copy all appiconset images into the bundle in Xcode 12 and under
    include_all_appicons = True,

    # equivalent of ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES
    # pass --alternate-app-icon into actool for each one in Xcode 13+
    # copy these appiconsets into the bundle in Xcode 12 and under, exclude others
    alternate_app_icons = ["alticon1", "alticon2"],
)

dflems avatar Nov 12 '21 20:11 dflems

https://github.com/bazelbuild/rules_apple/pull/1032 ?

keith avatar Nov 12 '21 21:11 keith

Asset catalogs being the main difference with Xcode 13+.

brentleyjones avatar Nov 12 '21 21:11 brentleyjones

@keith Being able to use them in asset catalogs is new

dflems avatar Nov 12 '21 21:11 dflems

Is the old way still supported for iOS 15+? Or do you have to use this new behavior?

keith avatar May 26 '22 19:05 keith

@keith I'm not sure. I assume the old way probably still works (copying them into the bundle and referencing them in Info.plist explicitly)

dflems avatar May 27 '22 03:05 dflems

I create a PR for this here

wendyliga avatar Oct 17 '23 09:10 wendyliga