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
4c879e62
Commit
4c879e62
authored
Oct 27, 2017
by
Dimitris Koutsogiorgas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not propagate test spec frameworks and libraries into pod target xcconfig
parent
b16a3341
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
12 deletions
+74
-12
CHANGELOG.md
CHANGELOG.md
+5
-1
pod_xcconfig.rb
lib/cocoapods/generator/xcconfig/pod_xcconfig.rb
+3
-3
xcconfig_helper.rb
lib/cocoapods/generator/xcconfig/xcconfig_helper.rb
+21
-8
xcconfig_helper_spec.rb
spec/unit/generator/xcconfig/xcconfig_helper_spec.rb
+45
-0
No files found.
CHANGELOG.md
View file @
4c879e62
...
...
@@ -12,6 +12,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
*
Do not propagate test spec frameworks and libraries into pod target xcconfig
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7172
](
https://github.com/CocoaPods/CocoaPods/issues/7172
)
*
Set language to Swift for test native targets if any dependencies use Swift
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7170
](
https://github.com/CocoaPods/CocoaPods/issues/7170
)
...
...
@@ -87,7 +91,7 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7104
](
https://github.com/CocoaPods/CocoaPods/pull/7104
)
*
Do not set a
`CODE_SIGN_IDENTITY`
for macOS app hosts or xctest bundles
*
Do not set a
`CODE_SIGN_IDENTITY`
for macOS app hosts or xctest bundles
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7103
](
https://github.com/CocoaPods/CocoaPods/pull/7103
)
...
...
lib/cocoapods/generator/xcconfig/pod_xcconfig.rb
View file @
4c879e62
...
...
@@ -64,18 +64,18 @@ module Pod
@xcconfig
=
Xcodeproj
::
Config
.
new
(
config
)
XCConfigHelper
.
add_settings_for_file_accessors_of_target
(
nil
,
target
,
@xcconfig
)
XCConfigHelper
.
add_settings_for_file_accessors_of_target
(
nil
,
target
,
@xcconfig
,
true
,
@test_xcconfig
)
target
.
file_accessors
.
each
do
|
file_accessor
|
@xcconfig
.
merge!
(
file_accessor
.
spec_consumer
.
pod_target_xcconfig
)
if
@test_xcconfig
==
file_accessor
.
spec
.
test_specification?
end
XCConfigHelper
.
add_target_specific_settings
(
target
,
@xcconfig
)
recursive_dependent_targets
=
target
.
recursive_dependent_targets
@xcconfig
.
merge!
XCConfigHelper
.
search_paths_for_dependent_targets
(
target
,
recursive_dependent_targets
,
@test_xcconfig
)
XCConfigHelper
.
generate_vendored_build_settings
(
target
,
recursive_dependent_targets
,
@xcconfig
,
false
)
if
target
.
requires_frameworks?
XCConfigHelper
.
generate_vendored_build_settings
(
target
,
recursive_dependent_targets
,
@xcconfig
,
false
,
@test_xcconfig
)
if
target
.
requires_frameworks?
if
@test_xcconfig
test_dependent_targets
=
[
target
,
*
target
.
recursive_test_dependent_targets
].
uniq
@xcconfig
.
merge!
XCConfigHelper
.
search_paths_for_dependent_targets
(
target
,
test_dependent_targets
-
recursive_dependent_targets
,
@test_xcconfig
)
XCConfigHelper
.
generate_vendored_build_settings
(
nil
,
target
.
all_test_dependent_targets
,
@xcconfig
)
XCConfigHelper
.
generate_vendored_build_settings
(
nil
,
target
.
all_test_dependent_targets
,
@xcconfig
,
true
,
@test_xcconfig
)
XCConfigHelper
.
generate_other_ld_flags
(
nil
,
target
.
all_test_dependent_targets
,
@xcconfig
)
XCConfigHelper
.
generate_ld_runpath_search_paths
(
target
,
false
,
true
,
@xcconfig
)
end
...
...
lib/cocoapods/generator/xcconfig/xcconfig_helper.rb
View file @
4c879e62
...
...
@@ -75,19 +75,24 @@ module Pod
# @param [Boolean] include_ld_flags
# Indicates whether or not to generate ld flags in addition to compile flags
#
# @param [Boolean] test_xcconfig
# Whether the settings for dependent targets are being generated for a test xcconfig or not.
#
# @return [void]
#
def
self
.
add_settings_for_file_accessors_of_target
(
target
,
pod_target
,
xcconfig
,
include_ld_flags
=
true
)
pod_target
.
file_accessors
.
each
do
|
file_accessor
|
def
self
.
add_settings_for_file_accessors_of_target
(
target
,
pod_target
,
xcconfig
,
include_ld_flags
=
true
,
test_xcconfig
=
false
)
file_accessors
=
pod_target
.
file_accessors
file_accessors
=
file_accessors
.
reject
{
|
f
|
f
.
spec
.
test_specification?
}
unless
test_xcconfig
file_accessors
.
each
do
|
file_accessor
|
if
target
.
nil?
||
!
file_accessor
.
spec
.
test_specification?
XCConfigHelper
.
add_spec_build_settings_to_xcconfig
(
file_accessor
.
spec_consumer
,
xcconfig
)
if
include_ld_flags
XCConfigHelper
.
add_static_dependency_build_settings
(
target
,
pod_target
,
xcconfig
,
file_accessor
,
include_ld_flags
)
end
end
XCConfigHelper
.
add_dynamic_dependency_build_settings
(
target
,
pod_target
,
xcconfig
,
include_ld_flags
)
XCConfigHelper
.
add_dynamic_dependency_build_settings
(
target
,
pod_target
,
xcconfig
,
include_ld_flags
,
test_xcconfig
)
if
pod_target
.
requires_frameworks?
pod_target
.
dependent_targets
.
each
do
|
dependent_target
|
XCConfigHelper
.
add_dynamic_dependency_build_settings
(
target
,
dependent_target
,
xcconfig
,
include_ld_flags
)
XCConfigHelper
.
add_dynamic_dependency_build_settings
(
target
,
dependent_target
,
xcconfig
,
include_ld_flags
,
test_xcconfig
)
end
end
end
...
...
@@ -153,10 +158,15 @@ module Pod
# @param [Boolean] include_ld_flags
# Indicates whether or not to generate ld flags in addition to compile flags
#
# @param [Boolean] test_xcconfig
# Whether the settings for dependent targets are being generated for a test xcconfig or not.
#
# @return [void]
#
def
self
.
add_dynamic_dependency_build_settings
(
target
,
pod_target
,
xcconfig
,
include_ld_flags
)
pod_target
.
file_accessors
.
each
do
|
file_accessor
|
def
self
.
add_dynamic_dependency_build_settings
(
target
,
pod_target
,
xcconfig
,
include_ld_flags
,
test_xcconfig
)
file_accessors
=
pod_target
.
file_accessors
file_accessors
=
file_accessors
.
reject
{
|
f
|
f
.
spec
.
test_specification?
}
unless
test_xcconfig
file_accessors
.
each
do
|
file_accessor
|
if
target
.
nil?
||
!
file_accessor
.
spec
.
test_specification?
file_accessor
.
vendored_dynamic_frameworks
.
each
do
|
vendored_dynamic_framework
|
XCConfigHelper
.
add_framework_build_settings
(
vendored_dynamic_framework
,
xcconfig
,
pod_target
.
sandbox
.
root
,
include_ld_flags
)
...
...
@@ -376,16 +386,19 @@ module Pod
# @param [Boolean] include_ld_flags
# Indicates whether or not to generate ld flags in addition to compile flags
#
# @param [Boolean] test_xcconfig
# Indicates whether or not the generated ld flags are for a test xcconfig or not
#
# @note
# In case of generated pod targets, which require frameworks, the
# vendored frameworks and libraries are already linked statically
# into the framework binary and must not be linked again to the
# user target.
#
def
self
.
generate_vendored_build_settings
(
target
,
dep_targets
,
xcconfig
,
include_ld_flags
=
true
)
def
self
.
generate_vendored_build_settings
(
target
,
dep_targets
,
xcconfig
,
include_ld_flags
=
true
,
test_xcconfig
=
false
)
dep_targets
.
each
do
|
dep_target
|
unless
dep_target
.
should_build?
&&
dep_target
.
requires_frameworks?
&&
!
dep_target
.
static_framework?
XCConfigHelper
.
add_settings_for_file_accessors_of_target
(
target
,
dep_target
,
xcconfig
,
include_ld_flags
)
XCConfigHelper
.
add_settings_for_file_accessors_of_target
(
target
,
dep_target
,
xcconfig
,
include_ld_flags
,
test_xcconfig
)
end
end
end
...
...
spec/unit/generator/xcconfig/xcconfig_helper_spec.rb
View file @
4c879e62
...
...
@@ -442,6 +442,51 @@ module Pod
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
.
be
.
nil
end
it
'propagates correct frameworks or libraries to both test and non test xcconfigs'
do
spec
=
stub
(
:test_specification?
=>
false
)
consumer
=
stub
(
:libraries
=>
[],
:frameworks
=>
[],
:weak_frameworks
=>
[],
:spec
=>
spec
,
)
file_accessor
=
stub
(
:spec
=>
spec
,
:spec_consumer
=>
consumer
,
:vendored_static_frameworks
=>
[
config
.
sandbox
.
root
+
'StaticFramework.framework'
],
:vendored_static_libraries
=>
[
config
.
sandbox
.
root
+
'StaticLibrary.a'
],
:vendored_dynamic_frameworks
=>
[
config
.
sandbox
.
root
+
'VendoredFramework.framework'
],
:vendored_dynamic_libraries
=>
[
config
.
sandbox
.
root
+
'VendoredDyld.dyld'
],
)
test_spec
=
stub
(
:test_specification?
=>
true
)
test_consumer
=
stub
(
:libraries
=>
[
'xml2'
],
:frameworks
=>
[
'XCTest'
],
:weak_frameworks
=>
[],
:spec
=>
test_spec
,
)
test_file_accessor
=
stub
(
:spec
=>
test_spec
,
:spec_consumer
=>
test_consumer
,
:vendored_static_frameworks
=>
[],
:vendored_static_libraries
=>
[],
:vendored_dynamic_frameworks
=>
[],
:vendored_dynamic_libraries
=>
[],
)
pod_target
=
stub
(
:file_accessors
=>
[
file_accessor
,
test_file_accessor
],
:requires_frameworks?
=>
true
,
:dependent_targets
=>
[],
:sandbox
=>
config
.
sandbox
,
)
xcconfig
=
Xcodeproj
::
Config
.
new
@sut
.
add_settings_for_file_accessors_of_target
(
nil
,
pod_target
,
xcconfig
,
true
,
false
)
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
==
'-l"StaticLibrary" -l"VendoredDyld" -framework "StaticFramework" -framework "VendoredFramework"'
test_xcconfig
=
Xcodeproj
::
Config
.
new
@sut
.
add_settings_for_file_accessors_of_target
(
nil
,
pod_target
,
test_xcconfig
,
true
,
true
)
test_xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
==
'-l"StaticLibrary" -l"VendoredDyld" -l"xml2" -framework "StaticFramework" -framework "VendoredFramework" -framework "XCTest"'
end
it
'does propagate framework or libraries from a non test specification to an aggregate target'
do
spec
=
stub
(
:test_specification?
=>
false
)
consumer
=
stub
(
...
...
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