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
29f2b7bd
Unverified
Commit
29f2b7bd
authored
Apr 21, 2018
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BuildSettings] Properly filter out pod targets whose specs are subsets of another target
parent
70036af6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
build_settings.rb
lib/cocoapods/target/build_settings.rb
+25
-2
pod_target_settings_spec.rb
spec/unit/target/build_settings/pod_target_settings_spec.rb
+1
-0
No files found.
lib/cocoapods/target/build_settings.rb
View file @
29f2b7bd
...
...
@@ -434,6 +434,25 @@ module Pod
end
end
# Filters out pod targets whose `specs` are a subset of
# another target's.
#
# @param [Array<PodTarget>] dependent_targets
#
# @return [Array<PodTarget>]
#
def
select_maximal_pod_targets
(
pod_targets
)
subset_targets
=
[]
pod_targets
.
uniq
.
combination
(
2
)
do
|
a
,
b
|
if
(
a
.
specs
-
b
.
specs
).
empty?
subset_targets
<<
a
elsif
(
b
.
specs
-
a
.
specs
).
empty?
subset_targets
<<
b
end
end
pod_targets
-
subset_targets
end
# A subclass that generates build settings for a {PodTarget}
class
PodTargetSettings
<
BuildSettings
#-------------------------------------------------------------------------#
...
...
@@ -755,11 +774,13 @@ module Pod
# @return [Array<PodTarget>]
define_build_settings_method
:dependent_targets
,
:memoized
=>
true
do
select_maximal_pod_targets
(
if
test_xcconfig?
target
.
all_dependent_targets
else
target
.
recursive_dependent_targets
end
end
,
)
end
# @return [Hash<String => String>]
...
...
@@ -1035,7 +1056,9 @@ module Pod
# @return [Array<PodTarget>]
define_build_settings_method
:search_paths_aggregate_target_pod_target_build_settings
,
:memoized
=>
true
,
:uniqued
=>
true
do
target
.
search_paths_aggregate_targets
.
flat_map
{
|
at
|
at
.
build_settings
(
configuration_name
).
pod_targets
.
flat_map
(
&
:build_settings
)
}
pod_targets
=
target
.
search_paths_aggregate_targets
.
flat_map
{
|
at
|
at
.
build_settings
(
configuration_name
).
pod_targets
}
pod_targets
=
select_maximal_pod_targets
(
pod_targets
)
pod_targets
.
flat_map
(
&
:build_settings
)
end
# Returns the +user_target_xcconfig+ for all pod targets and their spec
...
...
spec/unit/target/build_settings/pod_target_settings_spec.rb
View file @
29f2b7bd
...
...
@@ -44,6 +44,7 @@ module Pod
:spec_consumers
=>
[
consumer
],
:uses_modular_headers?
=>
false
,
:uses_swift?
=>
false
,
:specs
=>
[
vspec
],
)
vendored_dep_target
.
stubs
(
:build_settings
=>
PodTargetSettings
.
new
(
vendored_dep_target
,
false
))
...
...
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