Skip to content

Commit

Permalink
Also apply Xcode 11 XCTUnwrap fix to library and framework targets …
Browse files Browse the repository at this point in the history
…that weakly link `XCTest`.
  • Loading branch information
dnkoutso committed Feb 5, 2020
1 parent 09af165 commit 6ffc698
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
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

0 comments on commit 6ffc698

Please sign in to comment.