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
5ee56930
Commit
5ee56930
authored
Feb 08, 2016
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PodVariantSet] Make specs first priority
parent
186c43dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
pod_variant_set.rb
lib/cocoapods/installer/analyzer/pod_variant_set.rb
+3
-3
pod_variant_set_spec.rb
spec/unit/installer/analyzer/pod_variant_set_spec.rb
+8
-6
No files found.
lib/cocoapods/installer/analyzer/pod_variant_set.rb
View file @
5ee56930
...
@@ -21,7 +21,7 @@ module Pod
...
@@ -21,7 +21,7 @@ module Pod
#
#
def
scope_suffixes
def
scope_suffixes
return
{
variants
.
first
=>
nil
}
if
variants
.
count
==
1
return
{
variants
.
first
=>
nil
}
if
variants
.
count
==
1
scope_by_
build_type
scope_by_
specs
end
end
# Groups the collection by result of the block.
# Groups the collection by result of the block.
...
@@ -83,7 +83,7 @@ module Pod
...
@@ -83,7 +83,7 @@ module Pod
# => Platform name + SDK version
# => Platform name + SDK version
platform_name_proc
=
proc
{
|
v
|
v
.
platform
.
to_s
.
tr
(
' '
,
''
)
}
platform_name_proc
=
proc
{
|
v
|
v
.
platform
.
to_s
.
tr
(
' '
,
''
)
}
end
end
scope_if_necessary
(
grouped_variants
.
map
(
&
:scope_
by_specs
),
&
platform_name_proc
)
scope_if_necessary
(
grouped_variants
.
map
(
&
:scope_
without_suffix
),
&
platform_name_proc
)
end
end
# @private
# @private
...
@@ -93,7 +93,7 @@ module Pod
...
@@ -93,7 +93,7 @@ module Pod
grouped_variants
=
group_by
(
&
:specs
)
grouped_variants
=
group_by
(
&
:specs
)
all_spec_variants
=
grouped_variants
.
map
{
|
set
|
set
.
variants
.
first
.
specs
}
all_spec_variants
=
grouped_variants
.
map
{
|
set
|
set
.
variants
.
first
.
specs
}
common_specs
=
all_spec_variants
.
reduce
(
all_spec_variants
.
first
,
&
:&
)
common_specs
=
all_spec_variants
.
reduce
(
all_spec_variants
.
first
,
&
:&
)
scope_if_necessary
(
grouped_variants
.
map
(
&
:scope_
without_suffix
))
do
|
variant
|
scope_if_necessary
(
grouped_variants
.
map
(
&
:scope_
by_build_type
))
do
|
variant
|
subspecs
=
variant
.
specs
-
common_specs
subspecs
=
variant
.
specs
-
common_specs
subspec_names
=
subspecs
.
map
do
|
spec
|
subspec_names
=
subspecs
.
map
do
|
spec
|
spec
.
root?
?
'root'
:
spec
.
name
.
split
(
'/'
)[
1
..-
1
].
join
(
'_'
)
spec
.
root?
?
'root'
:
spec
.
name
.
split
(
'/'
)[
1
..-
1
].
join
(
'_'
)
...
...
spec/unit/installer/analyzer/pod_variant_set_spec.rb
View file @
5ee56930
...
@@ -61,22 +61,22 @@ module Pod
...
@@ -61,22 +61,22 @@ module Pod
it
'returns scopes by platform names and subspec names if they qualify'
do
it
'returns scopes by platform names and subspec names if they qualify'
do
variants
=
PodVariantSet
.
new
([
variants
=
PodVariantSet
.
new
([
PodVariant
.
new
([
@root_spec
],
Platform
.
ios
),
PodVariant
.
new
([
@root_spec
],
Platform
.
ios
),
PodVariant
.
new
([
@root_spec
,
@foo_subspec
],
Platform
.
ios
),
PodVariant
.
new
([
@root_spec
],
Platform
.
osx
),
PodVariant
.
new
([
@root_spec
],
Platform
.
osx
),
PodVariant
.
new
([
@root_spec
,
@foo_subspec
],
Platform
.
ios
),
PodVariant
.
new
([
@root_spec
,
@bar_subspec
],
Platform
.
osx
),
PodVariant
.
new
([
@root_spec
,
@bar_subspec
],
Platform
.
osx
),
])
])
variants
.
scope_suffixes
.
values
.
should
==
[
variants
.
scope_suffixes
.
values
.
should
==
[
'iOS'
,
'iOS'
,
'iOS-Foo'
,
'OSX'
,
'OSX'
,
'OSX-Bar'
,
'Foo'
,
'Bar'
,
]
]
end
end
it
'returns scopes by versioned platform names and subspec names if they qualify'
do
it
'returns scopes by versioned platform names and subspec names if they qualify'
do
variants
=
PodVariantSet
.
new
([
variants
=
PodVariantSet
.
new
([
PodVariant
.
new
([
@root_spec
],
Platform
.
new
(
:ios
,
'7.0'
)),
PodVariant
.
new
([
@root_spec
],
Platform
.
new
(
:ios
,
'7.0'
)),
PodVariant
.
new
([
@root_spec
,
@foo_subspec
],
Platform
.
ios
),
PodVariant
.
new
([
@root_spec
],
Platform
.
ios
),
PodVariant
.
new
([
@root_spec
],
Platform
.
osx
),
PodVariant
.
new
([
@root_spec
],
Platform
.
osx
),
PodVariant
.
new
([
@root_spec
,
@bar_subspec
],
Platform
.
osx
),
PodVariant
.
new
([
@root_spec
,
@bar_subspec
],
Platform
.
osx
),
])
])
...
@@ -84,7 +84,7 @@ module Pod
...
@@ -84,7 +84,7 @@ module Pod
'iOS7.0'
,
'iOS7.0'
,
'iOS'
,
'iOS'
,
'OSX'
,
'OSX'
,
'
OSX-
Bar'
,
'Bar'
,
]
]
end
end
...
@@ -93,13 +93,15 @@ module Pod
...
@@ -93,13 +93,15 @@ module Pod
PodVariant
.
new
([
@root_spec
],
Platform
.
new
(
:ios
,
'7.0'
)),
PodVariant
.
new
([
@root_spec
],
Platform
.
new
(
:ios
,
'7.0'
)),
PodVariant
.
new
([
@root_spec
],
Platform
.
ios
),
PodVariant
.
new
([
@root_spec
],
Platform
.
ios
),
PodVariant
.
new
([
@root_spec
],
Platform
.
osx
,
true
),
PodVariant
.
new
([
@root_spec
],
Platform
.
osx
,
true
),
PodVariant
.
new
([
@root_spec
,
@foo_subspec
],
Platform
.
ios
),
PodVariant
.
new
([
@root_spec
,
@foo_subspec
],
Platform
.
osx
,
true
),
PodVariant
.
new
([
@root_spec
,
@foo_subspec
],
Platform
.
osx
,
true
),
])
])
variants
.
scope_suffixes
.
values
.
should
==
[
variants
.
scope_suffixes
.
values
.
should
==
[
'library-iOS7.0'
,
'library-iOS7.0'
,
'library-iOS'
,
'library-iOS'
,
'framework'
,
'framework'
,
'framework-Foo'
,
'Foo-library'
,
'Foo-framework'
,
]
]
end
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