8000 Correctly set deployment target for non library specs even if the root spec does not specify one. by dnkoutso · Pull Request #9153 · CocoaPods/CocoaPods · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Correctly set deployment target for non library specs even if the root spec does not specify one. #9153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`

##### Bug Fixes

* Correctly set deployment target for non library specs even if the root spec does not specify one.
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#9153](https://github.com/CocoaPods/CocoaPods/pull/9153)

* Make `APPLICATION_EXTENSION_API_ONLY` build setting not break when performing a cached incremental install.
[Igor Makarov](https://github.com/igor-makarov)
[#8967](https://github.com/CocoaPods/CocoaPods/issues/8967)
Expand Down
6 changes: 3 additions & 3 deletions lib/cocoapods/target/pod_target.rb
8000
Original file line number Diff line number Diff line change
Expand Up @@ -415,12 +415,12 @@ def resource_paths

# @param [Specification] spec The non library spec to calculate the deployment target for.
#
# @return [String] The deployment target to use for the non library spec. If the spec provides one then that is the
# one used otherwise the one for the whole target is used.
# @return [String] The deployment target to use for the non library spec. If the non library spec explicitly
# specifies one then this is the one used otherwise the one that was determined by the analyzer is used.
#
def deployment_target_for_non_library_spec(spec)
raise ArgumentError, 'Must be a non library spec.' unless spec.non_library_specification?
spec.deployment_target(platform.name)
spec.deployment_target(platform.name.to_s) || platform.deployment_target.to_s
end

# Returns the corresponding native product type to use given the test type.
Expand Down
8 changes: 8 additions & 0 deletions spec/unit/target/pod_target_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,14 @@ module Pod
@pod_target.deployment_target_for_non_library_spec(@watermelon_spec.test_specs.first).to_s.should == '8.0'
@pod_target.deployment_target_for_non_library_spec(@watermelon_spec.app_specs.first).to_s.should == '8.0'
end

it 'returns the determined deployment target even if the podspec does not explicitly specify one' do
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verified this goes red without my change.

# The coconut spec does not specify a deployment target at all. We expect the deployment target for the non
# library spec to be set with the one by the pod target itself instead.
coconut_spec = fixture_spec('coconut-lib/CoconutLib.podspec')
pod_target = fixture_pod_target(coconut_spec, false, {}, [], Platform.new(:ios, '4.3'))
pod_target.deployment_target_for_non_library_spec(coconut_spec.test_specs.first).to_s.should == '4.3'
end
end

describe 'script phases support' do
Expand Down
0