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
6dad677f
Commit
6dad677f
authored
Feb 23, 2018
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[AggregateTarget] Cache relevant pod target arrays
parent
22344e39
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
10 deletions
+11
-10
xcconfig_helper.rb
lib/cocoapods/generator/xcconfig/xcconfig_helper.rb
+1
-2
aggregate_target.rb
lib/cocoapods/target/aggregate_target.rb
+9
-7
aggregate_xcconfig_spec.rb
spec/unit/generator/xcconfig/aggregate_xcconfig_spec.rb
+1
-1
xcconfig_helper_spec.rb
spec/unit/generator/xcconfig/xcconfig_helper_spec.rb
+0
-0
No files found.
lib/cocoapods/generator/xcconfig/xcconfig_helper.rb
View file @
6dad677f
...
@@ -140,8 +140,7 @@ module Pod
...
@@ -140,8 +140,7 @@ module Pod
#
#
def
self
.
links_dependency?
(
aggregate_target
,
pod_target
)
def
self
.
links_dependency?
(
aggregate_target
,
pod_target
)
return
true
if
aggregate_target
.
nil?
||
aggregate_target
.
target_definition
.
inheritance
==
'complete'
return
true
if
aggregate_target
.
nil?
||
aggregate_target
.
target_definition
.
inheritance
==
'complete'
targets
=
aggregate_target
.
pod_targets
-
aggregate_target
.
search_paths_aggregate_targets
.
flat_map
(
&
:pod_targets
)
aggregate_target
.
pod_targets_to_link
.
include?
(
pod_target
)
targets
.
include?
(
pod_target
)
end
end
# Adds build settings for dynamic vendored frameworks and libraries.
# Adds build settings for dynamic vendored frameworks and libraries.
...
...
lib/cocoapods/target/aggregate_target.rb
View file @
6dad677f
...
@@ -140,7 +140,7 @@ module Pod
...
@@ -140,7 +140,7 @@ module Pod
# @return [Array<AggregateTarget>] The aggregate targets whose pods this
# @return [Array<AggregateTarget>] The aggregate targets whose pods this
# target must be able to import, but will not directly link against.
# target must be able to import, but will not directly link against.
#
#
attr_
accesso
r
:search_paths_aggregate_targets
attr_
reade
r
:search_paths_aggregate_targets
# @param [String] build_configuration The build configuration for which the
# @param [String] build_configuration The build configuration for which the
# the pod targets should be returned.
# the pod targets should be returned.
...
@@ -149,11 +149,16 @@ module Pod
...
@@ -149,11 +149,16 @@ module Pod
# configuration.
# configuration.
#
#
def
pod_targets_for_build_configuration
(
build_configuration
)
def
pod_targets_for_build_configuration
(
build_configuration
)
pod_targets
.
select
do
|
pod_target
|
@pod_targets_for_build_configuration
||=
{}
@pod_targets_for_build_configuration
[
build_configuration
]
||=
pod_targets
.
select
do
|
pod_target
|
pod_target
.
include_in_build_config?
(
target_definition
,
build_configuration
)
pod_target
.
include_in_build_config?
(
target_definition
,
build_configuration
)
end
end
end
end
def
pod_targets_to_link
@pod_targets_to_link
||=
pod_targets
.
to_set
-
search_paths_aggregate_targets
.
flat_map
(
&
:pod_targets
)
end
# @return [Array<Specification>] The specifications used by this aggregate target.
# @return [Array<Specification>] The specifications used by this aggregate target.
#
#
def
specs
def
specs
...
@@ -191,9 +196,7 @@ module Pod
...
@@ -191,9 +196,7 @@ module Pod
@framework_paths_by_config
||=
begin
@framework_paths_by_config
||=
begin
framework_paths_by_config
=
{}
framework_paths_by_config
=
{}
user_build_configurations
.
keys
.
each
do
|
config
|
user_build_configurations
.
keys
.
each
do
|
config
|
relevant_pod_targets
=
pod_targets
.
select
do
|
pod_target
|
relevant_pod_targets
=
pod_targets_for_build_configuration
(
config
)
pod_target
.
include_in_build_config?
(
target_definition
,
config
)
end
framework_paths_by_config
[
config
]
=
relevant_pod_targets
.
flat_map
{
|
pt
|
pt
.
framework_paths
(
false
)
}
framework_paths_by_config
[
config
]
=
relevant_pod_targets
.
flat_map
{
|
pt
|
pt
.
framework_paths
(
false
)
}
end
end
framework_paths_by_config
framework_paths_by_config
...
@@ -208,8 +211,7 @@ module Pod
...
@@ -208,8 +211,7 @@ module Pod
pod_target
.
should_build?
&&
pod_target
.
requires_frameworks?
&&
!
pod_target
.
static_framework?
pod_target
.
should_build?
&&
pod_target
.
requires_frameworks?
&&
!
pod_target
.
static_framework?
end
end
user_build_configurations
.
keys
.
each_with_object
({})
do
|
config
,
resources_by_config
|
user_build_configurations
.
keys
.
each_with_object
({})
do
|
config
,
resources_by_config
|
resources_by_config
[
config
]
=
relevant_pod_targets
.
flat_map
do
|
pod_target
|
resources_by_config
[
config
]
=
(
relevant_pod_targets
&
pod_targets_for_build_configuration
(
config
)).
flat_map
do
|
pod_target
|
next
[]
unless
pod_target
.
include_in_build_config?
(
target_definition
,
config
)
(
pod_target
.
resource_paths
(
false
)
+
[
bridge_support_file
].
compact
).
uniq
(
pod_target
.
resource_paths
(
false
)
+
[
bridge_support_file
].
compact
).
uniq
end
end
end
end
...
...
spec/unit/generator/xcconfig/aggregate_xcconfig_spec.rb
View file @
6dad677f
...
@@ -497,7 +497,7 @@ module Pod
...
@@ -497,7 +497,7 @@ module Pod
it
'should include inherited search paths'
do
it
'should include inherited search paths'
do
# It's the responsibility of the analyzer to
# It's the responsibility of the analyzer to
# populate this when the file is loaded.
# populate this when the file is loaded.
@blank_target
.
search_paths_aggregate_targets
=
[
@target
]
@blank_target
.
search_paths_aggregate_targets
.
replace
[
@target
]
@xcconfig
=
@generator
.
generate
@xcconfig
=
@generator
.
generate
@xcconfig
.
to_hash
[
'FRAMEWORK_SEARCH_PATHS'
].
should
.
not
.
be
.
nil
@xcconfig
.
to_hash
[
'FRAMEWORK_SEARCH_PATHS'
].
should
.
not
.
be
.
nil
end
end
...
...
spec/unit/generator/xcconfig/xcconfig_helper_spec.rb
View file @
6dad677f
This diff is collapsed.
Click to expand it.
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