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
fc91353f
Commit
fc91353f
authored
Nov 23, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the installer work again, now that a resolver returns specs instead of sets.
parent
fccabd9f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
40 deletions
+50
-40
installer.rb
lib/cocoapods/installer.rb
+4
-4
specification.rb
lib/cocoapods/specification.rb
+44
-35
set.rb
lib/cocoapods/specification/set.rb
+2
-1
No files found.
lib/cocoapods/installer.rb
View file @
fc91353f
module
Pod
class
Installer
module
Shared
def
dependent_specification
_set
s
@dependent_specification
_set
s
||=
Resolver
.
new
(
@podfile
,
@definition
?
@definition
.
dependencies
:
nil
).
resolve
def
dependent_specifications
@dependent_specifications
||=
Resolver
.
new
(
@podfile
,
@definition
?
@definition
.
dependencies
:
nil
).
resolve
end
def
build_specifications
dependent_specification
_sets
.
reject
(
&
:only_part_of_other_pod?
).
map
(
&
:specification
)
dependent_specification
s
.
reject
{
|
spec
|
spec
.
defined_in_set
.
only_part_of_other_pod?
}
end
def
download_only_specifications
dependent_specification
_sets
.
select
(
&
:only_part_of_other_pod?
).
map
(
&
:specification
)
dependent_specification
s
-
build_specifications
end
end
...
...
lib/cocoapods/specification.rb
View file @
fc91353f
...
...
@@ -127,41 +127,7 @@ module Pod
end
attr_reader
:dependencies
class
Subspec
<
Specification
attr_reader
:parent
def
initialize
(
parent
,
name
)
@parent
,
@name
=
parent
,
name
# TODO a MacRuby bug, the correct super impl `initialize' is not called consistently
#super(&block)
@dependencies
,
@resources
,
@clean_paths
,
@subspecs
=
[],
[],
[],
[]
@xcconfig
=
Xcodeproj
::
Config
.
new
self
.
part_of
=
top_level_parent
.
name
,
top_level_parent
.
version
yield
self
if
block_given?
end
undef_method
:name
=
,
:version
=
,
:source
=
def
top_level_parent
top_level_parent
=
@parent
top_level_parent
=
top_level_parent
.
parent
while
top_level_parent
.
is_a?
(
Subspec
)
top_level_parent
end
def
name
"
#{
@parent
.
name
}
/
#{
@name
}
"
end
def
summary
@summary
?
@summary
:
top_level_parent
.
summary
end
def
source
top_level_parent
.
source
end
end
# Subspec related
def
subspec
(
name
,
&
block
)
subspec
=
Subspec
.
new
(
self
,
name
,
&
block
)
...
...
@@ -191,6 +157,9 @@ module Pod
# Not attributes
# TODO when we move to use a 'ResolveContext' this should happen there.
attr_accessor
:defined_in_set
include
Config
::
Mixin
def
==
(
other
)
...
...
@@ -421,6 +390,46 @@ module Pod
def
post_install
(
target
)
end
class
Subspec
<
Specification
attr_reader
:parent
def
initialize
(
parent
,
name
)
@parent
,
@name
=
parent
,
name
# TODO a MacRuby bug, the correct super impl `initialize' is not called consistently
#super(&block)
@dependencies
,
@resources
,
@clean_paths
,
@subspecs
=
[],
[],
[],
[]
@xcconfig
=
Xcodeproj
::
Config
.
new
self
.
part_of
=
top_level_parent
.
name
,
top_level_parent
.
version
yield
self
if
block_given?
end
undef_method
:name
=
,
:version
=
,
:source
=
,
:defined_in_set
=
def
top_level_parent
top_level_parent
=
@parent
top_level_parent
=
top_level_parent
.
parent
while
top_level_parent
.
is_a?
(
Subspec
)
top_level_parent
end
def
name
"
#{
@parent
.
name
}
/
#{
@name
}
"
end
def
summary
@summary
?
@summary
:
top_level_parent
.
summary
end
def
source
top_level_parent
.
source
end
def
defined_in_set
top_level_parent
.
defined_in_set
end
end
end
Spec
=
Specification
...
...
lib/cocoapods/specification/set.rb
View file @
fc91353f
...
...
@@ -55,7 +55,7 @@ module Pod
end
def
specification
@specification
||=
Specification
.
from_file
(
specification_path
)
@specification
||=
Specification
.
from_file
(
specification_path
)
.
tap
{
|
spec
|
spec
.
defined_in_set
=
self
}
end
# Return the first version that matches the current dependency.
...
...
@@ -85,6 +85,7 @@ module Pod
class
External
<
Set
def
initialize
(
specification
)
@specification
=
specification
@specification
.
defined_in_set
=
self
@required_by
=
[]
end
...
...
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