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
139c2ea0
Commit
139c2ea0
authored
Jan 29, 2016
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Analyzer] Handle when the root spec is not present in all variants
parent
7b6d2edc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
9 deletions
+19
-9
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+3
-1
analyzer_spec.rb
spec/unit/installer/analyzer_spec.rb
+16
-8
No files found.
lib/cocoapods/installer/analyzer.rb
View file @
139c2ea0
...
...
@@ -352,7 +352,9 @@ module Pod
common_specs
=
all_spec_variants
.
reduce
(
all_spec_variants
.
first
,
&
:&
)
result
=
variants
.
map
do
|
variant
|
subspecs
=
variant
.
specs
-
common_specs
subspec_names
=
subspecs
.
map
{
|
spec
|
spec
.
name
.
split
(
'/'
)[
1
..-
1
].
join
(
'_'
)
}
subspec_names
=
subspecs
.
map
do
|
spec
|
spec
.
root?
?
'root'
:
spec
.
name
.
split
(
'/'
)[
1
..-
1
].
join
(
'_'
)
end
.
sort
# => Subspecs names without common subspecs
[
variant
,
subspec_names
.
empty?
?
nil
:
subspec_names
.
join
(
'-'
)]
end
...
...
spec/unit/installer/analyzer_spec.rb
View file @
139c2ea0
...
...
@@ -133,7 +133,7 @@ module Pod
describe
'#scope_suffixes_for_variants'
do
before
do
@analyzer
=
Pod
::
Installer
::
Analyzer
.
new
(
config
.
sandbox
,
stub
(
'Podfile'
),
nil
)
@root_spec
=
stub
(
:name
=>
'Spec'
)
@root_spec
=
stub
(
:name
=>
'Spec'
,
:root?
=>
true
)
end
PodVariant
=
Pod
::
Installer
::
Analyzer
::
PodVariant
.
freeze
...
...
@@ -155,21 +155,29 @@ module Pod
end
it
'returns scopes by subspec names if they qualify'
do
shared_subspec
=
stub
(
:name
=>
'Spec/Shared'
)
shared_subspec
=
stub
(
:name
=>
'Spec/Shared'
,
:root?
=>
false
)
variants
=
[
PodVariant
.
new
([
@root_spec
,
shared_subspec
],
Platform
.
ios
),
PodVariant
.
new
([
@root_spec
,
shared_subspec
,
stub
(
:name
=>
'Spec/Foo'
)],
Platform
.
ios
),
PodVariant
.
new
([
@root_spec
,
shared_subspec
,
stub
(
:name
=>
'Spec/Bar'
)],
Platform
.
ios
),
PodVariant
.
new
([
@root_spec
,
shared_subspec
,
stub
(
:name
=>
'Spec/Foo'
,
:root?
=>
false
)],
Platform
.
ios
),
PodVariant
.
new
([
@root_spec
,
shared_subspec
,
stub
(
:name
=>
'Spec/Bar'
,
:root?
=>
false
)],
Platform
.
ios
),
]
@analyzer
.
send
(
:scope_suffixes_for_variants
,
variants
).
values
.
should
==
[
nil
,
'Foo'
,
'Bar'
]
end
it
'returns scopes by subspec names if they qualify and handle partial root spec presence well'
do
variants
=
[
PodVariant
.
new
([
stub
(
:name
=>
'Spec/Foo'
,
:root?
=>
false
)],
Platform
.
ios
),
PodVariant
.
new
([
@root_spec
,
stub
(
:name
=>
'Spec/Bar'
,
:root?
=>
false
)],
Platform
.
ios
),
]
@analyzer
.
send
(
:scope_suffixes_for_variants
,
variants
).
values
.
should
==
[
'Foo'
,
'Bar-root'
]
end
it
'returns scopes by platform names and subspec names if they qualify'
do
variants
=
[
PodVariant
.
new
([
@root_spec
],
Platform
.
ios
),
PodVariant
.
new
([
@root_spec
,
stub
(
:name
=>
'Spec/Foo'
)],
Platform
.
ios
),
PodVariant
.
new
([
@root_spec
,
stub
(
:name
=>
'Spec/Foo'
,
:root?
=>
false
)],
Platform
.
ios
),
PodVariant
.
new
([
@root_spec
],
Platform
.
osx
),
PodVariant
.
new
([
@root_spec
,
stub
(
:name
=>
'Spec/Bar'
)],
Platform
.
osx
),
PodVariant
.
new
([
@root_spec
,
stub
(
:name
=>
'Spec/Bar'
,
:root?
=>
false
)],
Platform
.
osx
),
]
@analyzer
.
send
(
:scope_suffixes_for_variants
,
variants
).
values
.
should
==
[
'iOS'
,
...
...
@@ -182,9 +190,9 @@ module Pod
it
'returns scopes by versioned platform names and subspec names if they qualify'
do
specs
=
[
PodVariant
.
new
([
@root_spec
],
Platform
.
new
(
:ios
,
'7.0'
)),
PodVariant
.
new
([
@root_spec
,
stub
(
:name
=>
'Spec/Foo'
)],
Platform
.
ios
),
PodVariant
.
new
([
@root_spec
,
stub
(
:name
=>
'Spec/Foo'
,
:root?
=>
false
)],
Platform
.
ios
),
PodVariant
.
new
([
@root_spec
],
Platform
.
osx
),
PodVariant
.
new
([
@root_spec
,
stub
(
:name
=>
'Spec/Bar'
)],
Platform
.
osx
),
PodVariant
.
new
([
@root_spec
,
stub
(
:name
=>
'Spec/Bar'
,
:root?
=>
false
)],
Platform
.
osx
),
]
@analyzer
.
send
(
:scope_suffixes_for_variants
,
specs
).
values
.
should
==
[
'iOS7.0'
,
...
...
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