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
module
Pod
class
Installer
class
Installer
module
Shared
module
Shared
def
dependent_specification
_set
s
def
dependent_specifications
@dependent_specification
_set
s
||=
Resolver
.
new
(
@podfile
,
@definition
?
@definition
.
dependencies
:
nil
).
resolve
@dependent_specifications
||=
Resolver
.
new
(
@podfile
,
@definition
?
@definition
.
dependencies
:
nil
).
resolve
end
end
def
build_specifications
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
end
def
download_only_specifications
def
download_only_specifications
dependent_specification
_sets
.
select
(
&
:only_part_of_other_pod?
).
map
(
&
:specification
)
dependent_specification
s
-
build_specifications
end
end
end
end
...
...
lib/cocoapods/specification.rb
View file @
fc91353f
...
@@ -127,41 +127,7 @@ module Pod
...
@@ -127,41 +127,7 @@ module Pod
end
end
attr_reader
:dependencies
attr_reader
:dependencies
class
Subspec
<
Specification
# Subspec related
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
def
subspec
(
name
,
&
block
)
def
subspec
(
name
,
&
block
)
subspec
=
Subspec
.
new
(
self
,
name
,
&
block
)
subspec
=
Subspec
.
new
(
self
,
name
,
&
block
)
...
@@ -191,6 +157,9 @@ module Pod
...
@@ -191,6 +157,9 @@ module Pod
# Not attributes
# Not attributes
# TODO when we move to use a 'ResolveContext' this should happen there.
attr_accessor
:defined_in_set
include
Config
::
Mixin
include
Config
::
Mixin
def
==
(
other
)
def
==
(
other
)
...
@@ -421,6 +390,46 @@ module Pod
...
@@ -421,6 +390,46 @@ module Pod
def
post_install
(
target
)
def
post_install
(
target
)
end
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
end
Spec
=
Specification
Spec
=
Specification
...
...
lib/cocoapods/specification/set.rb
View file @
fc91353f
...
@@ -55,7 +55,7 @@ module Pod
...
@@ -55,7 +55,7 @@ module Pod
end
end
def
specification
def
specification
@specification
||=
Specification
.
from_file
(
specification_path
)
@specification
||=
Specification
.
from_file
(
specification_path
)
.
tap
{
|
spec
|
spec
.
defined_in_set
=
self
}
end
end
# Return the first version that matches the current dependency.
# Return the first version that matches the current dependency.
...
@@ -85,6 +85,7 @@ module Pod
...
@@ -85,6 +85,7 @@ module Pod
class
External
<
Set
class
External
<
Set
def
initialize
(
specification
)
def
initialize
(
specification
)
@specification
=
specification
@specification
=
specification
@specification
.
defined_in_set
=
self
@required_by
=
[]
@required_by
=
[]
end
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