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
17c1e997
Commit
17c1e997
authored
Mar 22, 2018
by
Dimitris Koutsogiorgas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `flat_map` instead of flatten in some cases
parent
0778a2aa
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
11 deletions
+11
-11
installer.rb
lib/cocoapods/installer.rb
+2
-2
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+1
-1
file_references_installer.rb
...xcode/pods_project_generator/file_references_installer.rb
+1
-1
pod_target_integrator.rb
...ler/xcode/pods_project_generator/pod_target_integrator.rb
+3
-3
file_accessor.rb
lib/cocoapods/sandbox/file_accessor.rb
+2
-2
aggregate_target.rb
lib/cocoapods/target/aggregate_target.rb
+1
-1
target_validator_spec.rb
spec/unit/installer/xcode/target_validator_spec.rb
+1
-1
No files found.
lib/cocoapods/installer.rb
View file @
17c1e997
...
...
@@ -219,8 +219,8 @@ module Pod
# generated as result of the analyzer.
#
def
pod_targets
aggregate_target_pod_targets
=
aggregate_targets
.
map
(
&
:pod_targets
).
flatten
test_dependent_targets
=
aggregate_target_pod_targets
.
map
(
&
:test_dependent_targets
).
flatten
aggregate_target_pod_targets
=
aggregate_targets
.
flat_map
(
&
:pod_targets
)
test_dependent_targets
=
aggregate_target_pod_targets
.
flat_map
(
&
:test_dependent_targets
)
(
aggregate_target_pod_targets
+
test_dependent_targets
).
uniq
end
...
...
lib/cocoapods/installer/analyzer.rb
View file @
17c1e997
...
...
@@ -340,7 +340,7 @@ module Pod
end
unless
embedded_targets_missing_hosts
.
empty?
embedded_targets_missing_hosts_product_types
=
Set
.
new
embedded_targets_missing_hosts
.
map
(
&
:user_targets
).
flatten
.
map
(
&
:symbol_type
)
embedded_targets_missing_hosts_product_types
=
Set
.
new
embedded_targets_missing_hosts
.
flat_map
(
&
:user_targets
)
.
map
(
&
:symbol_type
)
target_names
=
embedded_targets_missing_hosts
.
map
do
|
target
|
target
.
name
.
sub
(
'Pods-'
,
''
)
# Make the target names more recognizable to the user
end
.
join
', '
...
...
lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb
View file @
17c1e997
...
...
@@ -182,7 +182,7 @@ module Pod
# specs platform combinations.
#
def
file_accessors
@file_accessors
||=
pod_targets
.
map
(
&
:file_accessors
).
flatten
.
compact
@file_accessors
||=
pod_targets
.
flat_map
(
&
:file_accessors
)
.
compact
end
# Adds file references to the list of the paths returned by the file
...
...
lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb
View file @
17c1e997
...
...
@@ -75,8 +75,8 @@ module Pod
input_paths
=
[]
output_paths
=
[]
unless
framework_paths
.
empty?
input_paths
=
[
script_path
,
*
framework_paths
.
map
{
|
fw
|
[
fw
[
:input_path
],
fw
[
:dsym_input_path
]]
}.
flatten
.
compact
]
output_paths
=
framework_paths
.
map
{
|
fw
|
[
fw
[
:output_path
],
fw
[
:dsym_output_path
]]
}.
flatten
.
compact
input_paths
=
[
script_path
,
*
framework_paths
.
flat_map
{
|
fw
|
[
fw
[
:input_path
],
fw
[
:dsym_input_path
]]
}
.
compact
]
output_paths
=
framework_paths
.
flat_map
{
|
fw
|
[
fw
[
:output_path
],
fw
[
:dsym_output_path
]]
}
.
compact
end
UserProjectIntegrator
::
TargetIntegrator
.
validate_input_output_path_limit
(
input_paths
,
output_paths
)
UserProjectIntegrator
::
TargetIntegrator
.
create_or_update_embed_frameworks_script_phase_to_target
(
native_target
,
script_path
,
input_paths
,
output_paths
)
...
...
@@ -95,7 +95,7 @@ module Pod
# @return [Array<Hash<Symbol=>String>] an array of all combined script phases from the specs.
#
def
script_phases_for_specs
(
specs
)
specs
.
map
{
|
spec
|
spec
.
consumer
(
target
.
platform
)
}.
map
(
&
:script_phases
).
flatten
specs
.
flat_map
{
|
spec
|
spec
.
consumer
(
target
.
platform
).
script_phases
}
end
end
end
...
...
lib/cocoapods/sandbox/file_accessor.rb
View file @
17c1e997
...
...
@@ -196,9 +196,9 @@ module Pod
# shipped with the Pod.
#
def
vendored_frameworks_headers
vendored_frameworks
.
map
do
|
framework
|
vendored_frameworks
.
flat_
map
do
|
framework
|
self
.
class
.
vendored_frameworks_headers
(
framework
)
end
.
flatten
.
uniq
end
.
uniq
end
# @return [Array<Pathname>] The paths of the library bundles that come
...
...
lib/cocoapods/target/aggregate_target.rb
View file @
17c1e997
...
...
@@ -162,7 +162,7 @@ module Pod
# @return [Array<Specification>] The specifications used by this aggregate target.
#
def
specs
pod_targets
.
map
(
&
:specs
).
flatten
pod_targets
.
flat_map
(
&
:specs
)
end
# @return [Hash{Symbol => Array<Specification>}] The pod targets for each
...
...
spec/unit/installer/xcode/target_validator_spec.rb
View file @
17c1e997
...
...
@@ -28,7 +28,7 @@ module Pod
result
=
@analyzer
.
analyze
aggregate_targets
=
result
.
targets
pod_targets
=
aggregate_targets
.
map
(
&
:pod_targets
).
flatten
.
uniq
pod_targets
=
aggregate_targets
.
flat_map
(
&
:pod_targets
)
.
uniq
sandbox
.
create_file_accessors
(
pod_targets
)
TargetValidator
.
new
(
aggregate_targets
,
pod_targets
)
...
...
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