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
6a267db7
Commit
6a267db7
authored
Oct 10, 2014
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Resolver] Better group resolver delegate methods by module
parent
30f7e9da
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
28 deletions
+41
-28
resolver.rb
lib/cocoapods/resolver.rb
+41
-28
No files found.
lib/cocoapods/resolver.rb
View file @
6a267db7
...
...
@@ -6,9 +6,6 @@ module Pod
# by target for a given Podfile.
#
class
Resolver
include
::
Resolver
::
UI
include
::
Resolver
::
SpecificationProvider
# @return [Sandbox] the Sandbox used by the resolver to find external
# dependencies.
#
...
...
@@ -66,6 +63,40 @@ module Pod
raise
Informative
,
e
.
message
end
# @return [Hash{Podfile::TargetDefinition => Array<Specification>}]
# returns the resolved specifications grouped by target.
#
# @note The returned specifications can be subspecs.
#
def
specs_by_target
@specs_by_target
||=
begin
specs_by_target
=
{}
podfile
.
target_definition_list
.
each
do
|
target
|
specs_by_target
[
target
]
=
target
.
dependencies
.
map
(
&
:name
).
map
do
|
name
|
node
=
@activated
.
vertex_named
(
name
)
(
node
.
recursive_successors
<<
node
).
to_a
end
.
flatten
.
map
(
&
:payload
).
uniq
.
sort
{
|
x
,
y
|
x
.
name
<=>
y
.
name
}.
each
do
|
spec
|
validate_platform
(
spec
,
target
)
sandbox
.
store_head_pod
(
spec
.
name
)
if
spec
.
version
.
head
end
end
specs_by_target
end
end
#-------------------------------------------------------------------------#
public
# @!group Specification Provider
include
::
Resolver
::
SpecificationProvider
def
search_for
(
dependency
)
@search
||=
{}
@search
[
dependency
]
||=
begin
...
...
@@ -117,31 +148,13 @@ module Pod
end
end
# @return [Hash{Podfile::TargetDefinition => Array<Specification>}]
# returns the resolved specifications grouped by target.
#
# @note The returned specifications can be subspecs.
#
def
specs_by_target
@specs_by_target
||=
begin
specs_by_target
=
{}
podfile
.
target_definition_list
.
each
do
|
target
|
specs_by_target
[
target
]
=
target
.
dependencies
.
map
(
&
:name
).
map
do
|
name
|
node
=
@activated
.
vertex_named
(
name
)
(
node
.
recursive_successors
<<
node
).
to_a
end
.
flatten
.
map
(
&
:payload
).
uniq
.
sort
{
|
x
,
y
|
x
.
name
<=>
y
.
name
}.
each
do
|
spec
|
validate_platform
(
spec
,
target
)
sandbox
.
store_head_pod
(
spec
.
name
)
if
spec
.
version
.
head
end
end
specs_by_target
end
end
#-------------------------------------------------------------------------#
public
# @!group Resolver UI
include
::
Resolver
::
UI
#-------------------------------------------------------------------------#
...
...
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