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
23a2e68e
Commit
23a2e68e
authored
May 10, 2012
by
Jean Regisser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for
https://github.com/CocoaPods/CocoaPods/issues/141
parent
6112aba0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
2 deletions
+44
-2
dependency.rb
lib/cocoapods/dependency.rb
+1
-1
resolver.rb
lib/cocoapods/resolver.rb
+5
-1
podfile_spec.rb
spec/unit/podfile_spec.rb
+8
-0
resolver_spec.rb
spec/unit/resolver_spec.rb
+30
-0
No files found.
lib/cocoapods/dependency.rb
View file @
23a2e68e
...
@@ -19,7 +19,7 @@ module Pod
...
@@ -19,7 +19,7 @@ module Pod
elsif
!
name_and_version_requirements
.
empty?
&&
block
.
nil?
elsif
!
name_and_version_requirements
.
empty?
&&
block
.
nil?
if
name_and_version_requirements
.
last
.
is_a?
(
Hash
)
if
name_and_version_requirements
.
last
.
is_a?
(
Hash
)
@external_source
=
ExternalSources
.
from_params
(
name_and_version_requirements
[
0
],
name_and_version_requirements
.
pop
)
@external_source
=
ExternalSources
.
from_params
(
name_and_version_requirements
[
0
]
.
split
(
'/'
).
first
,
name_and_version_requirements
.
pop
)
end
end
super
(
*
name_and_version_requirements
)
super
(
*
name_and_version_requirements
)
...
...
lib/cocoapods/resolver.rb
View file @
23a2e68e
...
@@ -49,7 +49,11 @@ module Pod
...
@@ -49,7 +49,11 @@ module Pod
# that's being used behind the scenes, but passing it anyways for
# that's being used behind the scenes, but passing it anyways for
# completeness sake.
# completeness sake.
specification
=
external_source
.
specification_from_sandbox
(
@sandbox
,
platform
)
specification
=
external_source
.
specification_from_sandbox
(
@sandbox
,
platform
)
Specification
::
Set
::
External
.
new
(
specification
)
set
=
Specification
::
Set
::
External
.
new
(
specification
)
if
dependency
.
subspec_dependency?
@cached_sets
[
dependency
.
top_level_spec_name
]
||=
set
end
set
else
else
@cached_sources
.
search
(
dependency
)
@cached_sources
.
search
(
dependency
)
end
end
...
...
spec/unit/podfile_spec.rb
View file @
23a2e68e
...
@@ -25,6 +25,14 @@ describe "Pod::Podfile" do
...
@@ -25,6 +25,14 @@ describe "Pod::Podfile" do
dep
=
podfile
.
dependency_by_top_level_spec_name
(
'SomeExternalPod'
)
dep
=
podfile
.
dependency_by_top_level_spec_name
(
'SomeExternalPod'
)
dep
.
external_source
.
params
.
should
==
{
:git
=>
'GIT-URL'
,
:commit
=>
'1234'
}
dep
.
external_source
.
params
.
should
==
{
:git
=>
'GIT-URL'
,
:commit
=>
'1234'
}
end
end
it
"adds a subspec dependency on a Pod repo outside of a spec repo (the repo is expected to contain a podspec)"
do
podfile
=
Pod
::
Podfile
.
new
do
dependency
'MainSpec/FirstSubSpec'
,
:git
=>
'GIT-URL'
,
:commit
=>
'1234'
end
dep
=
podfile
.
dependency_by_top_level_spec_name
(
'MainSpec'
)
dep
.
external_source
.
name
.
should
==
'MainSpec'
end
it
"adds a dependency on a library outside of a spec repo (the repo does not need to contain a podspec)"
do
it
"adds a dependency on a library outside of a spec repo (the repo does not need to contain a podspec)"
do
podfile
=
Pod
::
Podfile
.
new
do
podfile
=
Pod
::
Podfile
.
new
do
...
...
spec/unit/resolver_spec.rb
View file @
23a2e68e
...
@@ -90,5 +90,35 @@ describe "Pod::Resolver" do
...
@@ -90,5 +90,35 @@ describe "Pod::Resolver" do
cocoa-oauth
cocoa-oauth
}
}
end
end
it
"resolves subspecs with external constraints"
do
@podfile
=
Pod
::
Podfile
.
new
do
platform
:ios
dependency
'MainSpec/FirstSubSpec'
,
:git
=>
'GIT-URL'
end
spec
=
Pod
::
Spec
.
new
do
|
s
|
s
.
name
=
'MainSpec'
s
.
version
=
'1.2.3'
s
.
platform
=
:ios
s
.
license
=
'MIT'
s
.
author
=
'Joe the Plumber'
s
.
summary
=
'A spec with subspecs'
s
.
source
=
{
:git
=>
'/some/url'
}
s
.
requires_arc
=
true
s
.
subspec
'FirstSubSpec'
do
|
fss
|
fss
.
source_files
=
'some/file'
fss
.
subspec
'SecondSubSpec'
do
|
sss
|
end
end
end
@podfile
.
dependencies
.
first
.
external_source
.
stubs
(
:specification_from_sandbox
).
returns
(
spec
)
resolver
=
Pod
::
Resolver
.
new
(
@podfile
,
stub
(
'sandbox'
))
resolver
.
resolve
.
values
.
flatten
.
map
(
&
:name
).
sort
.
should
==
%w{
MainSpec
MainSpec/FirstSubSpec
}
end
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