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
2fa64822
Commit
2fa64822
authored
Jan 27, 2017
by
Ben Asher
Committed by
GitHub
Jan 27, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6437 from dnkoutso/static_frameworks_link_twice
Do not link static frameworks when inheriting search paths
parents
9e7c3c2e
c45a4bb8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
19 deletions
+66
-19
CHANGELOG.md
CHANGELOG.md
+3
-1
aggregate_xcconfig.rb
lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb
+1
-1
pod_xcconfig.rb
lib/cocoapods/generator/xcconfig/pod_xcconfig.rb
+1
-1
xcconfig_helper.rb
lib/cocoapods/generator/xcconfig/xcconfig_helper.rb
+24
-16
xcconfig_helper_spec.rb
spec/unit/generator/xcconfig/xcconfig_helper_spec.rb
+37
-0
No files found.
CHANGELOG.md
View file @
2fa64822
...
@@ -12,7 +12,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -12,7 +12,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
##### Bug Fixes
*
None.
*
Do not link static frameworks to targets that use
`inherit! search_paths`
.
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#6065
](
https://github.com/CocoaPods/CocoaPods/issues/6065
)
## 1.2.0.rc.1 (2017-01-13)
## 1.2.0.rc.1 (2017-01-13)
...
...
lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb
View file @
2fa64822
...
@@ -185,7 +185,7 @@ module Pod
...
@@ -185,7 +185,7 @@ module Pod
targets
.
each
do
|
pod_target
|
targets
.
each
do
|
pod_target
|
unless
pod_target
.
should_build?
&&
pod_target
.
requires_frameworks?
unless
pod_target
.
should_build?
&&
pod_target
.
requires_frameworks?
XCConfigHelper
.
add_settings_for_file_accessors_of_target
(
pod_target
,
@xcconfig
)
XCConfigHelper
.
add_settings_for_file_accessors_of_target
(
target
,
pod_target
,
@xcconfig
)
end
end
end
end
end
end
...
...
lib/cocoapods/generator/xcconfig/pod_xcconfig.rb
View file @
2fa64822
...
@@ -59,7 +59,7 @@ module Pod
...
@@ -59,7 +59,7 @@ module Pod
@xcconfig
=
Xcodeproj
::
Config
.
new
(
config
)
@xcconfig
=
Xcodeproj
::
Config
.
new
(
config
)
XCConfigHelper
.
add_settings_for_file_accessors_of_target
(
target
,
@xcconfig
)
XCConfigHelper
.
add_settings_for_file_accessors_of_target
(
nil
,
target
,
@xcconfig
)
target
.
file_accessors
.
each
do
|
file_accessor
|
target
.
file_accessors
.
each
do
|
file_accessor
|
@xcconfig
.
merge!
(
file_accessor
.
spec_consumer
.
pod_target_xcconfig
)
@xcconfig
.
merge!
(
file_accessor
.
spec_consumer
.
pod_target_xcconfig
)
end
end
...
...
lib/cocoapods/generator/xcconfig/xcconfig_helper.rb
View file @
2fa64822
...
@@ -61,7 +61,10 @@ module Pod
...
@@ -61,7 +61,10 @@ module Pod
# Configures the given Xcconfig
# Configures the given Xcconfig
#
#
# @param [PodTarget] target
# @param [AggregateTarget] aggregate_target
# The aggregate target, may be nil.
#
# @param [PodTarget] pod_target
# The pod target, which holds the list of +Spec::FileAccessor+.
# The pod target, which holds the list of +Spec::FileAccessor+.
#
#
# @param [Xcodeproj::Config] xcconfig
# @param [Xcodeproj::Config] xcconfig
...
@@ -69,14 +72,14 @@ module Pod
...
@@ -69,14 +72,14 @@ module Pod
#
#
# @return [void]
# @return [void]
#
#
def
self
.
add_settings_for_file_accessors_of_target
(
target
,
xcconfig
)
def
self
.
add_settings_for_file_accessors_of_target
(
aggregate_target
,
pod_
target
,
xcconfig
)
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
)
XCConfigHelper
.
add_spec_build_settings_to_xcconfig
(
file_accessor
.
spec_consumer
,
xcconfig
)
XCConfigHelper
.
add_static_dependency_build_settings
(
target
,
xcconfig
,
file_accessor
)
XCConfigHelper
.
add_static_dependency_build_settings
(
aggregate_target
,
pod_
target
,
xcconfig
,
file_accessor
)
end
end
XCConfigHelper
.
add_dynamic_dependency_build_settings
(
target
,
xcconfig
)
XCConfigHelper
.
add_dynamic_dependency_build_settings
(
pod_
target
,
xcconfig
)
if
target
.
requires_frameworks?
if
pod_
target
.
requires_frameworks?
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
(
dependent_target
,
xcconfig
)
end
end
end
end
...
@@ -84,7 +87,10 @@ module Pod
...
@@ -84,7 +87,10 @@ module Pod
# Adds build settings for static vendored frameworks and libraries.
# Adds build settings for static vendored frameworks and libraries.
#
#
# @param [PodTarget] target
# @param [AggregateTarget] aggregate_target
# The aggregate target, may be nil.
#
# @param [PodTarget] pod_target
# The pod target, which holds the list of +Spec::FileAccessor+.
# The pod target, which holds the list of +Spec::FileAccessor+.
#
#
# @param [Xcodeproj::Config] xcconfig
# @param [Xcodeproj::Config] xcconfig
...
@@ -95,18 +101,20 @@ module Pod
...
@@ -95,18 +101,20 @@ module Pod
#
#
# @return [void]
# @return [void]
#
#
def
self
.
add_static_dependency_build_settings
(
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
|
file_accessor
.
vendored_static_frameworks
.
each
do
|
vendored_static_framework
|
XCConfigHelper
.
add_framework_build_settings
(
vendored_static_framework
,
xcconfig
,
target
.
sandbox
.
root
)
if
aggregate_target
.
nil?
||
aggregate_target
.
target_definition
.
inheritance
!=
'search_paths'
XCConfigHelper
.
add_framework_build_settings
(
vendored_static_framework
,
xcconfig
,
pod_target
.
sandbox
.
root
)
end
end
end
file_accessor
.
vendored_static_libraries
.
each
do
|
vendored_static_library
|
file_accessor
.
vendored_static_libraries
.
each
do
|
vendored_static_library
|
XCConfigHelper
.
add_library_build_settings
(
vendored_static_library
,
xcconfig
,
target
.
sandbox
.
root
)
XCConfigHelper
.
add_library_build_settings
(
vendored_static_library
,
xcconfig
,
pod_
target
.
sandbox
.
root
)
end
end
end
end
# Adds build settings for dynamic vendored frameworks and libraries.
# Adds build settings for dynamic vendored frameworks and libraries.
#
#
# @param [PodTarget] 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+.
#
#
# @param [Xcodeproj::Config] xcconfig
# @param [Xcodeproj::Config] xcconfig
...
@@ -114,13 +122,13 @@ module Pod
...
@@ -114,13 +122,13 @@ module Pod
#
#
# @return [void]
# @return [void]
#
#
def
self
.
add_dynamic_dependency_build_settings
(
target
,
xcconfig
)
def
self
.
add_dynamic_dependency_build_settings
(
pod_
target
,
xcconfig
)
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
|
file_accessor
.
vendored_dynamic_frameworks
.
each
do
|
vendored_dynamic_framework
|
XCConfigHelper
.
add_framework_build_settings
(
vendored_dynamic_framework
,
xcconfig
,
target
.
sandbox
.
root
)
XCConfigHelper
.
add_framework_build_settings
(
vendored_dynamic_framework
,
xcconfig
,
pod_
target
.
sandbox
.
root
)
end
end
file_accessor
.
vendored_dynamic_libraries
.
each
do
|
vendored_dynamic_library
|
file_accessor
.
vendored_dynamic_libraries
.
each
do
|
vendored_dynamic_library
|
XCConfigHelper
.
add_library_build_settings
(
vendored_dynamic_library
,
xcconfig
,
target
.
sandbox
.
root
)
XCConfigHelper
.
add_library_build_settings
(
vendored_dynamic_library
,
xcconfig
,
pod_
target
.
sandbox
.
root
)
end
end
end
end
end
end
...
...
spec/unit/generator/xcconfig/xcconfig_helper_spec.rb
View file @
2fa64822
...
@@ -222,6 +222,43 @@ module Pod
...
@@ -222,6 +222,43 @@ module Pod
end
end
#---------------------------------------------------------------------#
#---------------------------------------------------------------------#
describe
'for proper other ld flags'
do
before
do
@root
=
fixture
(
'banana-lib'
)
@path_list
=
Sandbox
::
PathList
.
new
(
@root
)
@spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
@spec_consumer
=
@spec
.
consumer
(
:ios
)
@accessor
=
Pod
::
Sandbox
::
FileAccessor
.
new
(
@path_list
,
@spec_consumer
)
end
it
'should not include static framework other ld flags when inheriting search paths'
do
target_definition
=
stub
(
:inheritance
=>
'search_paths'
)
aggregate_target
=
stub
(
:target_definition
=>
target_definition
)
pod_target
=
stub
(
:sandbox
=>
config
.
sandbox
)
xcconfig
=
Xcodeproj
::
Config
.
new
@sut
.
add_static_dependency_build_settings
(
aggregate_target
,
pod_target
,
xcconfig
,
@accessor
)
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
==
'-l"Bananalib"'
end
it
'should include static framework other ld flags when not inheriting search paths'
do
target_definition
=
stub
(
:inheritance
=>
'complete'
)
aggregate_target
=
stub
(
:target_definition
=>
target_definition
)
pod_target
=
stub
(
:sandbox
=>
config
.
sandbox
)
xcconfig
=
Xcodeproj
::
Config
.
new
@sut
.
add_static_dependency_build_settings
(
aggregate_target
,
pod_target
,
xcconfig
,
@accessor
)
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
==
'-l"Bananalib" -framework "Bananalib"'
end
it
'should include static framework for pod targets'
do
pod_target
=
stub
(
:sandbox
=>
config
.
sandbox
)
xcconfig
=
Xcodeproj
::
Config
.
new
@sut
.
add_static_dependency_build_settings
(
nil
,
pod_target
,
xcconfig
,
@accessor
)
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
==
'-l"Bananalib" -framework "Bananalib"'
end
end
#---------------------------------------------------------------------#
end
end
end
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