Skip to content

Instantly share code, notes, and snippets.

@AlexDenisov
Created March 27, 2013 14:51
Show Gist options
  • Save AlexDenisov/5254779 to your computer and use it in GitHub Desktop.
Save AlexDenisov/5254779 to your computer and use it in GitHub Desktop.
Add compiler flags on each Spec in target
require 'xcodeproj'
project = Xcodeproj::Project.new 'SomeProject.xcodeproj'
target = project.targets.last
build_phase = target.source_build_phase
files = build_phase.files
settings = { 'COMPILER_FLAGS' => '-fno-objc-arc' }
files.each do |f|
if f.display_name =~ /Spec/
if f.settings
f.settings = f.settings.merge settings
else
f.settings = settings
end
puts f.display_name
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment