Commit 77834ba0 authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #4320 from CocoaPods/seg-pod-target-deployment-target

[PodTargetInstaller] Set deployment target to maximum spec deployment…
parents a8f8d7f5 7f1ecdc2
...@@ -51,6 +51,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -51,6 +51,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
* Externally-sourced pods will now have their specifications quickly linted. * Externally-sourced pods will now have their specifications quickly linted.
[Samuel Giddins](https://github.com/segiddins) [Samuel Giddins](https://github.com/segiddins)
* Set the deployment target on pods to be that which is defined in the
podspec.
[Samuel Giddins](https://github.com/segiddins)
[#4354](https://github.com/CocoaPods/CocoaPods/issues/3454)
##### Bug Fixes ##### Bug Fixes
* Improve repo lint error message when no repo found with given name. * Improve repo lint error message when no repo found with given name.
......
...@@ -39,7 +39,6 @@ module Pod ...@@ -39,7 +39,6 @@ module Pod
product_type = target.product_type product_type = target.product_type
name = target.label name = target.label
platform = target.platform.name platform = target.platform.name
deployment_target = target.platform.deployment_target.to_s
language = target.uses_swift? ? :swift : :objc language = target.uses_swift? ? :swift : :objc
@native_target = project.new_target(product_type, name, platform, deployment_target, nil, language) @native_target = project.new_target(product_type, name, platform, deployment_target, nil, language)
...@@ -59,6 +58,12 @@ module Pod ...@@ -59,6 +58,12 @@ module Pod
target.native_target = @native_target target.native_target = @native_target
end end
# @return [String] The deployment target.
#
def deployment_target
target.platform.deployment_target.to_s
end
# Returns the customized build settings which are overridden in the build # Returns the customized build settings which are overridden in the build
# settings of the user target. # settings of the user target.
# #
......
...@@ -310,6 +310,18 @@ module Pod ...@@ -310,6 +310,18 @@ module Pod
end end
end end
# The deployment target for the pod target, which is the maximum of all
# the deployment targets for the current platform of the target.
#
# @return [String] The deployment target.
#
def deployment_target
default = Podfile::TargetDefinition::PLATFORM_DEFAULTS[target.platform.name]
target.specs.map do |spec|
Pod::Version.new(spec.deployment_target(target.platform.name) || default)
end.max.to_s
end
#-----------------------------------------------------------------------# #-----------------------------------------------------------------------#
end end
end end
......
Subproject commit 068cacb41b490be4292d2e351752cb710a1235a2 Subproject commit e0dba63b7fba6b23736c588dba46e32be8e975b8
...@@ -33,12 +33,20 @@ module Pod ...@@ -33,12 +33,20 @@ module Pod
@spec.prefix_header_contents = '#import "BlocksKit.h"' @spec.prefix_header_contents = '#import "BlocksKit.h"'
end end
it 'uses the maximum of all spec deployment targets' do
spec_1 = Pod::Specification.new { |s| s.ios.deployment_target = '10.10' }
spec_2 = Pod::Specification.new { |s| s.ios.deployment_target = '10.9' }
spec_3 = Pod::Specification.new
@pod_target.stubs(:specs).returns([spec_1, spec_2, spec_3])
@installer.send(:deployment_target).should == '10.10'
end
it 'sets the platform and the deployment target for iOS targets' do it 'sets the platform and the deployment target for iOS targets' do
@installer.install! @installer.install!
target = @project.targets.first target = @project.targets.first
target.platform_name.should == :ios target.platform_name.should == :ios
target.deployment_target.should == '6.0' target.deployment_target.should == '4.3'
target.build_settings('Debug')['IPHONEOS_DEPLOYMENT_TARGET'].should == '6.0' target.build_settings('Debug')['IPHONEOS_DEPLOYMENT_TARGET'].should == '4.3'
end end
it 'sets the platform and the deployment target for OS X targets' do it 'sets the platform and the deployment target for OS X targets' do
...@@ -46,8 +54,8 @@ module Pod ...@@ -46,8 +54,8 @@ module Pod
@installer.install! @installer.install!
target = @project.targets.first target = @project.targets.first
target.platform_name.should == :osx target.platform_name.should == :osx
target.deployment_target.should == '10.8' target.deployment_target.should == '10.6'
target.build_settings('Debug')['MACOSX_DEPLOYMENT_TARGET'].should == '10.8' target.build_settings('Debug')['MACOSX_DEPLOYMENT_TARGET'].should == '10.6'
end end
it "adds the user's build configurations to the target" do it "adds the user's build configurations to the target" do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment