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
86be3d31
Commit
86be3d31
authored
Apr 30, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[#212] Check for deployment target
parent
03138241
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
15 deletions
+26
-15
spec.rb
lib/cocoapods/command/spec.rb
+9
-8
resolver.rb
lib/cocoapods/resolver.rb
+6
-3
specification.rb
lib/cocoapods/specification.rb
+11
-4
No files found.
lib/cocoapods/command/spec.rb
View file @
86be3d31
...
...
@@ -491,16 +491,17 @@ Pod::Spec.new do |s|
s.description = 'An optional longer description of
#{
data
[
:name
]
}
.'
# If this Pod runs only on iOS or OS X, then specify that with one of
# these, or none if it runs on both platforms.
# If the pod runs on both plafroms but presents different deployment
# targets, source files, etc. create two different pods: `
#{
data
[
:name
]
}
-iOS'
# and `
#{
data
[
:name
]
}
-OSX'.
# If this Pod runs only on iOS or OS X, then specify the platfrom and
# the deployment target.
#
# s.platform = :ios, '>= 5.0'
# s.platform = :ios
# s.platform = :ios, { :deployment_target => "5.0" }
# s.platform = :osx
# s.platform = :osx, { :deployment_target => "10.7" }
# If this Pod runs on boths platforms, then specify the deployment
# targets.
#
# s.ios.deployment_target = '>= 5.0'
# s.osx.deployment_target = '>= 10.7'
# A list of resources included with the Pod. These are copied into the
# target bundle with a build phase script.
...
...
lib/cocoapods/resolver.rb
View file @
86be3d31
...
...
@@ -86,9 +86,12 @@ module Pod
end
def
validate_platform!
(
spec
)
plaform
=
@podfile
.
target_definitions
[
:default
].
platform
unless
plaform
.
support?
(
spec
.
platform
)
raise
Informative
,
"The platform required by the Podfile `
#{
plaform
}
' does not match that of
#{
spec
}
`
#{
spec
.
platform
}
'"
platform
=
@podfile
.
target_definitions
[
:default
].
platform
unless
platform
.
support?
(
spec
.
platform
)
raise
Informative
,
"The platform required by the Podfile `
#{
platform
}
' does not match that of
#{
spec
}
`
#{
spec
.
platform
}
'"
end
unless
!
platform
.
deployment_target
||
!
spec
.
deployment_target
[
platform
.
name
]
||
spec
.
deployment_target
[
platform
.
name
].
satisfied_by?
(
platform
.
deployment_target
)
raise
Informative
,
"The platform required by the Podfile `
#{
platform
}
' does not match that of
#{
spec
}
`
#{
spec
.
platform
}
#{
spec
.
deployment_target
[
platform
.
name
]
}
'"
.
magenta
end
end
end
...
...
lib/cocoapods/specification.rb
View file @
86be3d31
...
...
@@ -34,6 +34,7 @@ module Pod
@define_for_platforms
=
[
:osx
,
:ios
]
@clean_paths
,
@subspecs
=
[],
[]
@dependencies
,
@source_files
,
@resources
=
{
:ios
=>
[],
:osx
=>
[]
},
{
:ios
=>
[],
:osx
=>
[]
},
{
:ios
=>
[],
:osx
=>
[]
}
@deployment_target
=
{}
@platform
=
Platform
.
new
(
nil
)
@xcconfig
=
{
:ios
=>
Xcodeproj
::
Config
.
new
,
:osx
=>
Xcodeproj
::
Config
.
new
}
@compiler_flags
=
{
:ios
=>
''
,
:osx
=>
''
}
...
...
@@ -116,12 +117,11 @@ module Pod
def
platform
=
(
platform
)
if
platform
.
class
==
Array
name
=
platform
[
0
]
options
=
platform
[
1
]
@deployment_target
[
name
]
=
Gem
::
Requirement
.
new
(
platform
[
1
])
else
name
=
platform
options
=
nil
end
@platform
=
Platform
.
new
(
name
,
options
)
@platform
=
Platform
.
new
(
name
)
end
attr_reader
:platform
...
...
@@ -157,7 +157,7 @@ module Pod
@specification
,
@platform
=
specification
,
platform
end
%w{ source_files= resource= resources= xcconfig= framework= frameworks= library= libraries= compiler_flags= dependency }
.
each
do
|
method
|
%w{ source_files= resource= resources= xcconfig= framework= frameworks= library= libraries= compiler_flags= dep
loyment_target= dep
endency }
.
each
do
|
method
|
define_method
(
method
)
do
|
args
|
@specification
.
_on_platform
(
@platform
)
do
@specification
.
send
(
method
,
args
)
...
...
@@ -181,6 +181,13 @@ module Pod
end
attr_reader
:source_files
def
deployment_target
=
(
requirement
)
@define_for_platforms
.
each
do
|
platform
|
@deployment_target
[
platform
]
=
Gem
::
Requirement
.
new
(
requirement
)
end
end
attr_reader
:deployment_target
def
resources
=
(
patterns
)
@define_for_platforms
.
each
do
|
platform
|
@resources
[
platform
]
=
pattern_list
(
patterns
)
...
...
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