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
fc2c2bbf
Commit
fc2c2bbf
authored
Jul 19, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[AggregateXCConfig] Only include settings for the current build config
parent
129ea5f4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
9 deletions
+39
-9
CHANGELOG.md
CHANGELOG.md
+10
-0
aggregate_xcconfig.rb
lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb
+12
-9
aggregate_xcconfig_spec.rb
spec/unit/generator/xcconfig/aggregate_xcconfig_spec.rb
+17
-0
No files found.
CHANGELOG.md
View file @
fc2c2bbf
...
...
@@ -4,6 +4,16 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
To install release candidates run
`[sudo] gem install cocoapods --pre`
## Master
##### Bug Fixes
*
Ensure the aggregate
`.xcconfig`
file only has the settings for the
appropriate build configuration.
[
#3842
](
https://github.com/CocoaPods/CocoaPods/issues/3842
)
[
Samuel Giddins
](
https://github.com/segiddins
)
## 0.38.0
##### Enhancements
...
...
lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb
View file @
fc2c2bbf
...
...
@@ -8,13 +8,16 @@ module Pod
#
attr_reader
:target
# @return [String] the name of the build configuration to generate this
# xcconfig for.
#
attr_reader
:configuration_name
# Initialize a new instance
#
# @param [Target] target @see target
#
# @param [String] configuration_name
# The name of the build configuration to generate this xcconfig
# for.
# @param [String] configuration_name @see configuration_name
#
def
initialize
(
target
,
configuration_name
)
@target
=
target
...
...
@@ -50,7 +53,7 @@ module Pod
#
def
generate
includes_static_libs
=
!
target
.
requires_frameworks?
includes_static_libs
||=
target
.
pod_targets
.
flat_map
(
&
:file_accessors
).
any?
{
|
fa
|
!
fa
.
vendored_libraries
.
empty?
}
includes_static_libs
||=
pod_targets
.
flat_map
(
&
:file_accessors
).
any?
{
|
fa
|
!
fa
.
vendored_libraries
.
empty?
}
config
=
{
'OTHER_LDFLAGS'
=>
'$(inherited) '
+
XCConfigHelper
.
default_ld_flags
(
target
,
includes_static_libs
),
'PODS_ROOT'
=>
target
.
relative_pods_root
,
...
...
@@ -91,7 +94,7 @@ module Pod
def
generate_settings_to_import_pod_targets
if
target
.
requires_frameworks?
# Framework headers are automatically discoverable by `#import <…>`.
header_search_paths
=
target
.
pod_targets
.
map
do
|
target
|
header_search_paths
=
pod_targets
.
map
do
|
target
|
if
target
.
scoped?
"$PODS_FRAMEWORK_BUILD_PATH/
#{
target
.
product_name
}
/Headers"
else
...
...
@@ -103,7 +106,7 @@ module Pod
# Make headers discoverable by `import "…"`
'OTHER_CFLAGS'
=>
'$(inherited) '
+
XCConfigHelper
.
quote
(
header_search_paths
,
'-iquote'
),
}
if
target
.
pod_targets
.
any?
{
|
t
|
t
.
should_build?
&&
t
.
scoped?
}
if
pod_targets
.
any?
{
|
t
|
t
.
should_build?
&&
t
.
scoped?
}
build_settings
[
'FRAMEWORK_SEARCH_PATHS'
]
=
'$(inherited) "$PODS_FRAMEWORK_BUILD_PATH"'
end
@xcconfig
.
merge!
(
build_settings
)
...
...
@@ -130,7 +133,7 @@ module Pod
# user target.
#
def
generate_vendored_build_settings
target
.
pod_targets
.
each
do
|
pod_target
|
pod_targets
.
each
do
|
pod_target
|
unless
pod_target
.
should_build?
&&
pod_target
.
requires_frameworks?
XCConfigHelper
.
add_settings_for_file_accessors_of_target
(
pod_target
,
@xcconfig
)
end
...
...
@@ -141,7 +144,7 @@ module Pod
# with the user’s project.
#
def
generate_other_ld_flags
other_ld_flags
=
target
.
pod_targets
.
select
(
&
:should_build?
).
map
do
|
pod_target
|
other_ld_flags
=
pod_targets
.
select
(
&
:should_build?
).
map
do
|
pod_target
|
if
pod_target
.
requires_frameworks?
%(-framework "#{pod_target.product_basename}")
else
...
...
@@ -191,7 +194,7 @@ module Pod
# @return [Array<PodTarget>]
#
def
pod_targets
target
.
pod_targets_for_build_configuration
(
@
configuration_name
)
target
.
pod_targets_for_build_configuration
(
configuration_name
)
end
# Returns the +user_target_xcconfig+ for all pod targets and their spec
...
...
spec/unit/generator/xcconfig/aggregate_xcconfig_spec.rb
View file @
fc2c2bbf
...
...
@@ -214,6 +214,23 @@ module Pod
#-----------------------------------------------------------------------#
describe
'when no pods are whitelisted for the given configuration'
do
before
do
@generator
.
stubs
(
:configuration_name
).
returns
(
'.invalid'
)
@xcconfig
=
@generator
.
generate
end
it
'does not link with vendored frameworks'
do
@xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
.
not
.
include
'-framework "Bananalib"'
end
it
'does not link with vendored libraries'
do
@xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
.
not
.
include
'-l"Bananalib"'
end
end
#-----------------------------------------------------------------------#
describe
'with multiple pod targets with user_target_xcconfigs'
do
before
do
spec_b
=
fixture_spec
(
'orange-framework/OrangeFramework.podspec'
)
...
...
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