|
28 | 28 | #import "PBXCoder.h" |
29 | 29 | #import "PBXBuildPhase.h" |
30 | 30 |
|
| 31 | +// Forward declarations |
| 32 | +@class XCBuildConfiguration; |
| 33 | + |
31 | 34 | @interface PBXResourcesBuildPhase : PBXBuildPhase |
32 | 35 |
|
33 | | -// Icon discovery methods |
| 36 | +/** |
| 37 | + * Discovers the app icon filename from the Assets.xcassets directory. |
| 38 | + * Searches for a 32x32@1x icon in the AppIcon.appiconset Contents.json file. |
| 39 | + * Returns the filename of the discovered app icon, or nil if none found. |
| 40 | + */ |
34 | 41 | - (NSString *) discoverAppIcon; |
| 42 | + |
| 43 | +/** |
| 44 | + * Discovers the full path to the app icon file. |
| 45 | + * Combines the Assets.xcassets directory path with the discovered icon filename. |
| 46 | + * Returns the complete path to the app icon file, or nil if no icon is found. |
| 47 | + */ |
35 | 48 | - (NSString *) discoverAppIconPath; |
| 49 | + |
| 50 | +/** |
| 51 | + * Copies the specified icon file from Assets.xcassets to the resources directory. |
| 52 | + * Creates the resources directory if it doesn't exist and handles file overwriting. |
| 53 | + * Takes the name of the icon file to copy as parameter. |
| 54 | + * Returns YES if the copy operation succeeded, NO otherwise. |
| 55 | + */ |
36 | 56 | - (BOOL) copyAppIconToResources: (NSString *)iconFilename; |
37 | 57 |
|
38 | | -// Helper methods |
| 58 | +/** |
| 59 | + * Escapes special characters in filenames for makefile compatibility. |
| 60 | + * Handles spaces, dollar signs, hash symbols, and colons that have special |
| 61 | + * meaning in makefiles. Takes the filename to escape as parameter. |
| 62 | + * Returns the escaped filename suitable for use in makefiles, or nil if input is nil. |
| 63 | + */ |
39 | 64 | - (NSString *) escapeFilenameForMakefile: (NSString *)filename; |
40 | 65 |
|
41 | | -// Info.plist generation methods |
| 66 | +/** |
| 67 | + * Generates Info.plist content for the application. |
| 68 | + * Creates a property list dictionary with application metadata. |
| 69 | + * Takes the name of the output plist file as parameter. |
| 70 | + * Returns the generated Info.plist content as a string. |
| 71 | + */ |
42 | 72 | - (NSString *) generateInfoPlistOutput: (NSString *)outputPlist; |
| 73 | + |
| 74 | +/** |
| 75 | + * Generates Info.plist content with app icon information. |
| 76 | + * Creates a property list dictionary including the specified icon file reference. |
| 77 | + * Takes the name of the output plist file and the name of the icon file as parameters. |
| 78 | + * Returns the generated Info.plist content as a string. |
| 79 | + */ |
43 | 80 | - (NSString *) generateInfoPlistOutput: (NSString *)outputPlist withIconFile: (NSString *)iconFile; |
| 81 | + |
| 82 | +/** |
| 83 | + * Converts build configuration to Info.plist dictionary. |
| 84 | + * Extracts relevant settings from the build configuration for plist generation. |
| 85 | + * Takes the build configuration to process as parameter. |
| 86 | + * Returns a mutable dictionary containing plist key-value pairs. |
| 87 | + */ |
44 | 88 | - (NSMutableDictionary *) configToInfoPlist: (XCBuildConfiguration *)config; |
| 89 | + |
| 90 | +/** |
| 91 | + * Converts build configuration to Info.plist dictionary with icon information. |
| 92 | + * Extracts settings and includes icon file reference in the generated dictionary. |
| 93 | + * Takes the build configuration to process and the name of the icon file as parameters. |
| 94 | + * Returns a mutable dictionary containing plist key-value pairs including icon info. |
| 95 | + */ |
45 | 96 | - (NSMutableDictionary *) configToInfoPlist: (XCBuildConfiguration *)config withIconFile: (NSString *)iconFile; |
| 97 | + |
| 98 | +/** |
| 99 | + * Processes an input Info.plist file and generates output with variable substitution. |
| 100 | + * Reads an existing plist file and performs environment variable substitution. |
| 101 | + * Takes the path to the input plist file and the path where the processed plist should be written as parameters. |
| 102 | + * Returns YES if processing succeeded, NO otherwise. |
| 103 | + */ |
46 | 104 | - (BOOL) processInfoPlistInput: (NSString *)inputFileName |
47 | 105 | output: (NSString *)outputFileName; |
| 106 | + |
| 107 | +/** |
| 108 | + * Processes an input Info.plist file with icon information and generates output. |
| 109 | + * Reads an existing plist file, performs variable substitution, and adds icon info. |
| 110 | + * Takes the path to the input plist file, the path where the processed plist should be written, |
| 111 | + * and the name of the icon file to include as parameters. |
| 112 | + * Returns YES if processing succeeded, NO otherwise. |
| 113 | + */ |
48 | 114 | - (BOOL) processInfoPlistInput: (NSString *)inputFileName |
49 | 115 | output: (NSString *)outputFileName |
50 | 116 | withIconFile: (NSString *)iconFileName; |
51 | 117 |
|
52 | | -// Legacy method (backward compatibility) |
| 118 | +/** |
| 119 | + * Legacy method for backward compatibility. |
| 120 | + * Processes assets and returns the discovered icon filename. |
| 121 | + */ |
53 | 122 | - (NSString *) processAssets; |
54 | 123 |
|
55 | 124 | @end |
0 commit comments