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
ac9250e4
Commit
ac9250e4
authored
Sep 14, 2016
by
Samuel Giddins
Committed by
GitHub
Sep 14, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5837 from dnkoutso/master
Cache result of uses_swift and should_build
parents
7bef87f9
49f6b100
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 @
ac9250e4
...
...
@@ -8,7 +8,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### 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
...
...
lib/cocoapods/target/pod_target.rb
View file @
ac9250e4
...
...
@@ -141,9 +141,12 @@ module Pod
# A target should not be build if it has no source files.
#
def
should_build?
source_files
=
file_accessors
.
flat_map
(
&
:source_files
)
source_files
-=
file_accessors
.
flat_map
(
&
:headers
)
!
source_files
.
empty?
return
@should_build
if
defined?
@should_build
@should_build
=
begin
source_files
=
file_accessors
.
flat_map
(
&
:source_files
)
source_files
-=
file_accessors
.
flat_map
(
&
:headers
)
!
source_files
.
empty?
end
end
# @return [Array<Specification::Consumer>] the specification consumers for
...
...
@@ -156,8 +159,11 @@ module Pod
# @return [Boolean] Whether the target uses Swift code
#
def
uses_swift?
file_accessors
.
any?
do
|
file_accessor
|
file_accessor
.
source_files
.
any?
{
|
sf
|
sf
.
extname
==
'.swift'
}
return
@uses_swift
if
defined?
@uses_swift
@uses_swift
=
begin
file_accessors
.
any?
do
|
file_accessor
|
file_accessor
.
source_files
.
any?
{
|
sf
|
sf
.
extname
==
'.swift'
}
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