Commit 3782eee5 authored by Samuel Giddins's avatar Samuel Giddins Committed by GitHub

Merge pull request #5795 from benasher44/basher_plaform_nil

Make analyzer skip the embedded target -> host compatibility check for hosts not defined in the Podfile
parents 534c997b 671fae01
...@@ -47,6 +47,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -47,6 +47,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Ben Asher](https://github.com/benasher44) [Ben Asher](https://github.com/benasher44)
[#5700](https://github.com/CocoaPods/CocoaPods/issues/5700) and [#5737](https://github.com/CocoaPods/CocoaPods/issues/5737) [#5700](https://github.com/CocoaPods/CocoaPods/issues/5700) and [#5737](https://github.com/CocoaPods/CocoaPods/issues/5737)
* Fix analyzer checking the compatibility of an embedded target with a host that has not been added the Podfile.
[Ben Asher](https://github.com/benasher44)
[#5783](https://github.com/CocoaPods/CocoaPods/issues/5783)
## 1.1.0.beta.1 (2016-07-11) ## 1.1.0.beta.1 (2016-07-11)
......
...@@ -267,6 +267,8 @@ module Pod ...@@ -267,6 +267,8 @@ module Pod
# #
def analyze_host_targets_in_podfile(aggregate_targets, embedded_aggregate_targets) def analyze_host_targets_in_podfile(aggregate_targets, embedded_aggregate_targets)
target_definitions_by_uuid = {} target_definitions_by_uuid = {}
# Collect aggregate target definitions by uuid to later lookup host target
# definitions and verify their compatiblity with their embedded targets
aggregate_targets.each do |target| aggregate_targets.each do |target|
target.user_targets.map(&:uuid).each do |uuid| target.user_targets.map(&:uuid).each do |uuid|
target_definitions_by_uuid[uuid] = target.target_definition target_definitions_by_uuid[uuid] = target.target_definition
...@@ -275,6 +277,7 @@ module Pod ...@@ -275,6 +277,7 @@ module Pod
aggregate_target_user_projects = aggregate_targets.map(&:user_project) aggregate_target_user_projects = aggregate_targets.map(&:user_project)
embedded_targets_missing_hosts = [] embedded_targets_missing_hosts = []
host_uuid_to_embedded_target_definitions = {} host_uuid_to_embedded_target_definitions = {}
# Search all of the known user projects for each embedded target's hosts
embedded_aggregate_targets.each do |target| embedded_aggregate_targets.each do |target|
host_uuids = [] host_uuids = []
aggregate_target_user_projects.product(target.user_targets).each do |user_project, user_target| aggregate_target_user_projects.product(target.user_targets).each do |user_project, user_target|
...@@ -284,9 +287,15 @@ module Pod ...@@ -284,9 +287,15 @@ module Pod
end end
host_uuids += host_targets.map(&:uuid) host_uuids += host_targets.map(&:uuid)
end end
# For each host, keep track of its embedded target definitions
# to later verify each embedded target's compatiblity with its host,
# ignoring the hosts that aren't known to CocoaPods (no target
# definitions in the Podfile)
host_uuids.each do |uuid| host_uuids.each do |uuid|
(host_uuid_to_embedded_target_definitions[uuid] ||= []) << target.target_definition (host_uuid_to_embedded_target_definitions[uuid] ||= []) << target.target_definition if target_definitions_by_uuid.key? uuid
end end
# If none of the hosts are known to CocoaPods (no target definitions
# in the Podfile), add it to the list of targets missing hosts
embedded_targets_missing_hosts << target unless host_uuids.any? do |uuid| embedded_targets_missing_hosts << target unless host_uuids.any? do |uuid|
target_definitions_by_uuid.key? uuid target_definitions_by_uuid.key? uuid
end end
......
...@@ -38,6 +38,13 @@ ...@@ -38,6 +38,13 @@
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
130F34EB1D73B132009D968D /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 51E94E201644721F0035348C /* Sample Lib.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 137F16121D3AFC2900029696;
remoteInfo = "Sample Framework";
};
137F16201D3AFC7B00029696 /* PBXContainerItemProxy */ = { 137F16201D3AFC7B00029696 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy; isa = PBXContainerItemProxy;
containerPortal = 51E94E201644721F0035348C /* Sample Lib.xcodeproj */; containerPortal = 51E94E201644721F0035348C /* Sample Lib.xcodeproj */;
...@@ -278,6 +285,7 @@ ...@@ -278,6 +285,7 @@
buildRules = ( buildRules = (
); );
dependencies = ( dependencies = (
130F34EC1D73B132009D968D /* PBXTargetDependency */,
); );
name = TestRunner; name = TestRunner;
productName = TestRunner; productName = TestRunner;
...@@ -447,6 +455,11 @@ ...@@ -447,6 +455,11 @@
/* End PBXSourcesBuildPhase section */ /* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */ /* Begin PBXTargetDependency section */
130F34EC1D73B132009D968D /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "Sample Framework";
targetProxy = 130F34EB1D73B132009D968D /* PBXContainerItemProxy */;
};
13C623701D3B00F900EFB98B /* PBXTargetDependency */ = { 13C623701D3B00F900EFB98B /* PBXTargetDependency */ = {
isa = PBXTargetDependency; isa = PBXTargetDependency;
name = "Sample Framework"; name = "Sample Framework";
......
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