Skip to content

Commit

Permalink
Match IPHONEOS_DEPLOYMENT_TARGET build setting with deployment_target…
Browse files Browse the repository at this point in the history
… option in generated Pods project file
  • Loading branch information
maikg committed Feb 23, 2012
1 parent 7e2875a commit 49ba127
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/cocoapods/xcodeproj_pods.rb
Expand Up @@ -98,6 +98,9 @@ def self.build_settings(platform, scheme)
if platform.requires_legacy_ios_archs? if platform.requires_legacy_ios_archs?
settings['ARCHS'] = "armv6 armv7" settings['ARCHS'] = "armv6 armv7"
end end
if platform == :ios && platform.deployment_target
settings['IPHONEOS_DEPLOYMENT_TARGET'] = platform.deployment_target.to_s
end
if scheme == :debug if scheme == :debug
settings.merge!(COMMON_BUILD_SETTINGS[:debug]) settings.merge!(COMMON_BUILD_SETTINGS[:debug])
settings['ONLY_ACTIVE_ARCH'] = 'YES' if platform == :osx settings['ONLY_ACTIVE_ARCH'] = 'YES' if platform == :osx
Expand Down
10 changes: 10 additions & 0 deletions spec/unit/xcodeproj_ext_spec.rb
Expand Up @@ -76,5 +76,15 @@ def find_object(conditions)
@project.build_configuration("Debug").buildSettings["ARCHS"].should == "$(ARCHS_STANDARD_32_BIT)" @project.build_configuration("Debug").buildSettings["ARCHS"].should == "$(ARCHS_STANDARD_32_BIT)"
@project.build_configuration("Release").buildSettings["ARCHS"].should == "$(ARCHS_STANDARD_32_BIT)" @project.build_configuration("Release").buildSettings["ARCHS"].should == "$(ARCHS_STANDARD_32_BIT)"
end end

it "sets IPHONEOS_DEPLOYMENT_TARGET for both configurations" do
@project = Xcodeproj::Project.for_platform(Pod::Platform.new(:ios))
@project.build_configuration("Debug").buildSettings["IPHONEOS_DEPLOYMENT_TARGET"].should == "4.3"
@project.build_configuration("Release").buildSettings["IPHONEOS_DEPLOYMENT_TARGET"].should == "4.3"

@project = Xcodeproj::Project.for_platform(Pod::Platform.new(:ios, :deployment_target => "4.0"))
@project.build_configuration("Debug").buildSettings["IPHONEOS_DEPLOYMENT_TARGET"].should == "4.0"
@project.build_configuration("Release").buildSettings["IPHONEOS_DEPLOYMENT_TARGET"].should == "4.0"
end
end end
end end

0 comments on commit 49ba127

Please sign in to comment.