|
138 | 138 | end |
139 | 139 |
|
140 | 140 | # Extra Settings |
141 | | - # Revert to manual Info.plist management to ensure keys are present |
142 | | - config.build_settings['GENERATE_INFOPLIST_FILE'] = 'NO' |
143 | | - config.build_settings['INFOPLIST_PREPROCESS'] = 'NO' |
144 | | - |
| 141 | + # Use Xcode's modern build system capabilities to generate the full Info.plist |
| 142 | + # We will provide a partial plist with only NSExtension keys. |
| 143 | + config.build_settings['GENERATE_INFOPLIST_FILE'] = 'YES' |
| 144 | + config.build_settings['INFOPLIST_KEY_CFBundleDisplayName'] = extension_target_name |
145 | 145 | config.build_settings['MARKETING_VERSION'] = '1.0' |
146 | 146 | config.build_settings['CURRENT_PROJECT_VERSION'] = '1' |
147 | | - |
148 | 147 | config.build_settings['ALWAYS_SEARCH_USER_PATHS'] = 'NO' |
149 | | - |
150 | | - # Ensure Wrapper Extension is set |
151 | 148 | config.build_settings['WRAPPER_EXTENSION'] = 'appex' |
152 | 149 | end |
153 | 150 |
|
| 151 | +# Rewrite Info.plist to be a partial plist (NSExtension only) |
| 152 | +# This avoids conflicts with GENERATE_INFOPLIST_FILE=YES |
| 153 | +full_plist_path = File.join(extension_dir_path, "Info.plist") |
| 154 | +partial_content = <<~XML |
| 155 | +<?xml version="1.0" encoding="UTF-8"?> |
| 156 | +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| 157 | +<plist version="1.0"> |
| 158 | +<dict> |
| 159 | + <key>NSExtension</key> |
| 160 | + <dict> |
| 161 | + <key>NSExtensionPointIdentifier</key> |
| 162 | + <string>com.apple.broadcast-services-upload</string> |
| 163 | + <key>NSExtensionPrincipalClass</key> |
| 164 | + <string>SampleHandler</string> |
| 165 | + <key>RPBroadcastProcessMode</key> |
| 166 | + <string>RPBroadcastProcessModeSampleBuffer</string> |
| 167 | + </dict> |
| 168 | +</dict> |
| 169 | +</plist> |
| 170 | +XML |
| 171 | + |
| 172 | +File.write(full_plist_path, partial_content) |
| 173 | +puts "Rewrote Info.plist to partial content for merging." |
| 174 | + |
| 175 | +# 5. Add Frameworks |
| 176 | + |
154 | 177 | # 5. Add Frameworks |
155 | 178 | puts "Adding Framework Search Paths and Linking..." |
156 | 179 |
|
|
0 commit comments