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
3395336a
Commit
3395336a
authored
Apr 28, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3468 from CocoaPods/ignore-headers-for-should_build
No pod target if `source_files` only has headers.
parents
7e2faef5
256bf52e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletion
+23
-1
CHANGELOG.md
CHANGELOG.md
+4
-0
pod_target.rb
lib/cocoapods/target/pod_target.rb
+3
-1
pod_target_spec.rb
spec/unit/target/pod_target_spec.rb
+16
-0
No files found.
CHANGELOG.md
View file @
3395336a
...
@@ -33,6 +33,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -33,6 +33,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Samuel Giddins
](
https://github.com/segiddins
)
[
Samuel Giddins
](
https://github.com/segiddins
)
[
#3101
](
https://github.com/CocoaPods/CocoaPods/issues/3101
)
[
#3101
](
https://github.com/CocoaPods/CocoaPods/issues/3101
)
*
Do not create pod target if
`source_files`
only contains headers.
[
Boris Bügling
](
https://github.com/neonichu
)
[
#3106
](
https://github.com/CocoaPods/CocoaPods/issues/3106
)
## 0.37.0.beta.1
## 0.37.0.beta.1
...
...
lib/cocoapods/target/pod_target.rb
View file @
3395336a
...
@@ -52,7 +52,9 @@ module Pod
...
@@ -52,7 +52,9 @@ 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?
!
file_accessors
.
flat_map
(
&
:source_files
).
empty?
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
# @return [Array<Specification::Consumer>] the specification consumers for
...
...
spec/unit/target/pod_target_spec.rb
View file @
3395336a
...
@@ -63,6 +63,22 @@ module Pod
...
@@ -63,6 +63,22 @@ module Pod
end
.
message
end
.
message
message
.
should
.
match
/subspecs across different build configurations/
message
.
should
.
match
/subspecs across different build configurations/
end
end
it
'builds a pod target if there are actual source files'
do
fa
=
Sandbox
::
FileAccessor
.
new
(
nil
,
@pod_target
)
fa
.
stubs
(
:source_files
).
returns
([
Pathname
.
new
(
'foo.m'
)])
@pod_target
.
stubs
(
:file_accessors
).
returns
([
fa
])
@pod_target
.
should_build?
.
should
==
true
end
it
'does not build a pod target if there are only header files'
do
fa
=
Sandbox
::
FileAccessor
.
new
(
nil
,
@pod_target
)
fa
.
stubs
(
:source_files
).
returns
([
Pathname
.
new
(
'foo.h'
)])
@pod_target
.
stubs
(
:file_accessors
).
returns
([
fa
])
@pod_target
.
should_build?
.
should
==
false
end
end
end
describe
'Support files'
do
describe
'Support files'
do
...
...
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