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
1731ca9c
Commit
1731ca9c
authored
Feb 12, 2017
by
Dimitris Koutsogiorgas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not crash when attempting to install pod with no supported targets
parent
8b02913f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
1 deletion
+26
-1
CHANGELOG.md
CHANGELOG.md
+4
-0
installer.rb
lib/cocoapods/installer.rb
+2
-0
target_inspector.rb
lib/cocoapods/installer/analyzer/target_inspector.rb
+6
-0
cocoapods-integration-specs
spec/cocoapods-integration-specs
+1
-1
target_inspector_spec.rb
spec/unit/installer/analyzer/target_inspector_spec.rb
+3
-0
installer_spec.rb
spec/unit/installer_spec.rb
+10
-0
No files found.
CHANGELOG.md
View file @
1731ca9c
...
...
@@ -14,6 +14,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
*
Do not crash when attempting to install pod with no supported targets.
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#6465
](
https://github.com/CocoaPods/CocoaPods/issues/6465
)
*
Correctly handle
`OTHER_LDFLAGS`
for targets with inherit search paths and source pods.
[
Justin Martin
](
https://github.com/justinseanmartin
)
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
...
...
lib/cocoapods/installer.rb
View file @
1731ca9c
...
...
@@ -338,6 +338,8 @@ module Pod
end
end
raise
Informative
,
"Could not install '
#{
pod_name
}
' pod. There is no target that supports it."
if
specs_by_platform
.
empty?
@pod_installers
||=
[]
pod_installer
=
PodSourceInstaller
.
new
(
sandbox
,
specs_by_platform
,
:can_cache
=>
installation_options
.
clean?
)
@pod_installers
<<
pod_installer
...
...
lib/cocoapods/installer/analyzer/target_inspector.rb
View file @
1731ca9c
...
...
@@ -4,6 +4,8 @@ module Pod
class
Installer
class
Analyzer
class
TargetInspector
PLATFORM_INFO_URL
=
'https://guides.cocoapods.org/syntax/podfile.html#platform'
.
freeze
# @return [TargetDefinition] the target definition to inspect
#
attr_accessor
:target_definition
...
...
@@ -159,6 +161,10 @@ module Pod
"Unable to determine the platform for the `
#{
target_definition
.
name
}
` target."
end
UI
.
warn
"Automatically assigning platform
#{
name
}
with version
#{
deployment_target
}
"
\
"on target
#{
target_definition
.
name
}
because no platform was specified. "
\
"Please specify a platform for this target in your Podfile. See `
#{
PLATFORM_INFO_URL
}
`."
target_definition
.
set_platform
(
name
,
deployment_target
)
Platform
.
new
(
name
,
deployment_target
)
end
...
...
cocoapods-integration-specs
@
29e64c27
Subproject commit
e62f3157268e9d2fe634dfab2560c89013d89240
Subproject commit
29e64c27eff470779877e8ffc24fdaf707f261a8
spec/unit/installer/analyzer/target_inspector_spec.rb
View file @
1731ca9c
...
...
@@ -232,6 +232,9 @@ module Pod
target_inspector
=
TargetInspector
.
new
(
target_definition
,
config
.
installation_root
)
platforms
=
target_inspector
.
send
(
:compute_platform
,
user_targets
)
platforms
.
should
==
Platform
.
new
(
:ios
,
'4.0'
)
UI
.
warnings
.
should
.
include
'Automatically assigning platform ios with version 4.0 on target default because no '
\
'platform was specified. Please specify a platform for this target in your Podfile. '
\
'See `https://guides.cocoapods.org/syntax/podfile.html#platform`.'
end
it
'uses the lowest deployment target of the user targets if inferring the platform'
do
...
...
spec/unit/installer_spec.rb
View file @
1731ca9c
...
...
@@ -540,6 +540,16 @@ module Pod
UI
.
output
.
should
.
include
'was 1.0'
end
it
'raises when it attempts to install pod source with no target supporting it'
do
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
pod_target
=
PodTarget
.
new
([
spec
],
[
fixture_target_definition
],
config
.
sandbox
)
pod_target
.
stubs
(
:platform
).
returns
(
:ios
)
@installer
.
stubs
(
:pod_targets
).
returns
([
pod_target
])
should
.
raise
Informative
do
@installer
.
send
(
:create_pod_installer
,
'RandomPod'
)
end
.
message
.
should
.
include
'Could not install \'RandomPod\' pod. There is no target that supports it.'
end
#--------------------------------------#
describe
'#clean'
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