Commit 680ba8a1 authored by Samuel E. Giddins's avatar Samuel E. Giddins

[Validator] Fix linting subspecs that have a higher deployment target than the root spec

Closes https://github.com/CocoaPods/CocoaPods/issues/1919.
parent b1c64f64
...@@ -37,6 +37,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -37,6 +37,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Olivier Halligon](https://github.com/AliSoftware) [Olivier Halligon](https://github.com/AliSoftware)
[#2852](https://github.com/CocoaPods/CocoaPods/issues/2852) [#2852](https://github.com/CocoaPods/CocoaPods/issues/2852)
* Fix linting subspecs that have a higher deployment target than the root
spec.
[Samuel Giddins](https://github.com/segiddins)
[#1919](https://github.com/CocoaPods/CocoaPods/issues/1919)
## 0.35.0 ## 0.35.0
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.34.4...0.35.0) [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.34.4...0.35.0)
......
...@@ -298,7 +298,8 @@ module Pod ...@@ -298,7 +298,8 @@ module Pod
# for all available platforms with xcodebuild. # for all available platforms with xcodebuild.
# #
def install_pod def install_pod
podfile = podfile_from_spec(consumer.platform_name, spec.deployment_target(consumer.platform_name)) deployment_target = spec.subspec_by_name(subspec_name).deployment_target(consumer.platform_name)
podfile = podfile_from_spec(consumer.platform_name, deployment_target)
sandbox = Sandbox.new(config.sandbox_root) sandbox = Sandbox.new(config.sandbox_root)
installer = Installer.new(sandbox, podfile) installer = Installer.new(sandbox, podfile)
installer.install! installer.install!
......
...@@ -283,6 +283,24 @@ module Pod ...@@ -283,6 +283,24 @@ module Pod
dependency.external_source.key?(:podspec).should.be.true dependency.external_source.key?(:podspec).should.be.true
end end
it 'uses the deployment target of the current subspec' do
validator = Validator.new(podspec_path, SourcesManager.master.map(&:url))
validator.stubs(:validate_url)
validator.stubs(:validate_screenshots)
validator.stubs(:check_file_patterns)
validator.stubs(:check_file_patterns)
Installer.any_instance.stubs(:install!)
Installer.any_instance.stubs(:aggregate_targets).returns([])
subspec = Specification.new(validator.spec, 'subspec') do |s|
s.ios.deployment_target = '7.0'
end
validator.spec.stubs(:subspecs).returns([subspec])
validator.expects(:podfile_from_spec).with(:osx, nil).once
validator.expects(:podfile_from_spec).with(:ios, nil).once
validator.expects(:podfile_from_spec).with(:ios, '7.0').once
podfile = validator.send(:perform_extensive_analysis, validator.spec)
end
it 'respects the local option' do it 'respects the local option' do
sut = Validator.new(podspec_path, SourcesManager.master.map(&:url)) sut = Validator.new(podspec_path, SourcesManager.master.map(&:url))
sut.stubs(:validate_url) sut.stubs(:validate_url)
......
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