Skip to content
Browse files

Match IPHONEOS_DEPLOYMENT_TARGET build setting with deployment_target…

… option in generated Pods project file
  • Loading branch information...
1 parent 7e2875a commit 49ba127266739f94b5453f1f2407f9109c95ae41 @maikg maikg committed Feb 23, 2012
Showing with 13 additions and 0 deletions.
  1. +3 −0 lib/cocoapods/xcodeproj_pods.rb
  2. +10 −0 spec/unit/xcodeproj_ext_spec.rb
View
3 lib/cocoapods/xcodeproj_pods.rb
@@ -98,6 +98,9 @@ def self.build_settings(platform, scheme)
if platform.requires_legacy_ios_archs?
settings['ARCHS'] = "armv6 armv7"
end
+ if platform == :ios && platform.deployment_target
+ settings['IPHONEOS_DEPLOYMENT_TARGET'] = platform.deployment_target.to_s
+ end
if scheme == :debug
settings.merge!(COMMON_BUILD_SETTINGS[:debug])
settings['ONLY_ACTIVE_ARCH'] = 'YES' if platform == :osx
View
10 spec/unit/xcodeproj_ext_spec.rb
@@ -76,5 +76,15 @@ def find_object(conditions)
@project.build_configuration("Debug").buildSettings["ARCHS"].should == "$(ARCHS_STANDARD_32_BIT)"
@project.build_configuration("Release").buildSettings["ARCHS"].should == "$(ARCHS_STANDARD_32_BIT)"
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

0 comments on commit 49ba127

Please sign in to comment.
Something went wrong with that request. Please try again.