bin/nixenvironment in nixenvironment-0.0.52 vs bin/nixenvironment in nixenvironment-0.0.53

- old
+ new

@@ -375,10 +375,14 @@ build_directory = File.join(Dir.pwd, 'build').shellescape @config_settings['CONFIGURATION_BUILD_DIR'] = build_directory @config_settings['BUILT_PRODUCTS_DIR'] = build_directory @config_settings['DWARF_DSYM_FOLDER_PATH'] = build_directory + + plist_path = @unescaped_product_settings_path + bundle_display_name = %x[ /usr/libexec/PlistBuddy -c 'Print CFBundleDisplayName' '#{plist_path}' ].strip! + @config_settings['RESIGNED_BUNDLE_NAME'] ||= bundle_display_name end def unescaped_product_settings_path(scheme_suffix, config) scheme = @config_settings['WORKSPACE_SCHEME_TO_BUILD'] + scheme_suffix if xcode_project_contains_scheme?(scheme) @@ -676,12 +680,17 @@ def update_info_plist(config) p('Updating Info.plist ...') revision = %x[ source _last_revision.sh && echo ${REVISION} ].strip! monotonic_revision = %x[ source _last_revision.sh && echo ${MONOTONIC_REVISION} ].strip! + bundle_id = @config_settings['BUNDLE_ID'] - update_success = system("/usr/libexec/PlistBuddy -c 'Set :CFBundleIdentifier \"#{@config_settings['BUNDLE_ID']}\"' \"#{@unescaped_product_settings_path}\"") - update_success &&= system("/usr/libexec/PlistBuddy -c 'Set :CFBundleVersion \"#{monotonic_revision}\"' \"#{@unescaped_product_settings_path}\"") + update_success = system("/usr/libexec/PlistBuddy -c 'Set :CFBundleVersion \"#{monotonic_revision}\"' \"#{@unescaped_product_settings_path}\"") + + if bundle_id + update_success &&= system("/usr/libexec/PlistBuddy -c 'Set :CFBundleIdentifier \"#{bundle_id}\"' \"#{@unescaped_product_settings_path}\"") + end + update_success &&= system("/usr/libexec/PlistBuddy -c 'Add :Configuration string \"#{config}\"' \"#{@unescaped_product_settings_path}\"") update_success &&= system("/usr/libexec/PlistBuddy -c 'Add :RevisionNumber string \"#{revision}\"' \"#{@unescaped_product_settings_path}\"") unless update_success restore_info_plist