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
0ba1910e
Commit
0ba1910e
authored
Jun 10, 2016
by
Ben Asher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
validate uniq symbol_type count instead of user_target count
parent
cc804e3f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+4
-2
aggregate_target.rb
lib/cocoapods/target/aggregate_target.rb
+3
-2
aggregate_target_spec.rb
spec/unit/target/aggregate_target_spec.rb
+5
-3
No files found.
lib/cocoapods/installer/analyzer.rb
View file @
0ba1910e
...
...
@@ -238,8 +238,10 @@ module Pod
#
def
copy_extension_pod_targets_to_host
(
aggregate_target
,
extension_aggregate_targets
)
return
if
aggregate_target
.
requires_host_target?
# Get the uuids of the aggregate_target's user_target's extension targets if any
extension_uuids
=
aggregate_target
.
user_project
.
extensions_for_native_target
(
aggregate_target
.
user_targets
[
0
]).
map
(
&
:uuid
)
# Get the uuids of the aggregate_target's user_targets' extension targets if any
extension_uuids
=
aggregate_target
.
user_targets
.
map
do
|
target
|
aggregate_target
.
user_project
.
extensions_for_native_target
(
target
).
map
(
&
:uuid
)
end
.
flatten
return
if
extension_uuids
.
empty?
extension_aggregate_targets
.
each
do
|
extension_target
|
next
unless
extension_uuids
.
include?
extension_target
.
user_targets
[
0
].
uuid
...
...
lib/cocoapods/target/aggregate_target.rb
View file @
0ba1910e
...
...
@@ -37,8 +37,9 @@ module Pod
# for sure that this target refers to an extension
# target that would require a host target
return
false
if
user_project
.
nil?
raise
ArgumentError
,
"Expected single user_target for
#{
name
}
"
unless
user_targets
.
count
==
1
EMBED_FRAMEWORKS_IN_HOST_TARGET_TYPES
.
include?
user_targets
[
0
].
symbol_type
symbol_types
=
user_targets
.
map
(
&
:symbol_type
).
uniq
raise
ArgumentError
,
"Expected single kind of user_target for
#{
name
}
. Found
#{
symbol_types
.
join
(
', '
)
}
."
unless
symbol_types
.
count
==
1
EMBED_FRAMEWORKS_IN_HOST_TARGET_TYPES
.
include?
symbol_types
[
0
]
end
# @return [String] the label for the target.
...
...
spec/unit/target/aggregate_target_spec.rb
View file @
0ba1910e
...
...
@@ -230,11 +230,13 @@ module Pod
@target
.
requires_host_target?
.
should
==
false
end
it
'raises an exception if more than one user_target is found'
do
@target
.
user_target_uuids
+=
@target
.
user_target_uuids
it
'raises an exception if more than one kind of user_target is found'
do
@target
.
user_target_uuids
<<
'51075D491521D0C100E39B41'
@target
.
user_targets
.
first
.
stubs
(
:symbol_type
).
returns
(
:app_extension
)
@target
.
user_targets
.
last
.
stubs
(
:symbol_type
).
returns
(
:watch_extension
)
should
.
raise
ArgumentError
do
@target
.
requires_host_target?
end
.
message
.
should
.
equal
'Expected single
user_target for Pods
'
end
.
message
.
should
.
equal
'Expected single
kind of user_target for Pods. Found app_extension, watch_extension.
'
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