File tree Expand file tree Collapse file tree 2 files changed +21
-4
lines changed
Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 3232
3333// Icon discovery methods
3434- (NSString *) discoverAppIcon ;
35+ - (NSString *) discoverAppIconPath ;
3536- (BOOL ) copyAppIconToResources : (NSString *)iconFilename ;
3637
3738// Info.plist generation methods
Original file line number Diff line number Diff line change @@ -118,6 +118,19 @@ - (NSString *) discoverAppIcon
118118 return filename;
119119}
120120
121+ - (NSString *) discoverAppIconPath
122+ {
123+ NSString *filename = [self discoverAppIcon ];
124+ if (filename != nil )
125+ {
126+ NSString *productName = [_target name ];
127+ NSString *assetsDir = [productName stringByAppendingPathComponent: @" Assets.xcassets" ];
128+ NSString *appIconDir = [assetsDir stringByAppendingPathComponent: @" AppIcon.appiconset" ];
129+ return [appIconDir stringByAppendingPathComponent: filename];
130+ }
131+ return nil ;
132+ }
133+
121134- (BOOL ) copyAppIconToResources : (NSString *)iconFilename
122135{
123136 if (iconFilename == nil )
@@ -530,13 +543,16 @@ - (BOOL) generate
530543
531544 // Discover app icon separately from Info.plist generation
532545 NSString *iconFile = [self discoverAppIcon ];
546+ NSString *iconPath = [self discoverAppIconPath ];
533547 xcputs ([[NSString stringWithFormat: @" \t * Discovered app icon: %@ " , iconFile ? iconFile : @" (none)" ] cString ]);
534- NSString *appIconPath = [iconFile stringByDeletingFirstPathComponent ];
535- [resources addObject: appIconPath];
536548
537- // Copy app icon to resources if found
538- if (iconFile != nil )
549+ // Add icon file to resources if found
550+ if (iconPath != nil )
539551 {
552+ xcputs ([[NSString stringWithFormat: @" \t * Adding app icon to resources: %@ " , iconPath] cString ]);
553+ [resources addObject: iconPath];
554+
555+ // Copy app icon to resources directory
540556 BOOL iconCopied = [self copyAppIconToResources: iconFile];
541557 if (iconCopied)
542558 {
You can’t perform that action at this time.
0 commit comments