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
5a83b0ee
Commit
5a83b0ee
authored
Dec 03, 2013
by
Carson McDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle ARCHS coming back as an Array or String
parent
9b51eb14
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
1 deletion
+68
-1
CHANGELOG.md
CHANGELOG.md
+4
-0
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+2
-1
analyzer_spec.rb
spec/unit/installer/analyzer_spec.rb
+62
-0
No files found.
CHANGELOG.md
View file @
5a83b0ee
...
@@ -66,6 +66,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
...
@@ -66,6 +66,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[
Joshua Kalpin
](
https://github.com/Kapin
)
[
Joshua Kalpin
](
https://github.com/Kapin
)
[
Core#44
](
https://github.com/CocoaPods/Core/issues/44
)
[
Core#44
](
https://github.com/CocoaPods/Core/issues/44
)
*
The ARCHS build setting can come back as an array when more than one
architecture is specified.
[
Carson McDonald
](
https://github.com/carsonmcdonald
)
[
#1628
](
https://github.com/CocoaPods/CocoaPods/issues/1628
)
## 0.28.0
## 0.28.0
[
CocoaPods
](
https://github.com/CocoaPods/CocoaPods/compare/0.27.1...0.28.0
)
[
CocoaPods
](
https://github.com/CocoaPods/CocoaPods/compare/0.27.1...0.28.0
)
...
...
lib/cocoapods/installer/analyzer.rb
View file @
5a83b0ee
...
@@ -461,7 +461,8 @@ module Pod
...
@@ -461,7 +461,8 @@ module Pod
def
compute_archs_for_target_definition
(
target_definition
,
user_targets
)
def
compute_archs_for_target_definition
(
target_definition
,
user_targets
)
archs
=
[]
archs
=
[]
user_targets
.
each
do
|
target
|
user_targets
.
each
do
|
target
|
archs
<<
target
.
common_resolved_build_setting
(
'ARCHS'
)
target_archs
=
target
.
common_resolved_build_setting
(
'ARCHS'
)
archs
.
concat
(
Array
(
target_archs
))
end
end
archs
=
archs
.
compact
.
uniq
.
sort
archs
=
archs
.
compact
.
uniq
.
sort
...
...
spec/unit/installer/analyzer_spec.rb
View file @
5a83b0ee
...
@@ -331,6 +331,68 @@ module Pod
...
@@ -331,6 +331,68 @@ module Pod
#--------------------------------------#
#--------------------------------------#
describe
"#compute_archs_for_target_definition"
do
it
"handles a single ARCH defined in a single user target"
do
user_project
=
Xcodeproj
::
Project
.
new
(
'path'
)
target
=
user_project
.
new_target
(
:application
,
'Target'
,
:ios
)
target
.
build_configuration_list
.
set_setting
(
'ARCHS'
,
'armv7'
)
target_definition
=
Podfile
::
TargetDefinition
.
new
(
:default
,
nil
)
target_definition
.
set_platform
(
:ios
,
'4.0'
)
user_targets
=
[
target
]
archs
=
@analyzer
.
send
(
:compute_archs_for_target_definition
,
target_definition
,
user_targets
)
archs
.
should
==
'armv7'
end
it
"handles a single ARCH defined in multiple user targets"
do
user_project
=
Xcodeproj
::
Project
.
new
(
'path'
)
targeta
=
user_project
.
new_target
(
:application
,
'Target'
,
:ios
)
targeta
.
build_configuration_list
.
set_setting
(
'ARCHS'
,
'armv7'
)
targetb
=
user_project
.
new_target
(
:application
,
'Target'
,
:ios
)
targetb
.
build_configuration_list
.
set_setting
(
'ARCHS'
,
'armv7'
)
target_definition
=
Podfile
::
TargetDefinition
.
new
(
:default
,
nil
)
target_definition
.
set_platform
(
:ios
,
'4.0'
)
user_targets
=
[
targeta
,
targetb
]
archs
=
@analyzer
.
send
(
:compute_archs_for_target_definition
,
target_definition
,
user_targets
)
archs
.
should
==
'armv7'
end
it
"handles an Array of ARCHs defined in a single user target"
do
user_project
=
Xcodeproj
::
Project
.
new
(
'path'
)
target
=
user_project
.
new_target
(
:application
,
'Target'
,
:ios
)
target
.
build_configuration_list
.
set_setting
(
'ARCHS'
,
'armv7'
)
target_definition
=
Podfile
::
TargetDefinition
.
new
(
:default
,
nil
)
target_definition
.
set_platform
(
:ios
,
'4.0'
)
user_targets
=
[
target
]
archs
=
@analyzer
.
send
(
:compute_archs_for_target_definition
,
target_definition
,
user_targets
)
archs
.
should
==
'armv7'
end
it
"handles an Array of ARCHs defined multiple user targets"
do
user_project
=
Xcodeproj
::
Project
.
new
(
'path'
)
targeta
=
user_project
.
new_target
(
:application
,
'Target'
,
:ios
)
targeta
.
build_configuration_list
.
set_setting
(
'ARCHS'
,
'armv7'
)
targetb
=
user_project
.
new_target
(
:application
,
'Target'
,
:ios
)
targetb
.
build_configuration_list
.
set_setting
(
'ARCHS'
,
[
'armv7'
,
'i386'
])
target_definition
=
Podfile
::
TargetDefinition
.
new
(
:default
,
nil
)
target_definition
.
set_platform
(
:ios
,
'4.0'
)
user_targets
=
[
targeta
,
targetb
]
archs
=
@analyzer
.
send
(
:compute_archs_for_target_definition
,
target_definition
,
user_targets
)
archs
.
should
==
'armv7'
end
end
#--------------------------------------#
describe
"#compute_platform_for_target_definition"
do
describe
"#compute_platform_for_target_definition"
do
it
"returns the platform specified in the target definition"
do
it
"returns the platform specified in the target definition"
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