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
da54718d
Commit
da54718d
authored
Aug 12, 2014
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PodTarget] Ensure that subspecs are on the same configurations
parent
78700472
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
1 deletion
+47
-1
pod_target.rb
lib/cocoapods/target/pod_target.rb
+26
-1
pod_target_spec.rb
spec/unit/target/pod_target_spec.rb
+21
-0
No files found.
lib/cocoapods/target/pod_target.rb
View file @
da54718d
...
@@ -71,8 +71,33 @@ module Pod
...
@@ -71,8 +71,33 @@ module Pod
# The name of the build configuration.
# The name of the build configuration.
#
#
def
include_in_build_config?
(
configuration_name
)
def
include_in_build_config?
(
configuration_name
)
@target_definition
.
pod_whitelisted_for_configuration?
(
pod_name
,
configuration_name
)
whitelists
=
target_definition_dependencies
.
map
do
|
dependency
|
target_definition
.
pod_whitelisted_for_configuration?
(
dependency
.
name
,
configuration_name
)
end
.
uniq
if
whitelists
.
empty?
return
true
elsif
whitelists
.
count
==
1
whitelists
.
first
else
raise
Informative
,
"The subspecs of `
#{
pod_name
}
` are linked to "
\
"different build configurations for the `
#{
target_definition
}
` "
\
"target. CocoaPods does not support subspecs across different "
\
"build configurations."
end
end
end
private
# @return [Array<Dependency>] The dependency of the target definition for
# this Pod. Return an empty array if the Pod is not a direct
# dependency of the target definition but the dependency of one or
# more Pods.
#
def
target_definition_dependencies
target_definition
.
dependencies
.
select
do
|
dependency
|
Specification
.
root_name
(
dependency
.
name
)
==
pod_name
end
end
end
end
end
end
spec/unit/target/pod_target_spec.rb
View file @
da54718d
...
@@ -37,6 +37,27 @@ module Pod
...
@@ -37,6 +37,27 @@ module Pod
it
"returns the name of the Pods on which this target depends"
do
it
"returns the name of the Pods on which this target depends"
do
@pod_target
.
dependencies
.
should
==
[
"monkey"
]
@pod_target
.
dependencies
.
should
==
[
"monkey"
]
end
end
it
"returns whether it is whitelisted in a build configuration"
do
@target_definition
.
store_pod
(
'BananaLib'
)
@target_definition
.
whitelist_pod_for_configuration
(
'BananaLib'
,
'debug'
)
@pod_target
.
include_in_build_config?
(
'Debug'
).
should
.
be
.
true
@pod_target
.
include_in_build_config?
(
'Release'
).
should
.
be
.
false
end
it
"is whitelisted on all build configurations of it is a dependency of other Pods"
do
@pod_target
.
include_in_build_config?
(
'Debug'
).
should
.
be
.
true
@pod_target
.
include_in_build_config?
(
'Release'
).
should
.
be
.
true
end
it
"raises if a Pod is whitelisted for different build configurations"
do
@target_definition
.
store_pod
(
'BananaLib'
)
@target_definition
.
store_pod
(
'BananaLib/Subspec'
)
@target_definition
.
whitelist_pod_for_configuration
(
'BananaLib'
,
'debug'
)
should
.
raise
Informative
do
@pod_target
.
include_in_build_config?
(
'release'
).
should
.
be
.
true
end
.
message
.
should
.
match
/subspecs across different build configurations/
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