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
245b8dd9
Commit
245b8dd9
authored
Jan 18, 2018
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PodTarget] Slightly speed up #should_build?
parent
6c8b9cb3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
pod_target.rb
lib/cocoapods/target/pod_target.rb
+9
-8
No files found.
lib/cocoapods/target/pod_target.rb
View file @
245b8dd9
...
@@ -162,17 +162,18 @@ module Pod
...
@@ -162,17 +162,18 @@ module Pod
# to this target.
# to this target.
attr_reader
:test_resource_bundle_targets
attr_reader
:test_resource_bundle_targets
# @return [Bool] Whether or not this target should be buil
d
.
# @return [Bool] Whether or not this target should be buil
t
.
#
#
# A target should not be buil
d
if it has no source files.
# A target should not be buil
t
if it has no source files.
#
#
def
should_build?
def
should_build?
return
@should_build
if
defined?
@should_build
return
@should_build
if
defined?
@should_build
@should_build
=
begin
source_files
=
file_accessors
.
flat_map
(
&
:source_files
)
return
@should_build
=
true
if
contains_script_phases?
source_files
-=
file_accessors
.
flat_map
(
&
:headers
)
!
source_files
.
empty?
||
contains_script_phases?
source_files
=
file_accessors
.
flat_map
(
&
:source_files
)
end
source_files
-=
file_accessors
.
flat_map
(
&
:headers
)
@should_build
=
!
source_files
.
empty?
end
end
# @return [Array<Specification::Consumer>] the specification consumers for
# @return [Array<Specification::Consumer>] the specification consumers for
...
@@ -196,7 +197,7 @@ module Pod
...
@@ -196,7 +197,7 @@ module Pod
# @return [Array<Hash{Symbol=>String}>] An array of hashes where each hash represents a single script phase.
# @return [Array<Hash{Symbol=>String}>] An array of hashes where each hash represents a single script phase.
#
#
def
script_phases
def
script_phases
spec_consumers
.
map
(
&
:script_phases
).
flatten
spec_consumers
.
flat_map
(
&
:script_phases
)
end
end
# @return [Boolean] Whether the target contains any script phases.
# @return [Boolean] Whether the target contains any script phases.
...
...
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