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
b983e3a3
Commit
b983e3a3
authored
Feb 10, 2012
by
Luke Redpath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If a platform has a deployment target set, use that to determine if we should use legacy
ARCHs on iOS or not.
parent
c6377023
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
0 deletions
+40
-0
platform.rb
lib/cocoapods/platform.rb
+11
-0
xcodeproj_ext.rb
lib/cocoapods/xcodeproj_ext.rb
+3
-0
xcodeproj_ext_spec.rb
spec/unit/xcodeproj_ext_spec.rb
+26
-0
No files found.
lib/cocoapods/platform.rb
View file @
b983e3a3
...
...
@@ -30,5 +30,16 @@ module Pod
def
nil?
name
.
nil?
end
def
deployment_target
if
(
opt
=
options
[
:deployment_target
])
Pod
::
Version
.
new
(
opt
)
end
end
def
requires_legacy_ios_archs?
return
unless
deployment_target
(
name
==
:ios
)
&&
(
deployment_target
<
Pod
::
Version
.
new
(
"4.3"
))
end
end
end
lib/cocoapods/xcodeproj_ext.rb
View file @
b983e3a3
...
...
@@ -108,6 +108,9 @@ module Xcodeproj
def
self
.
build_settings
(
platform
,
scheme
)
settings
=
COMMON_BUILD_SETTINGS
[
:all
].
merge
(
COMMON_BUILD_SETTINGS
[
platform
.
name
])
settings
[
'COPY_PHASE_STRIP'
]
=
scheme
==
:debug
?
'NO'
:
'YES'
if
platform
.
requires_legacy_ios_archs?
settings
[
'ARCHS'
]
=
"armv6 armv7"
end
if
scheme
==
:debug
settings
.
merge!
(
COMMON_BUILD_SETTINGS
[
:debug
])
settings
[
'ONLY_ACTIVE_ARCH'
]
=
'YES'
if
platform
==
:osx
...
...
spec/unit/xcodeproj_ext_spec.rb
View file @
b983e3a3
...
...
@@ -51,4 +51,30 @@ describe 'Xcodeproj::Project' do
@project
.
build_configuration
(
"Release"
).
buildSettings
[
"VALIDATE_PRODUCT"
].
should
==
"YES"
end
end
describe
"for the :ios platform with a deployment target"
do
it
"sets ARCHS to 'armv6 armv7' for both configurations if the deployment target is less than 4.3"
do
@project
=
Xcodeproj
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.0"
))
@project
.
build_configuration
(
"Debug"
).
buildSettings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
.
build_configuration
(
"Release"
).
buildSettings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
=
Xcodeproj
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.1"
))
@project
.
build_configuration
(
"Debug"
).
buildSettings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
.
build_configuration
(
"Release"
).
buildSettings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
=
Xcodeproj
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.2"
))
@project
.
build_configuration
(
"Debug"
).
buildSettings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
.
build_configuration
(
"Release"
).
buildSettings
[
"ARCHS"
].
should
==
"armv6 armv7"
end
it
"uses standard ARCHs if deployment target is 4.3 or above"
do
@project
=
Xcodeproj
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.3"
))
@project
.
build_configuration
(
"Debug"
).
buildSettings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
@project
.
build_configuration
(
"Release"
).
buildSettings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
@project
=
Xcodeproj
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.4"
))
@project
.
build_configuration
(
"Debug"
).
buildSettings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
@project
.
build_configuration
(
"Release"
).
buildSettings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
end
end
end
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