Skip to content
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

Also apply Xcode 11 XCTUnwrap fix to library and framework targets that weakly link XCTest. #9518

Merged
merged 1 commit into from Feb 5, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Expand Up @@ -12,7 +12,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`

##### Bug Fixes

* None.
* Also apply Xcode 11 `XCTUnwrap` fix to library and framework targets that weakly link `XCTest`.
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#9518](https://github.com/CocoaPods/CocoaPods/pull/9518)


## 1.9.0.beta.3 (2020-02-04)
Expand Down
2 changes: 1 addition & 1 deletion lib/cocoapods/target/build_settings.rb
Expand Up @@ -992,7 +992,7 @@ def pod_target_xcconfig_values_by_consumer_by_key
library_xcconfig? &&
target.platform.name == :ios &&
Version.new(target.platform.deployment_target) < Version.new('12.2') &&
frameworks_to_import.include?('XCTest')
(frameworks_to_import + weak_frameworks_to_import).uniq.include?('XCTest')
end

#-------------------------------------------------------------------------#
Expand Down
10 changes: 10 additions & 0 deletions spec/unit/target/build_settings/pod_target_settings_spec.rb
Expand Up @@ -194,6 +194,16 @@ class BuildSettings
hash['SWIFT_INCLUDE_PATHS'].should.include '"$(PLATFORM_DIR)/Developer/usr/lib"'
end

it 'includes xctunwrap fix for a pod target with deployment target < 12.2 and weakly links XCTest' do
@spec.weak_frameworks = ['XCTest']
@pod_target.stubs(:platform).returns(Platform.new(:ios, '12.1'))
generator = PodTargetSettings.new(@pod_target, nil, :configuration => :debug)
hash = generator.generate.to_hash
hash['SYSTEM_FRAMEWORK_SEARCH_PATHS'].should.include '"$(PLATFORM_DIR)/Developer/usr/lib"'
hash['LIBRARY_SEARCH_PATHS'].should.include '"$(PLATFORM_DIR)/Developer/usr/lib"'
hash['SWIFT_INCLUDE_PATHS'].should.include '"$(PLATFORM_DIR)/Developer/usr/lib"'
end

it 'does not include xctunwrap fix for a pod target with higher than 12.1 deployment target' do
@spec.frameworks = ['XCTest']
@pod_target.stubs(:platform).returns(Platform.new(:ios, '12.2'))
Expand Down