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
8553b9eb
Commit
8553b9eb
authored
May 03, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Specification#deployment_target=] Switch to Pod::Version
parent
b86625e6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
15 deletions
+32
-15
spec.rb
lib/cocoapods/command/spec.rb
+3
-3
specification.rb
lib/cocoapods/specification.rb
+8
-12
specification_spec.rb
spec/unit/specification_spec.rb
+21
-0
No files found.
lib/cocoapods/command/spec.rb
View file @
8553b9eb
...
@@ -535,14 +535,14 @@ Pod::Spec.new do |s|
...
@@ -535,14 +535,14 @@ Pod::Spec.new do |s|
# If this Pod runs only on iOS or OS X, then specify the platfrom and
# If this Pod runs only on iOS or OS X, then specify the platfrom and
# the deployment target.
# the deployment target.
#
#
# s.platform = :ios, '
>=
5.0'
# s.platform = :ios, '5.0'
# s.platform = :ios
# s.platform = :ios
# If this Pod runs on boths platforms, then specify the deployment
# If this Pod runs on boths platforms, then specify the deployment
# targets.
# targets.
#
#
# s.ios.deployment_target = '
>=
5.0'
# s.ios.deployment_target = '5.0'
# s.osx.deployment_target = '
>=
10.7'
# s.osx.deployment_target = '10.7'
# A list of resources included with the Pod. These are copied into the
# A list of resources included with the Pod. These are copied into the
# target bundle with a build phase script.
# target bundle with a build phase script.
...
...
lib/cocoapods/specification.rb
View file @
8553b9eb
...
@@ -115,16 +115,14 @@ module Pod
...
@@ -115,16 +115,14 @@ module Pod
end
end
def
platform
=
(
platform
)
def
platform
=
(
platform
)
if
platform
.
class
==
Array
@platform
=
Platform
.
new
(
*
platform
)
name
=
platform
[
0
]
@deployment_target
[
name
]
=
Gem
::
Requirement
.
new
(
platform
[
1
])
else
name
=
platform
end
@platform
=
Platform
.
new
(
name
)
end
end
attr_reader
:platform
attr_reader
:platform
def
platforms
@platform
.
nil?
?
@define_for_platforms
.
map
{
|
platfrom
|
Platform
.
new
(
platfrom
,
@deployment_target
[
platfrom
])
}
:
[
platform
]
end
def
requires_arc
=
(
requires_arc
)
def
requires_arc
=
(
requires_arc
)
self
.
compiler_flags
=
'-fobjc-arc'
if
requires_arc
self
.
compiler_flags
=
'-fobjc-arc'
if
requires_arc
@requires_arc
=
requires_arc
@requires_arc
=
requires_arc
...
@@ -181,12 +179,10 @@ module Pod
...
@@ -181,12 +179,10 @@ module Pod
end
end
attr_reader
:source_files
attr_reader
:source_files
def
deployment_target
=
(
requirement
)
def
deployment_target
=
(
version
)
@define_for_platforms
.
each
do
|
platform
|
raise
Informative
,
"The deployment target must be defined per platform like s.ios.deployment_target = '5.0'"
unless
@define_for_platforms
.
count
==
1
@deployment_target
[
platform
]
=
Gem
::
Requirement
.
new
(
requirement
)
@deployment_target
[
@define_for_platforms
.
first
]
=
version
end
end
end
attr_reader
:deployment_target
def
resources
=
(
patterns
)
def
resources
=
(
patterns
)
@define_for_platforms
.
each
do
|
platform
|
@define_for_platforms
.
each
do
|
platform
|
...
...
spec/unit/specification_spec.rb
View file @
8553b9eb
...
@@ -154,6 +154,19 @@ describe "A Pod::Specification, in general," do
...
@@ -154,6 +154,19 @@ describe "A Pod::Specification, in general," do
@spec
.
platform
.
should
==
:ios
@spec
.
platform
.
should
==
:ios
end
end
it
"returns the platform and the deployment target"
do
@spec
.
platform
=
:ios
,
'4.0'
@spec
.
platform
.
should
==
:ios
@spec
.
platform
.
deployment_target
.
should
==
Pod
::
Version
.
new
(
'4.0'
)
end
it
"returns the platfroms for which the pod is supported"
do
@spec
.
platform
=
:ios
,
'4.0'
@spec
.
platforms
.
count
.
should
==
1
@spec
.
platforms
.
first
.
should
==
:ios
@spec
.
platforms
.
first
.
deployment_target
.
should
==
Pod
::
Version
.
new
(
'4.0'
)
end
it
"returns the license of the Pod"
do
it
"returns the license of the Pod"
do
@spec
.
license
=
{
@spec
.
license
=
{
:type
=>
'MIT'
,
:type
=>
'MIT'
,
...
@@ -364,6 +377,8 @@ describe "A Pod::Specification, concerning its attributes that support different
...
@@ -364,6 +377,8 @@ describe "A Pod::Specification, concerning its attributes that support different
s
.
ios
.
dependency
'JSONKit'
s
.
ios
.
dependency
'JSONKit'
s
.
osx
.
dependency
'SSZipArchive'
s
.
osx
.
dependency
'SSZipArchive'
s
.
ios
.
deployment_target
=
'4.0'
end
end
end
end
...
@@ -382,6 +397,12 @@ describe "A Pod::Specification, concerning its attributes that support different
...
@@ -382,6 +397,12 @@ describe "A Pod::Specification, concerning its attributes that support different
}
}
end
end
it
"returns the list of the supported platfroms and deployment targets"
do
@spec
.
platforms
.
count
.
should
==
2
@spec
.
platforms
.
should
.
include?
Pod
::
Platform
.
new
(
:osx
)
@spec
.
platforms
.
should
.
include?
Pod
::
Platform
.
new
(
:ios
,
'4.0'
)
end
it
"returns the same list of compiler flags for each platform"
do
it
"returns the same list of compiler flags for each platform"
do
@spec
.
compiler_flags
.
should
==
{
@spec
.
compiler_flags
.
should
==
{
:ios
=>
' -Wdeprecated-implementations -fobjc-arc'
,
:ios
=>
' -Wdeprecated-implementations -fobjc-arc'
,
...
...
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