Commit 7ae3875f authored by Eloy Durán's avatar Eloy Durán

[XCConfigIntegrator] Assign xcconfigs to all targets being integrated.

Fixes #2752.
parent 27012b50
......@@ -81,6 +81,12 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
##### Bug Fixes
* `XCConfigIntegrator` Fixes an issue where not all targets that need
integration where being integrated, but were getting incorrect warnings about
the user having specified a custom base configuration.
[Eloy Durán](https://github.com/alloy)
[2752](https://github.com/CocoaPods/CocoaPods/issues/2752)
* Do not try to clone spec-repos in `/`.
[Eloy Durán](https://github.com/alloy)
[#2723](https://github.com/CocoaPods/CocoaPods/issues/2723)
......
......@@ -83,22 +83,26 @@ module Pod
# @param [Xcodeproj::XCBuildConfiguration] config
# The build configuration.
#
# @return [Boolean] Indicates whether or not any changes were made.
#
def self.set_target_xcconfig(pod_bundle, target, config)
path = pod_bundle.xcconfig_relative_path(config.name)
group = config.project['Pods'] || config.project.new_group('Pods')
file_ref = group.files.find { |f| f.path == path }
if config.base_configuration_reference != file_ref
if config.base_configuration_reference &&
config.base_configuration_reference != file_ref
UI.warn 'CocoaPods did not set the base configuration of your ' \
'project because your project already has a custom ' \
'config set. In order for CocoaPods integration to work at ' \
'all, please either set the base configurations of the target ' \
"`#{target.name}` to `#{path}` or include the `#{path}` in your " \
'build configuration.'
false
elsif !file_ref
elsif config.base_configuration_reference.nil? || file_ref.nil?
file_ref ||= group.new_file(path)
config.base_configuration_reference = file_ref
return true
end
false
end
private
......
......@@ -62,5 +62,15 @@ module Pod
UI.warnings.should.match /not set.*base configuration/
end
it 'sets the Pods xcconfig as the base config on other targets if no base has been set yet' do
target = @project.targets[1]
XCConfigIntegrator.integrate(@pod_bundle, [@target, target])
target.build_configurations.each do |config|
config.base_configuration_reference.path.should.include 'Pods'
end
UI.warnings.should.not.match /not set.*base configuration/
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment