Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
9c6c248e
Commit
9c6c248e
authored
Aug 29, 2016
by
Ben Asher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated fixture to expose bug. Added comments
parent
9b785e21
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+9
-0
project.pbxproj
...res/SampleProject/SampleProject.xcodeproj/project.pbxproj
+13
-0
No files found.
lib/cocoapods/installer/analyzer.rb
View file @
9c6c248e
...
@@ -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
if
target_definitions_by_uuid
.
key?
uuid
(
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
...
...
spec/fixtures/SampleProject/SampleProject.xcodeproj/project.pbxproj
View file @
9c6c248e
...
@@ -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"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment