Skip to content

Commit e41fa19

Browse files
committed
feat: update xcode permission by command - test
1 parent ccbac48 commit e41fa19

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

Tools/ios_extension_setup.rb

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,42 @@
138138
end
139139

140140
# 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
145145
config.build_settings['MARKETING_VERSION'] = '1.0'
146146
config.build_settings['CURRENT_PROJECT_VERSION'] = '1'
147-
148147
config.build_settings['ALWAYS_SEARCH_USER_PATHS'] = 'NO'
149-
150-
# Ensure Wrapper Extension is set
151148
config.build_settings['WRAPPER_EXTENSION'] = 'appex'
152149
end
153150

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+
154177
# 5. Add Frameworks
155178
puts "Adding Framework Search Paths and Linking..."
156179

0 commit comments

Comments
 (0)