Add IconComposer support for .icon folders #1555
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📋 PR Description - Add IconComposer Support for .icon Folders
Problem
IconComposer-generated
.icon
folders from Xcode beta were being treated as regular folders by XcodeGen, causing build failures. These folders contain complex structures with SVGs and JSON files that need to be handled as special file references, similar to.xcassets
.Solution
Added comprehensive support for
.icon
folders to be treated as file references withlastKnownFileType = "wrapper.icon"
instead of regular directory groups.Changes Made
Core Implementation:
FileType.swift
: Added.icon
extension mapping toFileType(buildPhase: .resources)
XCProjExtensions.swift
: Added"wrapper.icon"
file type mappingSourceGenerator.swift
: Special handling for.icon
folders as directory file wrappersPBXProjGenerator.swift
: DynamicASSETCATALOG_COMPILER_APPICON_NAME
build setting detectionNew File:
IconComposerSupport.swift
: Utility functions for detecting and handling IconComposer iconsTest Coverage:
IconComposerSupportTests.swift
: Comprehensive test suite covering:.icon
folders as files, not groups)TestIcon.icon
with proper structure for validationHow It Works
IconComposerAppIcon
pattern).icon
folders asPBXFileReference
withwrapper.icon
typeASSETCATALOG_COMPILER_APPICON_NAME
to detected icon nameUsage Example
Testing
Backwards Compatibility
.icon
foldersResolves: Support for IconComposer-generated icons from Xcode beta that would previously fail to build when treated as regular folders.