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
d6523d56
Unverified
Commit
d6523d56
authored
Sep 14, 2016
by
Ben Asher
Committed by
Danielle Tomlinson
Oct 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Raise Informative if targets share a pod and have different swift versions
parent
a5a409a8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+32
-0
No files found.
lib/cocoapods/installer/analyzer.rb
View file @
d6523d56
...
...
@@ -349,6 +349,7 @@ module Pod
#
def
generate_targets
specs_by_target
=
result
.
specs_by_target
.
reject
{
|
td
,
_
|
td
.
abstract?
}
check_pod_target_swift_versions
(
specs_by_target
)
pod_targets
=
generate_pod_targets
(
specs_by_target
)
aggregate_targets
=
specs_by_target
.
keys
.
map
do
|
target_definition
|
generate_target
(
target_definition
,
pod_targets
)
...
...
@@ -406,6 +407,37 @@ module Pod
target
end
# Verify that targets using a pod have the same swift version
#
# @param [Hash{Podfile::TargetDefinition => Array<Specification>}] specs_by_target
# the resolved specifications grouped by target.
#
# @note raises Informative if targets using a pod do not have
# the same swift version
#
def
check_pod_target_swift_versions
(
specs_by_target
)
targets_by_spec
=
{}
specs_by_target
.
each
do
|
target
,
specs
|
specs
.
each
do
|
spec
|
(
targets_by_spec
[
spec
]
||=
[])
<<
target
end
end
target_msg
=
lambda
do
|
target
|
if
target
.
swift_version
.
nil?
"
#{
target
.
name
}
(Swift version missing)"
else
"
#{
target
.
name
}
(Swift
#{
target
.
swift_version
}
)"
end
end
error_messages
=
[]
targets_by_spec
.
each
do
|
spec
,
targets
|
error_messages
<<
"
#{
spec
.
name
}
required by
#{
targets
.
map
(
&
target_msg
).
join
(
', '
)
}
"
unless
targets
.
uniq
(
&
:swift_version
).
count
==
1
end
raise
Informative
,
"The following pods are integrated into targets that do not have the same Swift version:
\n\n
#{
error_messages
.
join
(
"
\n
"
)
}
"
end
# Setup the pod targets for an aggregate target. Deduplicates resulting
# targets by grouping by platform and subspec by their root
# to create a {PodTarget} for each spec.
...
...
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