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
979a1465
Unverified
Commit
979a1465
authored
Mar 22, 2018
by
Samuel Giddins
Committed by
GitHub
Mar 22, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7540 from dnkoutso/flat_map_preferred
Use `flat_map` instead of flatten in some cases
parents
46cbc382
17c1e997
Show 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 @
979a1465
...
@@ -219,8 +219,8 @@ module Pod
...
@@ -219,8 +219,8 @@ module Pod
# generated as result of the analyzer.
# generated as result of the analyzer.
#
#
def
pod_targets
def
pod_targets
aggregate_target_pod_targets
=
aggregate_targets
.
map
(
&
:pod_targets
).
flatten
aggregate_target_pod_targets
=
aggregate_targets
.
flat_map
(
&
:pod_targets
)
test_dependent_targets
=
aggregate_target_pod_targets
.
map
(
&
:test_dependent_targets
).
flatten
test_dependent_targets
=
aggregate_target_pod_targets
.
flat_map
(
&
:test_dependent_targets
)
(
aggregate_target_pod_targets
+
test_dependent_targets
).
uniq
(
aggregate_target_pod_targets
+
test_dependent_targets
).
uniq
end
end
...
...
lib/cocoapods/installer/analyzer.rb
View file @
979a1465
...
@@ -340,7 +340,7 @@ module Pod
...
@@ -340,7 +340,7 @@ module Pod
end
end
unless
embedded_targets_missing_hosts
.
empty?
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_names
=
embedded_targets_missing_hosts
.
map
do
|
target
|
target
.
name
.
sub
(
'Pods-'
,
''
)
# Make the target names more recognizable to the user
target
.
name
.
sub
(
'Pods-'
,
''
)
# Make the target names more recognizable to the user
end
.
join
', '
end
.
join
', '
...
...
lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb
View file @
979a1465
...
@@ -182,7 +182,7 @@ module Pod
...
@@ -182,7 +182,7 @@ module Pod
# specs platform combinations.
# specs platform combinations.
#
#
def
file_accessors
def
file_accessors
@file_accessors
||=
pod_targets
.
map
(
&
:file_accessors
).
flatten
.
compact
@file_accessors
||=
pod_targets
.
flat_map
(
&
:file_accessors
)
.
compact
end
end
# Adds file references to the list of the paths returned by the file
# 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 @
979a1465
...
@@ -75,8 +75,8 @@ module Pod
...
@@ -75,8 +75,8 @@ module Pod
input_paths
=
[]
input_paths
=
[]
output_paths
=
[]
output_paths
=
[]
unless
framework_paths
.
empty?
unless
framework_paths
.
empty?
input_paths
=
[
script_path
,
*
framework_paths
.
map
{
|
fw
|
[
fw
[
:input_path
],
fw
[
:dsym_input_path
]]
}.
flatten
.
compact
]
input_paths
=
[
script_path
,
*
framework_paths
.
flat_map
{
|
fw
|
[
fw
[
:input_path
],
fw
[
:dsym_input_path
]]
}
.
compact
]
output_paths
=
framework_paths
.
map
{
|
fw
|
[
fw
[
:output_path
],
fw
[
:dsym_output_path
]]
}.
flatten
.
compact
output_paths
=
framework_paths
.
flat_map
{
|
fw
|
[
fw
[
:output_path
],
fw
[
:dsym_output_path
]]
}
.
compact
end
end
UserProjectIntegrator
::
TargetIntegrator
.
validate_input_output_path_limit
(
input_paths
,
output_paths
)
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
)
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
...
@@ -95,7 +95,7 @@ module Pod
# @return [Array<Hash<Symbol=>String>] an array of all combined script phases from the specs.
# @return [Array<Hash<Symbol=>String>] an array of all combined script phases from the specs.
#
#
def
script_phases_for_specs
(
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
end
end
end
...
...
lib/cocoapods/sandbox/file_accessor.rb
View file @
979a1465
...
@@ -196,9 +196,9 @@ module Pod
...
@@ -196,9 +196,9 @@ module Pod
# shipped with the Pod.
# shipped with the Pod.
#
#
def
vendored_frameworks_headers
def
vendored_frameworks_headers
vendored_frameworks
.
map
do
|
framework
|
vendored_frameworks
.
flat_
map
do
|
framework
|
self
.
class
.
vendored_frameworks_headers
(
framework
)
self
.
class
.
vendored_frameworks_headers
(
framework
)
end
.
flatten
.
uniq
end
.
uniq
end
end
# @return [Array<Pathname>] The paths of the library bundles that come
# @return [Array<Pathname>] The paths of the library bundles that come
...
...
lib/cocoapods/target/aggregate_target.rb
View file @
979a1465
...
@@ -162,7 +162,7 @@ module Pod
...
@@ -162,7 +162,7 @@ module Pod
# @return [Array<Specification>] The specifications used by this aggregate target.
# @return [Array<Specification>] The specifications used by this aggregate target.
#
#
def
specs
def
specs
pod_targets
.
map
(
&
:specs
).
flatten
pod_targets
.
flat_map
(
&
:specs
)
end
end
# @return [Hash{Symbol => Array<Specification>}] The pod targets for each
# @return [Hash{Symbol => Array<Specification>}] The pod targets for each
...
...
spec/unit/installer/xcode/target_validator_spec.rb
View file @
979a1465
...
@@ -28,7 +28,7 @@ module Pod
...
@@ -28,7 +28,7 @@ module Pod
result
=
@analyzer
.
analyze
result
=
@analyzer
.
analyze
aggregate_targets
=
result
.
targets
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
)
sandbox
.
create_file_accessors
(
pod_targets
)
TargetValidator
.
new
(
aggregate_targets
,
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