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
2e6a300f
Unverified
Commit
2e6a300f
authored
May 02, 2016
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Resolver] Handle when an abstract target has no platform
parent
5c2ef75f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
4 deletions
+33
-4
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+2
-1
resolver.rb
lib/cocoapods/resolver.rb
+4
-3
analyzer_spec.rb
spec/unit/installer/analyzer_spec.rb
+27
-0
No files found.
lib/cocoapods/installer/analyzer.rb
View file @
2e6a300f
...
...
@@ -577,7 +577,8 @@ module Pod
def
validate_platforms
(
specs_by_target
)
specs_by_target
.
each
do
|
target
,
specs
|
specs
.
each
do
|
spec
|
unless
spec
.
available_platforms
.
any?
{
|
p
|
target
.
platform
.
supports?
(
p
)
}
next
unless
target_platform
=
target
.
platform
unless
spec
.
available_platforms
.
any?
{
|
p
|
target_platform
.
supports?
(
p
)
}
UI
.
warn
"The platform of the target `
#{
target
.
name
}
` "
\
"(
#{
target
.
platform
}
) may not be compatible with `
#{
spec
}
` which has "
\
"a minimum requirement of
#{
spec
.
available_platforms
.
join
(
' - '
)
}
."
...
...
lib/cocoapods/resolver.rb
View file @
2e6a300f
...
...
@@ -56,7 +56,7 @@ module Pod
def
resolve
dependencies
=
podfile
.
target_definition_list
.
flat_map
do
|
target
|
target
.
dependencies
.
each
do
|
dep
|
@platforms_by_dependency
[
dep
].
push
(
target
.
platform
).
uniq!
@platforms_by_dependency
[
dep
].
push
(
target
.
platform
).
uniq!
if
target
.
platform
end
end
@activated
=
Molinillo
::
Resolver
.
new
(
self
,
self
).
resolve
(
dependencies
,
locked_dependencies
)
...
...
@@ -363,7 +363,8 @@ module Pod
# @return [void]
#
def
validate_platform
(
spec
,
target
)
unless
spec
.
available_platforms
.
any?
{
|
p
|
target
.
platform
.
to_sym
==
p
.
to_sym
}
return
unless
target_platform
=
target
.
platform
unless
spec
.
available_platforms
.
any?
{
|
p
|
target_platform
.
to_sym
==
p
.
to_sym
}
raise
Informative
,
"The platform of the target `
#{
target
.
name
}
` "
\
"(
#{
target
.
platform
}
) is not compatible with `
#{
spec
}
`, which does "
\
"not support `
#{
target
.
platform
.
name
}
`."
...
...
@@ -418,7 +419,7 @@ module Pod
end
message
<<
"
\n
You should explicitly specify the version in order to install a pre-release version"
elsif
!
conflict
.
existing
conflict
.
requirements
.
values
.
flatten
.
each
do
|
r
|
conflict
.
requirements
.
values
.
flatten
.
uniq
.
each
do
|
r
|
if
search_for
(
r
).
empty?
# There are no existing specification inside any of the spec repos with given requirements.
message
<<
"
\n\n
None of your spec sources contain a spec satisfying the dependency: `
#{
r
}
`."
\
...
...
spec/unit/installer/analyzer_spec.rb
View file @
2e6a300f
...
...
@@ -163,6 +163,33 @@ module Pod
target
.
platform
.
to_s
.
should
==
'iOS 6.0'
end
describe
'abstract targets'
do
it
'resolves'
do
@podfile
=
Pod
::
Podfile
.
new
do
project
'SampleProject/SampleProject'
use_frameworks!
abstract_target
'Alpha'
do
pod
'libextobjc'
target
'SampleProject'
do
pod
'libextobjc/RuntimeExtensions'
end
target
'TestRunner'
do
end
end
end
@analyzer
=
Pod
::
Installer
::
Analyzer
.
new
(
config
.
sandbox
,
@podfile
,
nil
)
result
=
@analyzer
.
analyze
sample_project_target
,
test_runner_target
=
result
.
targets
.
sort_by
(
&
:name
)
sample_project_target
.
pod_targets
.
map
(
&
:name
).
should
==
%w(libextobjc)
test_runner_target
.
pod_targets
.
map
(
&
:name
).
should
.
be
.
empty
sample_project_target
.
user_targets
.
map
(
&
:name
).
should
==
%w(SampleProject)
test_runner_target
.
user_targets
.
map
(
&
:name
).
should
==
%w(TestRunner)
end
end
describe
'dependent pod targets'
do
it
'picks transitive dependencies up'
do
@podfile
=
Pod
::
Podfile
.
new
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