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
d341177f
Commit
d341177f
authored
Apr 16, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Analyzer] Only warn when there is a minimum deployment target mismatch
parent
6a456add
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
13 deletions
+35
-13
CHANGELOG.md
CHANGELOG.md
+5
-0
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+21
-1
resolver.rb
lib/cocoapods/resolver.rb
+3
-6
analyzer_spec.rb
spec/unit/installer/analyzer_spec.rb
+6
-0
resolver_spec.rb
spec/unit/resolver_spec.rb
+0
-6
No files found.
CHANGELOG.md
View file @
d341177f
...
@@ -17,6 +17,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -17,6 +17,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
`pod repo list`
.
`pod repo list`
.
[
Kyle Fuller
](
https://github.com/kylef
)
[
Kyle Fuller
](
https://github.com/kylef
)
*
Only show a warning when there is a minimum deployment target mismatch
between target and spec, instead of throwing a hard error.
[
Samuel Giddins
](
https://github.com/segiddins
)
[
#1241
](
https://github.com/CocoaPods/CocoaPods/issues/1241
)
##### Bug Fixes
##### Bug Fixes
*
Do not pass code-sign arguments to xcodebuild when linting OS X targets.
*
Do not pass code-sign arguments to xcodebuild when linting OS X targets.
...
...
lib/cocoapods/installer/analyzer.rb
View file @
d341177f
...
@@ -55,7 +55,7 @@ module Pod
...
@@ -55,7 +55,7 @@ module Pod
store_existing_checkout_options
store_existing_checkout_options
fetch_external_sources
if
allow_fetches
fetch_external_sources
if
allow_fetches
@result
.
specs_by_target
=
resolve_dependencies
@result
.
specs_by_target
=
validate_platforms
(
resolve_dependencies
)
@result
.
specifications
=
generate_specifications
@result
.
specifications
=
generate_specifications
@result
.
targets
=
generate_targets
@result
.
targets
=
generate_targets
@result
.
sandbox_state
=
generate_sandbox_state
@result
.
sandbox_state
=
generate_sandbox_state
...
@@ -431,6 +431,26 @@ module Pod
...
@@ -431,6 +431,26 @@ module Pod
specs_by_target
specs_by_target
end
end
# Warns for any specification that is incompatible with its target.
#
# @param [Hash{TargetDefinition => Array<Spec>}] specs_by_target
# the specifications grouped by target.
#
# @return [Hash{TargetDefinition => Array<Spec>}] the specifications
# grouped by target.
#
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
)
}
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
(
' - '
)
}
."
end
end
end
end
# Returns the list of all the resolved the resolved specifications.
# Returns the list of all the resolved the resolved specifications.
#
#
# @return [Array<Specification>] the list of the specifications.
# @return [Array<Specification>] the list of the specifications.
...
...
lib/cocoapods/resolver.rb
View file @
d341177f
...
@@ -355,16 +355,13 @@ module Pod
...
@@ -355,16 +355,13 @@ module Pod
#
#
# @raise If the specification is not supported by the target.
# @raise If the specification is not supported by the target.
#
#
# @todo This step is not specific to the resolution process and should be
# performed later in the analysis.
#
# @return [void]
# @return [void]
#
#
def
validate_platform
(
spec
,
target
)
def
validate_platform
(
spec
,
target
)
unless
spec
.
available_platforms
.
any?
{
|
p
|
target
.
platform
.
supports?
(
p
)
}
unless
spec
.
available_platforms
.
any?
{
|
p
|
target
.
platform
.
to_sym
==
p
.
to_sym
}
raise
Informative
,
"The platform of the target `
#{
target
.
name
}
` "
\
raise
Informative
,
"The platform of the target `
#{
target
.
name
}
` "
\
"(
#{
target
.
platform
}
) is not compatible with `
#{
spec
}
`
which ha
s "
\
"(
#{
target
.
platform
}
) is not compatible with `
#{
spec
}
`
, which doe
s "
\
"
a minimum requirement of
#{
spec
.
available_platforms
.
join
(
' - '
)
}
."
"
not support `
#{
target
.
platform
.
name
}
`
."
end
end
end
end
...
...
spec/unit/installer/analyzer_spec.rb
View file @
d341177f
...
@@ -271,6 +271,12 @@ module Pod
...
@@ -271,6 +271,12 @@ module Pod
]
]
end
end
it
'warns once any of the dependencies does not match the platform of its podfile target'
do
Specification
.
any_instance
.
stubs
(
:available_platforms
).
returns
([
Platform
.
new
(
:ios
,
'999'
)])
@analyzer
.
analyze
UI
.
warnings
.
should
.
match
(
/platform .* may not be compatible/
)
end
xit
'removes the specifications of the changed pods to prevent confusion in the resolution process'
do
xit
'removes the specifications of the changed pods to prevent confusion in the resolution process'
do
@analyzer
.
allow_pre_downloads
=
true
@analyzer
.
allow_pre_downloads
=
true
podspec
=
@analyzer
.
sandbox
.
root
+
'Local Podspecs/JSONKit.podspec'
podspec
=
@analyzer
.
sandbox
.
root
+
'Local Podspecs/JSONKit.podspec'
...
...
spec/unit/resolver_spec.rb
View file @
d341177f
...
@@ -169,12 +169,6 @@ module Pod
...
@@ -169,12 +169,6 @@ module Pod
].
sort_by
(
&
:name
)
].
sort_by
(
&
:name
)
end
end
it
'raises once any of the dependencies does not match the platform of its podfile target'
do
Specification
.
any_instance
.
stubs
(
:available_platforms
).
returns
([
Platform
.
new
(
:ios
,
'999'
)])
e
=
lambda
{
@resolver
.
resolve
}.
should
.
raise
Informative
e
.
message
.
should
.
match
(
/platform .* not compatible/
)
end
it
'raises when a resolved dependency has a platform incompatibility'
do
it
'raises when a resolved dependency has a platform incompatibility'
do
@podfile
=
Podfile
.
new
do
@podfile
=
Podfile
.
new
do
platform
:osx
,
'10.7'
platform
:osx
,
'10.7'
...
...
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