10000 🌈 Fix embedding static frameworks in extensions while using `use_frameworks!` by mfiebig · Pull Request #8798 · CocoaPods/CocoaPods · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

🌈 Fix embedding static frameworks in extensions while using use_frameworks! #8798

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
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#8585](https://github.com/CocoaPods/CocoaPods/pull/8585)

* Fix embedding static frameworks in extensions while using `use_frameworks!`
[Martin Fiebig](https://github.com/mfiebig)
[#8798](https://github.com/CocoaPods/CocoaPods/pull/8798)

## 1.7.0.rc.1 (2019-05-02)

Expand Down
3 changes: 2 additions & 1 deletion lib/cocoapods/installer/analyzer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ def embedded_target_pod_targets_by_host(aggregate_target, embedded_aggregate_tar
pod_target_names = Set.new(aggregate_target.pod_targets_for_build_configuration(configuration_name).map(&:name))
embedded_pod_targets = embedded_aggregate_target.pod_targets_for_build_configuration(configuration_name).select do |pod_target|
if !pod_target_names.include?(pod_target.name) &&
aggregate_target.pod_targets.none? { |aggregate_pod_target| (pod_target.specs - aggregate_pod_target.specs).empty? }
aggregate_target.pod_targets.none? { |aggregate_pod_target| (pod_target.specs - aggregate_pod_target.specs).empty? } &&
(libraries_only || pod_target.build_as_dynamic?)
pod_target.name
end
end
Expand Down
31 changes: 31 additions & 0 deletions spec/unit/installer/analyzer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,37 @@ module Pod
].sort
end

it 'does not copy extension pod targets to host target, when use_frameworks! but contained pod is static' do
SpecHelper.create_sample_app_copy_from_fixture('Sample Extensions Project')
fixture_path = ROOT + 'spec/fixtures'
podfile = Pod::Podfile.new do
source SpecHelper.test_repo_url
platform :ios, '6.0'
project 'Sample Extensions Project/Sample Extensions Project'
use_frameworks!

target 'Sample Extensions Project' do
pod 'JSONKit', '1.4'
end

target 'Today Extension' do
pod 'matryoshka', :path => (fixture_path + 'static-matryoshka').to_s
Copy link
Contributor

Choose a reason for hiding this comment

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

why does this need to be with :path?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see because its static_framework in that path.

end
end

analyzer = Pod::Installer::Analyzer.new(config.sandbox, podfile)
# Create 'Local Podspecs' folder within target project
Dir.mkdir(File.join(config.sandbox.root, 'Local Podspecs'))
result = analyzer.analyze

result.targets.flat_map { |at| at.pod_targets.map { |pt| "#{at.name}/#{pt.name}" } }.sort.should == [
'Pods-Sample Extensions Project/JSONKit',
'Pods-Sample Extensions Project/monkey',
'Pods-Today Extension/monkey',
'Pods-Today Extension/matryoshka',
].sort
end

it 'copies pod targets of frameworks and libraries from within sub projects' do
podfile = Pod::Podfile.new do
source SpecHelper.test_repo_url
Expand Down
0