Commit 748ef533 authored by Ben Asher's avatar Ben Asher Committed by GitHub

Merge pull request #6721 from benasher44/basher_fix_static_lib_projects

Fix pod install error when working on a static lib project
parents 04d92a55 7bc24b25
...@@ -18,6 +18,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -18,6 +18,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes ##### Bug Fixes
* Fix pod install error from 1.2.1 when working with static lib-only projects.
[Ben Asher](https://github.com/benasher44)
[#6673](https://github.com/CocoaPods/CocoaPods/issues/6673)
* Use `git!` when executing `push` command in order to raise informative and set exit code. * Use `git!` when executing `push` command in order to raise informative and set exit code.
[Dimitris Koutsogiorgas](https://github.com/dnkoutso) [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#6700](https://github.com/CocoaPods/CocoaPods/pull/6700) [#6700](https://github.com/CocoaPods/CocoaPods/pull/6700)
......
...@@ -313,12 +313,12 @@ module Pod ...@@ -313,12 +313,12 @@ module Pod
end end
unless embedded_targets_missing_hosts.empty? unless embedded_targets_missing_hosts.empty?
embedded_targets_missing_hosts_product_types = embedded_targets_missing_hosts.map(&:user_targets).flatten.map(&:symbol_type).uniq embedded_targets_missing_hosts_product_types = Set.new embedded_targets_missing_hosts.map(&:user_targets).flatten.map(&:symbol_type)
# If the targets missing hosts are only frameworks, then this is likely # If the targets missing hosts are only frameworks, then this is likely
# a project for doing framework development. In that case, just warn that # a project for doing framework development. In that case, just warn that
# the frameworks that these targets depend on won't be integrated anywhere # the frameworks that these targets depend on won't be integrated anywhere
if embedded_targets_missing_hosts_product_types == [:framework] if embedded_targets_missing_hosts_product_types.subset?(Set.new([:framework, :static_library]))
UI.warn 'The Podfile contains framework targets, for which the Podfile does not contain host targets (targets which embed the framework).' \ UI.warn 'The Podfile contains framework or static library targets, for which the Podfile does not contain host targets (targets which embed the framework).' \
"\n" \ "\n" \
'If this project is for doing framework development, you can ignore this message. Otherwise, add a target to the Podfile that embeds these frameworks to make this message go away (e.g. a test target).' 'If this project is for doing framework development, you can ignore this message. Otherwise, add a target to the Podfile that embeds these frameworks to make this message go away (e.g. a test target).'
else else
......
...@@ -812,6 +812,21 @@ module Pod ...@@ -812,6 +812,21 @@ module Pod
end.message.should.match /Unable to find host target\(s\) for Today Extension. Please add the host targets for the embedded targets to the Podfile\./ end.message.should.match /Unable to find host target\(s\) for Today Extension. Please add the host targets for the embedded targets to the Podfile\./
end end
it 'warns when using a Podfile for framework-only projects' do
podfile = Pod::Podfile.new do
source SpecHelper.test_repo_url
use_frameworks!
platform :ios, '8.0'
target 'SampleLib' do
project 'SampleProject/Sample Lib/Sample Lib'
pod 'monkey'
end
end
analyzer = Pod::Installer::Analyzer.new(config.sandbox, podfile)
analyzer.analyze
UI.warnings.should.match /The Podfile contains framework or static library targets, for which the Podfile does not contain host targets \(targets which embed the framework\)\./
end
it 'warns when using a Podfile for framework-only projects' do it 'warns when using a Podfile for framework-only projects' do
podfile = Pod::Podfile.new do podfile = Pod::Podfile.new do
source SpecHelper.test_repo_url source SpecHelper.test_repo_url
...@@ -824,7 +839,7 @@ module Pod ...@@ -824,7 +839,7 @@ module Pod
end end
analyzer = Pod::Installer::Analyzer.new(config.sandbox, podfile) analyzer = Pod::Installer::Analyzer.new(config.sandbox, podfile)
analyzer.analyze analyzer.analyze
UI.warnings.should.match /The Podfile contains framework targets, for which the Podfile does not contain host targets \(targets which embed the framework\)\./ UI.warnings.should.match /The Podfile contains framework or static library targets, for which the Podfile does not contain host targets \(targets which embed the framework\)\./
end end
it 'raises when the extension calls use_frameworks!, but the host target does not' do it 'raises when the extension calls use_frameworks!, but the host target does not' do
......
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