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
49f6b100
Commit
49f6b100
authored
Sep 10, 2016
by
Dimitris Couchell-Koutsogiorgas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache result of uses_swift and should_build
parent
f5cc0b09
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
CHANGELOG.md
CHANGELOG.md
+4
-1
pod_target.rb
lib/cocoapods/target/pod_target.rb
+11
-5
No files found.
CHANGELOG.md
View file @
49f6b100
...
@@ -8,7 +8,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -8,7 +8,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Enhancements
##### Enhancements
*
None.
*
Cache result of uses_swift and should_build to speed up pod install.
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#5837
](
https://github.com/CocoaPods/CocoaPods/pull/5837
)
##### Bug Fixes
##### Bug Fixes
...
...
lib/cocoapods/target/pod_target.rb
View file @
49f6b100
...
@@ -141,9 +141,12 @@ module Pod
...
@@ -141,9 +141,12 @@ module Pod
# A target should not be build if it has no source files.
# A target should not be build if it has no source files.
#
#
def
should_build?
def
should_build?
source_files
=
file_accessors
.
flat_map
(
&
:source_files
)
return
@should_build
if
defined?
@should_build
source_files
-=
file_accessors
.
flat_map
(
&
:headers
)
@should_build
=
begin
!
source_files
.
empty?
source_files
=
file_accessors
.
flat_map
(
&
:source_files
)
source_files
-=
file_accessors
.
flat_map
(
&
:headers
)
!
source_files
.
empty?
end
end
end
# @return [Array<Specification::Consumer>] the specification consumers for
# @return [Array<Specification::Consumer>] the specification consumers for
...
@@ -156,8 +159,11 @@ module Pod
...
@@ -156,8 +159,11 @@ module Pod
# @return [Boolean] Whether the target uses Swift code
# @return [Boolean] Whether the target uses Swift code
#
#
def
uses_swift?
def
uses_swift?
file_accessors
.
any?
do
|
file_accessor
|
return
@uses_swift
if
defined?
@uses_swift
file_accessor
.
source_files
.
any?
{
|
sf
|
sf
.
extname
==
'.swift'
}
@uses_swift
=
begin
file_accessors
.
any?
do
|
file_accessor
|
file_accessor
.
source_files
.
any?
{
|
sf
|
sf
.
extname
==
'.swift'
}
end
end
end
end
end
...
...
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