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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
19 deletions
+36
-19
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
+25
-4
No files found.
lib/cocoapods/command/spec.rb
View file @
8553b9eb
...
...
@@ -535,14 +535,14 @@ Pod::Spec.new do |s|
# 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, '5.0'
# s.platform = :ios
# If this Pod runs on boths platforms, then specify the deployment
# targets.
#
# s.ios.deployment_target = '
>=
5.0'
# s.osx.deployment_target = '
>=
10.7'
# 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/specification.rb
View file @
8553b9eb
...
...
@@ -115,16 +115,14 @@ module Pod
end
def
platform
=
(
platform
)
if
platform
.
class
==
Array
name
=
platform
[
0
]
@deployment_target
[
name
]
=
Gem
::
Requirement
.
new
(
platform
[
1
])
else
name
=
platform
end
@platform
=
Platform
.
new
(
name
)
@platform
=
Platform
.
new
(
*
platform
)
end
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
)
self
.
compiler_flags
=
'-fobjc-arc'
if
requires_arc
@requires_arc
=
requires_arc
...
...
@@ -181,12 +179,10 @@ 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
def
deployment_target
=
(
version
)
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
[
@define_for_platforms
.
first
]
=
version
end
attr_reader
:deployment_target
def
resources
=
(
patterns
)
@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
@spec
.
platform
.
should
==
:ios
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
@spec
.
license
=
{
:type
=>
'MIT'
,
...
...
@@ -168,7 +181,7 @@ describe "A Pod::Specification, in general," do
:text
=>
'Permission is hereby granted ...'
}
end
it
"returns the license of the Pod specified in the old format"
do
@spec
.
license
=
'MIT'
@spec
.
license
.
should
==
{
...
...
@@ -183,7 +196,7 @@ describe "A Pod::Specification, in general," do
'--project-company'
,
'"Company Name"'
,
'--company-id'
,
'com.company'
,
'--ignore'
,
'Common'
,
'--ignore'
,
'.m'
]
'--ignore'
,
'.m'
]
}
@spec
.
documentation
[
:html
].
should
==
'http://EXAMPLE/#{@name}/documentation'
@spec
.
documentation
[
:appledoc
].
should
==
[
'--project-name'
,
'#{@name}'
,
...
...
@@ -288,11 +301,11 @@ describe "A Pod::Specification with :local source" do
s
.
source_files
=
"."
end
end
it
"is marked as local"
do
@spec
.
should
.
be
.
local
end
it
"it returns the expanded local path"
do
@spec
.
local_path
.
should
==
fixture
(
"integration/JSONKit"
)
end
...
...
@@ -364,6 +377,8 @@ describe "A Pod::Specification, concerning its attributes that support different
s
.
ios
.
dependency
'JSONKit'
s
.
osx
.
dependency
'SSZipArchive'
s
.
ios
.
deployment_target
=
'4.0'
end
end
...
...
@@ -382,6 +397,12 @@ describe "A Pod::Specification, concerning its attributes that support different
}
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
@spec
.
compiler_flags
.
should
==
{
: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