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
2b05a2ae
Commit
2b05a2ae
authored
Mar 13, 2018
by
Dimitris Koutsogiorgas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure `SWIFT_VERSION` is set for test only pod targets during validation
parent
66646834
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
5 deletions
+40
-5
CHANGELOG.md
CHANGELOG.md
+4
-0
validator.rb
lib/cocoapods/validator.rb
+16
-5
validator_spec.rb
spec/unit/validator_spec.rb
+20
-0
No files found.
CHANGELOG.md
View file @
2b05a2ae
...
@@ -55,6 +55,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -55,6 +55,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
##### Bug Fixes
*
Ensure
`SWIFT_VERSION`
is set for test only pod targets during validation
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7498
](
https://github.com/CocoaPods/CocoaPods/issues/7498
)
*
Fix iOS test native target signing settings
*
Fix iOS test native target signing settings
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7504
](
https://github.com/CocoaPods/CocoaPods/pull/7504
)
[
#7504
](
https://github.com/CocoaPods/CocoaPods/pull/7504
)
...
...
lib/cocoapods/validator.rb
View file @
2b05a2ae
...
@@ -506,13 +506,10 @@ module Pod
...
@@ -506,13 +506,10 @@ module Pod
end
end
def
configure_pod_targets
(
targets
,
deployment_target
)
def
configure_pod_targets
(
targets
,
deployment_target
)
test_only_pod_targets
=
@installer
.
pod_targets
-
targets
.
flat_map
(
&
:pod_targets
)
targets
.
each
do
|
target
|
targets
.
each
do
|
target
|
target
.
pod_targets
.
each
do
|
pod_target
|
target
.
pod_targets
.
each
do
|
pod_target
|
next
unless
(
native_target
=
pod_target
.
native_target
)
update_pod_target_build_settings
(
pod_target
)
native_target
.
build_configuration_list
.
build_configurations
.
each
do
|
build_configuration
|
(
build_configuration
.
build_settings
[
'OTHER_CFLAGS'
]
||=
'$(inherited)'
)
<<
' -Wincomplete-umbrella'
build_configuration
.
build_settings
[
'SWIFT_VERSION'
]
=
(
pod_target
.
swift_version
||
swift_version
)
if
pod_target
.
uses_swift?
end
if
pod_target
.
uses_swift?
if
pod_target
.
uses_swift?
pod_target
.
test_native_targets
.
each
do
|
test_native_target
|
pod_target
.
test_native_targets
.
each
do
|
test_native_target
|
test_native_target
.
build_configuration_list
.
build_configurations
.
each
do
|
build_configuration
|
test_native_target
.
build_configuration_list
.
build_configurations
.
each
do
|
build_configuration
|
...
@@ -527,6 +524,20 @@ module Pod
...
@@ -527,6 +524,20 @@ module Pod
error
(
'swift'
,
'Swift support uses dynamic frameworks and is therefore only supported on iOS > 8.'
)
unless
uses_xctest
error
(
'swift'
,
'Swift support uses dynamic frameworks and is therefore only supported on iOS > 8.'
)
unless
uses_xctest
end
end
end
end
# Wire up Swift version to pod targets used only by tests.
test_only_pod_targets
.
each
do
|
test_pod_target
|
update_pod_target_build_settings
(
test_pod_target
)
end
end
def
update_pod_target_build_settings
(
pod_target
)
native_target
=
pod_target
.
native_target
unless
native_target
.
nil?
native_target
.
build_configuration_list
.
build_configurations
.
each
do
|
build_configuration
|
(
build_configuration
.
build_settings
[
'OTHER_CFLAGS'
]
||=
'$(inherited)'
)
<<
' -Wincomplete-umbrella'
build_configuration
.
build_settings
[
'SWIFT_VERSION'
]
=
(
pod_target
.
swift_version
||
swift_version
)
if
pod_target
.
uses_swift?
end
end
end
end
def
validate_vendored_dynamic_frameworks
def
validate_vendored_dynamic_frameworks
...
...
spec/unit/validator_spec.rb
View file @
2b05a2ae
...
@@ -1068,6 +1068,26 @@ module Pod
...
@@ -1068,6 +1068,26 @@ module Pod
pod_target_one
=
stub
(
:uses_swift?
=>
true
,
:swift_version
=>
'4.0'
,
:native_target
=>
native_target_one
,
:test_native_targets
=>
[])
pod_target_one
=
stub
(
:uses_swift?
=>
true
,
:swift_version
=>
'4.0'
,
:native_target
=>
native_target_one
,
:test_native_targets
=>
[])
pod_target_two
=
stub
(
:uses_swift?
=>
true
,
:swift_version
=>
'3.2'
,
:native_target
=>
native_target_two
,
:test_native_targets
=>
[])
pod_target_two
=
stub
(
:uses_swift?
=>
true
,
:swift_version
=>
'3.2'
,
:native_target
=>
native_target_two
,
:test_native_targets
=>
[])
aggregate_target
=
stub
(
:pod_targets
=>
[
pod_target_one
,
pod_target_two
])
aggregate_target
=
stub
(
:pod_targets
=>
[
pod_target_one
,
pod_target_two
])
installer
=
stub
(
:pod_targets
=>
[
pod_target_one
,
pod_target_two
])
validator
.
instance_variable_set
(
:@installer
,
installer
)
validator
.
send
(
:configure_pod_targets
,
[
aggregate_target
],
'9.0'
)
debug_configuration_one
.
build_settings
[
'SWIFT_VERSION'
].
should
==
'4.0'
debug_configuration_two
.
build_settings
[
'SWIFT_VERSION'
].
should
==
'3.2'
end
it
'honors swift version set by the pod target for dependencies that are not part of the aggregate target'
do
validator
=
test_swiftpod
consumer
=
stub
(
:platform_name
=>
'iOS'
)
validator
.
instance_variable_set
(
:@consumer
,
consumer
)
debug_configuration_one
=
stub
(
:build_settings
=>
{})
debug_configuration_two
=
stub
(
:build_settings
=>
{})
native_target_one
=
stub
(
:build_configuration_list
=>
stub
(
:build_configurations
=>
[
debug_configuration_one
]))
native_target_two
=
stub
(
:build_configuration_list
=>
stub
(
:build_configurations
=>
[
debug_configuration_two
]))
pod_target_one
=
stub
(
:uses_swift?
=>
true
,
:swift_version
=>
'4.0'
,
:native_target
=>
native_target_one
,
:test_native_targets
=>
[])
pod_target_two
=
stub
(
:uses_swift?
=>
true
,
:swift_version
=>
'3.2'
,
:native_target
=>
native_target_two
,
:test_native_targets
=>
[])
aggregate_target
=
stub
(
:pod_targets
=>
[
pod_target_one
])
installer
=
stub
(
:pod_targets
=>
[
pod_target_one
,
pod_target_two
])
validator
.
instance_variable_set
(
:@installer
,
installer
)
validator
.
send
(
:configure_pod_targets
,
[
aggregate_target
],
'9.0'
)
validator
.
send
(
:configure_pod_targets
,
[
aggregate_target
],
'9.0'
)
debug_configuration_one
.
build_settings
[
'SWIFT_VERSION'
].
should
==
'4.0'
debug_configuration_one
.
build_settings
[
'SWIFT_VERSION'
].
should
==
'4.0'
debug_configuration_two
.
build_settings
[
'SWIFT_VERSION'
].
should
==
'3.2'
debug_configuration_two
.
build_settings
[
'SWIFT_VERSION'
].
should
==
'3.2'
...
...
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