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
81bee360
Commit
81bee360
authored
Sep 08, 2017
by
Dimitris Koutsogiorgas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not include settings from file accessors of test specs into aggregate xcconfigs
parent
a75a2e85
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
117 additions
and
17 deletions
+117
-17
CHANGELOG.md
CHANGELOG.md
+4
-0
xcconfig_helper.rb
lib/cocoapods/generator/xcconfig/xcconfig_helper.rb
+26
-17
xcconfig_helper_spec.rb
spec/unit/generator/xcconfig/xcconfig_helper_spec.rb
+87
-0
No files found.
CHANGELOG.md
View file @
81bee360
...
@@ -26,6 +26,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -26,6 +26,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
##### Bug Fixes
*
Do not include settings from file accessors of test specs into aggregate xcconfigs
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7019
](
https://github.com/CocoaPods/CocoaPods/pull/7019
)
*
Perform code signing on xctest bundles in the Pods project generated by a test spec
*
Perform code signing on xctest bundles in the Pods project generated by a test spec
[
Justin Martin
](
https://github.com/justinseanmartin
)
[
Justin Martin
](
https://github.com/justinseanmartin
)
[
#7013
](
https://github.com/CocoaPods/CocoaPods/pull/7013
)
[
#7013
](
https://github.com/CocoaPods/CocoaPods/pull/7013
)
...
...
lib/cocoapods/generator/xcconfig/xcconfig_helper.rb
View file @
81bee360
...
@@ -76,13 +76,15 @@ module Pod
...
@@ -76,13 +76,15 @@ module Pod
#
#
def
self
.
add_settings_for_file_accessors_of_target
(
aggregate_target
,
pod_target
,
xcconfig
)
def
self
.
add_settings_for_file_accessors_of_target
(
aggregate_target
,
pod_target
,
xcconfig
)
pod_target
.
file_accessors
.
each
do
|
file_accessor
|
pod_target
.
file_accessors
.
each
do
|
file_accessor
|
XCConfigHelper
.
add_spec_build_settings_to_xcconfig
(
file_accessor
.
spec_consumer
,
xcconfig
)
if
aggregate_target
.
nil?
||
!
file_accessor
.
spec
.
test_specification?
XCConfigHelper
.
add_static_dependency_build_settings
(
aggregate_target
,
pod_target
,
xcconfig
,
file_accessor
)
XCConfigHelper
.
add_spec_build_settings_to_xcconfig
(
file_accessor
.
spec_consumer
,
xcconfig
)
XCConfigHelper
.
add_static_dependency_build_settings
(
aggregate_target
,
pod_target
,
xcconfig
,
file_accessor
)
end
end
end
XCConfigHelper
.
add_dynamic_dependency_build_settings
(
pod_target
,
xcconfig
)
XCConfigHelper
.
add_dynamic_dependency_build_settings
(
aggregate_target
,
pod_target
,
xcconfig
)
if
pod_target
.
requires_frameworks?
if
pod_target
.
requires_frameworks?
pod_target
.
dependent_targets
.
each
do
|
dependent_target
|
pod_target
.
dependent_targets
.
each
do
|
dependent_target
|
XCConfigHelper
.
add_dynamic_dependency_build_settings
(
dependent_target
,
xcconfig
)
XCConfigHelper
.
add_dynamic_dependency_build_settings
(
aggregate_target
,
dependent_target
,
xcconfig
)
end
end
end
end
end
end
...
@@ -104,13 +106,15 @@ module Pod
...
@@ -104,13 +106,15 @@ module Pod
# @return [void]
# @return [void]
#
#
def
self
.
add_static_dependency_build_settings
(
aggregate_target
,
pod_target
,
xcconfig
,
file_accessor
)
def
self
.
add_static_dependency_build_settings
(
aggregate_target
,
pod_target
,
xcconfig
,
file_accessor
)
file_accessor
.
vendored_static_frameworks
.
each
do
|
vendored_static_framework
|
if
aggregate_target
.
nil?
||
!
file_accessor
.
spec
.
test_specification?
adds_other_ldflags
=
XCConfigHelper
.
links_dependency?
(
aggregate_target
,
pod_target
)
file_accessor
.
vendored_static_frameworks
.
each
do
|
vendored_static_framework
|
XCConfigHelper
.
add_framework_build_settings
(
vendored_static_framework
,
xcconfig
,
pod_target
.
sandbox
.
root
,
adds_other_ldflags
)
adds_other_ldflags
=
XCConfigHelper
.
links_dependency?
(
aggregate_target
,
pod_target
)
end
XCConfigHelper
.
add_framework_build_settings
(
vendored_static_framework
,
xcconfig
,
pod_target
.
sandbox
.
root
,
adds_other_ldflags
)
file_accessor
.
vendored_static_libraries
.
each
do
|
vendored_static_library
|
end
adds_other_ldflags
=
XCConfigHelper
.
links_dependency?
(
aggregate_target
,
pod_target
)
file_accessor
.
vendored_static_libraries
.
each
do
|
vendored_static_library
|
XCConfigHelper
.
add_library_build_settings
(
vendored_static_library
,
xcconfig
,
pod_target
.
sandbox
.
root
,
adds_other_ldflags
)
adds_other_ldflags
=
XCConfigHelper
.
links_dependency?
(
aggregate_target
,
pod_target
)
XCConfigHelper
.
add_library_build_settings
(
vendored_static_library
,
xcconfig
,
pod_target
.
sandbox
.
root
,
adds_other_ldflags
)
end
end
end
end
end
...
@@ -132,6 +136,9 @@ module Pod
...
@@ -132,6 +136,9 @@ module Pod
# Adds build settings for dynamic vendored frameworks and libraries.
# Adds build settings for dynamic vendored frameworks and libraries.
#
#
# @param [AggregateTarget] aggregate_target
# The aggregate target, may be nil.
#
# @param [PodTarget] pod_target
# @param [PodTarget] pod_target
# The pod target, which holds the list of +Spec::FileAccessor+.
# The pod target, which holds the list of +Spec::FileAccessor+.
#
#
...
@@ -140,13 +147,15 @@ module Pod
...
@@ -140,13 +147,15 @@ module Pod
#
#
# @return [void]
# @return [void]
#
#
def
self
.
add_dynamic_dependency_build_settings
(
pod_target
,
xcconfig
)
def
self
.
add_dynamic_dependency_build_settings
(
aggregate_target
,
pod_target
,
xcconfig
)
pod_target
.
file_accessors
.
each
do
|
file_accessor
|
pod_target
.
file_accessors
.
each
do
|
file_accessor
|
file_accessor
.
vendored_dynamic_frameworks
.
each
do
|
vendored_dynamic_framework
|
if
aggregate_target
.
nil?
||
!
file_accessor
.
spec
.
test_specification?
XCConfigHelper
.
add_framework_build_settings
(
vendored_dynamic_framework
,
xcconfig
,
pod_target
.
sandbox
.
root
)
file_accessor
.
vendored_dynamic_frameworks
.
each
do
|
vendored_dynamic_framework
|
end
XCConfigHelper
.
add_framework_build_settings
(
vendored_dynamic_framework
,
xcconfig
,
pod_target
.
sandbox
.
root
)
file_accessor
.
vendored_dynamic_libraries
.
each
do
|
vendored_dynamic_library
|
end
XCConfigHelper
.
add_library_build_settings
(
vendored_dynamic_library
,
xcconfig
,
pod_target
.
sandbox
.
root
)
file_accessor
.
vendored_dynamic_libraries
.
each
do
|
vendored_dynamic_library
|
XCConfigHelper
.
add_library_build_settings
(
vendored_dynamic_library
,
xcconfig
,
pod_target
.
sandbox
.
root
)
end
end
end
end
end
end
end
...
...
spec/unit/generator/xcconfig/xcconfig_helper_spec.rb
View file @
81bee360
...
@@ -241,6 +241,93 @@ module Pod
...
@@ -241,6 +241,93 @@ module Pod
#---------------------------------------------------------------------#
#---------------------------------------------------------------------#
describe
'concerning settings for file accessors'
do
it
'does not propagate framework or libraries from a test specification to an aggregate target'
do
spec
=
stub
(
:test_specification?
=>
true
)
consumer
=
stub
(
:libraries
=>
[
'xml2'
],
:frameworks
=>
[
'XCTest'
],
: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'
],
)
pod_target
=
stub
(
:file_accessors
=>
[
file_accessor
],
:requires_frameworks?
=>
true
,
:dependent_targets
=>
[],
:sandbox
=>
config
.
sandbox
,
)
target_definition
=
stub
(
:inheritance
=>
'complete'
)
aggregate_target
=
stub
(
:target_definition
=>
target_definition
)
xcconfig
=
Xcodeproj
::
Config
.
new
@sut
.
add_settings_for_file_accessors_of_target
(
aggregate_target
,
pod_target
,
xcconfig
)
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
.
be
.
nil
end
it
'does propagate framework or libraries from a non test specification to an aggregate target'
do
spec
=
stub
(
:test_specification?
=>
false
)
consumer
=
stub
(
:libraries
=>
[
'xml2'
],
:frameworks
=>
[
'XCTest'
],
: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'
],
)
pod_target
=
stub
(
:file_accessors
=>
[
file_accessor
],
:requires_frameworks?
=>
true
,
:dependent_targets
=>
[],
:sandbox
=>
config
.
sandbox
,
)
target_definition
=
stub
(
:inheritance
=>
'complete'
)
aggregate_target
=
stub
(
:target_definition
=>
target_definition
)
xcconfig
=
Xcodeproj
::
Config
.
new
@sut
.
add_settings_for_file_accessors_of_target
(
aggregate_target
,
pod_target
,
xcconfig
)
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
.
be
==
'-l"StaticLibrary" -l"VendoredDyld" -l"xml2" -framework "StaticFramework" -framework "VendoredFramework" -framework "XCTest"'
end
it
'does propagate framework or libraries to a nil aggregate target'
do
spec
=
stub
(
:test_specification?
=>
false
)
consumer
=
stub
(
:libraries
=>
[
'xml2'
],
:frameworks
=>
[
'XCTest'
],
: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'
],
)
pod_target
=
stub
(
:file_accessors
=>
[
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
)
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
.
be
==
'-l"StaticLibrary" -l"VendoredDyld" -l"xml2" -framework "StaticFramework" -framework "VendoredFramework" -framework "XCTest"'
end
end
describe
'for proper other ld flags'
do
describe
'for proper other ld flags'
do
before
do
before
do
@root
=
fixture
(
'banana-lib'
)
@root
=
fixture
(
'banana-lib'
)
...
...
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