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
c2579913
Commit
c2579913
authored
Feb 01, 2016
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Analyzer] Simplify logic in #generate_pod_targets
parent
9857fee7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
+8
-10
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+3
-10
pod_variant_set_spec.rb
spec/unit/installer/analyzer/pod_variant_set_spec.rb
+5
-0
No files found.
lib/cocoapods/installer/analyzer.rb
View file @
c2579913
...
...
@@ -299,16 +299,9 @@ module Pod
end
pod_targets
=
distinct_targets
.
flat_map
do
|
_root
,
target_definitions_by_variant
|
if
target_definitions_by_variant
.
count
>
1
# There are different sets of subspecs or the spec is used across different platforms
hash
=
Hash
[
array
]
suffixes
=
PodVariantSet
.
new
(
hash
.
keys
).
scope_suffixes
hash
.
flat_map
do
|
variant
,
target_definitions
|
generate_pod_target
(
target_definitions
,
variant
.
specs
,
:scope_suffix
=>
suffixes
[
variant
])
end
else
variant
,
target_definitions
=
*
array
.
first
generate_pod_target
(
target_definitions
,
variant
.
specs
)
suffixes
=
PodVariantSet
.
new
(
target_definitions_by_variant
.
keys
).
scope_suffixes
target_definitions_by_variant
.
flat_map
do
|
variant
,
target_definitions
|
generate_pod_target
(
target_definitions
,
variant
.
specs
,
:scope_suffix
=>
suffixes
[
variant
])
end
end
else
...
...
spec/unit/installer/analyzer/pod_variant_set_spec.rb
View file @
c2579913
...
...
@@ -9,6 +9,11 @@ module Pod
PodVariant
=
Pod
::
Installer
::
Analyzer
::
PodVariant
.
freeze
it
'returns an empty scope if there is only one variant'
do
variants
=
PodVariantSet
.
new
([
PodVariant
.
new
([
@root_spec
],
Platform
.
ios
)])
variants
.
scope_suffixes
.
values
.
should
==
[
nil
]
end
it
'returns scopes by built types if they qualify'
do
variants
=
PodVariantSet
.
new
([
PodVariant
.
new
([
@root_spec
],
Platform
.
ios
,
true
),
...
...
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