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
d6138f8b
Commit
d6138f8b
authored
Jun 07, 2017
by
Dimitris Koutsogiorgas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a cache when figuring out if a pod target is test only
parent
18bcb87a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
CHANGELOG.md
CHANGELOG.md
+4
-0
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+13
-5
No files found.
CHANGELOG.md
View file @
d6138f8b
...
@@ -45,6 +45,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -45,6 +45,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
##### Bug Fixes
*
Use a cache when figuring out if a pod target is test only
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#6787
](
https://github.com/CocoaPods/CocoaPods/pull/6787
)
*
Do not double add search paths to test xcconfig from parent
*
Do not double add search paths to test xcconfig from parent
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#6767
](
https://github.com/CocoaPods/CocoaPods/pull/6767
)
[
#6767
](
https://github.com/CocoaPods/CocoaPods/pull/6767
)
...
...
lib/cocoapods/installer/analyzer.rb
View file @
d6138f8b
...
@@ -46,6 +46,8 @@ module Pod
...
@@ -46,6 +46,8 @@ module Pod
@update
=
false
@update
=
false
@allow_pre_downloads
=
true
@allow_pre_downloads
=
true
@has_dependencies
=
true
@has_dependencies
=
true
@test_pod_target_analyzer_cache
=
{}
@test_pod_target_key
=
Struct
.
new
(
:name
,
:pod_targets
)
end
end
# Performs the analysis.
# Performs the analysis.
...
@@ -430,8 +432,9 @@ module Pod
...
@@ -430,8 +432,9 @@ module Pod
target
.
pod_targets
=
pod_targets
.
select
do
|
pod_target
|
target
.
pod_targets
=
pod_targets
.
select
do
|
pod_target
|
target_definition_included
=
pod_target
.
target_definitions
.
include?
(
target_definition
)
target_definition_included
=
pod_target
.
target_definitions
.
include?
(
target_definition
)
explicitly_defined_in_target_definition
=
target_definition
.
non_inherited_dependencies
.
map
(
&
:name
).
include?
(
pod_target
.
name
)
explicitly_defined_in_target_definition
=
target_definition
.
non_inherited_dependencies
.
map
(
&
:name
).
include?
(
pod_target
.
name
)
test_pod_target_only
=
pod_target_test_only?
(
pod_target
,
pod_targets
)
next
false
unless
target_definition_included
target_definition_included
&&
(
explicitly_defined_in_target_definition
||
!
test_pod_target_only
)
next
true
if
explicitly_defined_in_target_definition
!
pod_target_test_only?
(
pod_target
,
pod_targets
)
end
end
target
target
...
@@ -449,9 +452,14 @@ module Pod
...
@@ -449,9 +452,14 @@ module Pod
# @return [Boolean] if the pod target is only referenced from test dependencies.
# @return [Boolean] if the pod target is only referenced from test dependencies.
#
#
def
pod_target_test_only?
(
pod_target
,
pod_targets
)
def
pod_target_test_only?
(
pod_target
,
pod_targets
)
source
=
pod_targets
.
any?
{
|
pt
|
pt
.
dependent_targets
.
map
(
&
:name
).
include?
(
pod_target
.
name
)
}
name
=
pod_target
.
name
test
=
pod_targets
.
any?
{
|
pt
|
pt
.
test_dependent_targets
.
map
(
&
:name
).
include?
(
pod_target
.
name
)
}
key
=
@test_pod_target_key
.
new
(
name
,
pod_targets
)
!
source
&&
test
if
@test_pod_target_analyzer_cache
.
key?
(
key
)
return
@test_pod_target_analyzer_cache
[
key
]
end
source
=
pod_targets
.
any?
{
|
pt
|
pt
.
dependent_targets
.
map
(
&
:name
).
include?
(
name
)
}
test
=
pod_targets
.
any?
{
|
pt
|
pt
.
test_dependent_targets
.
map
(
&
:name
).
include?
(
name
)
}
@test_pod_target_analyzer_cache
[
key
]
=
!
source
&&
test
end
end
# Setup the pod targets for an aggregate target. Deduplicates resulting
# Setup the pod targets for an aggregate target. Deduplicates resulting
...
...
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