Skip to content

Instantly share code, notes, and snippets.

@neonichu
Created September 30, 2014 15:39
Show Gist options
  • Save neonichu/80b523eb5d45aad8f52d to your computer and use it in GitHub Desktop.
Save neonichu/80b523eb5d45aad8f52d to your computer and use it in GitHub Desktop.
Fix build settings of Pods.xcodeproj in case of use of legacy build output directory.
#!/usr/bin/env ruby
def build_option(option_name)
output = `xcodebuild -showBuildSettings 2>/dev/null`.split("\n")
output = output.select { |line| line[/#{option_name}/] }
output.map { |line| line.split(' ')[2..-1].join(' ') }
end
require 'xcodeproj'
main_proj_root = build_option :SYMROOT
proj = Xcodeproj::Project.open('Pods/Pods.xcodeproj')
proj.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SYMROOT'] = main_proj_root
end
end
proj.save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment