Commit 4980095b authored by Fabio Pelosin's avatar Fabio Pelosin

[UserProjectIntegrator] Check if the xcconfig files is overridden.

Closes #92.
parent 0a5cd240
## Master
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.12.0...master)
###### Enhancements
- Check if any of the build settings defined in the xcconfig files is overridden. [#92](https://github.com/CocoaPods/CocoaPods/issues/92)
###### Bug fixes
- The final project isn’t affected anymore by the `inhibit_all_warnings!` option.
......
......@@ -105,6 +105,8 @@ module Pod
end
puts "- Generating xcconfig file at `#{sandbox.root + @target_definition.xcconfig_name}'" if config.verbose?
xcconfig.save_as(sandbox.root + @target_definition.xcconfig_name)
@target_definition.xcconfig = xcconfig
puts "- Generating prefix header at `#{sandbox.root + @target_definition.prefix_header_name}'" if config.verbose?
save_prefix_header_as(sandbox.root + @target_definition.prefix_header_name, pods)
puts "- Generating copy resources script at `#{sandbox.root + @target_definition.copy_resources_script_name}'" if config.verbose?
......
......@@ -135,9 +135,28 @@ module Pod
def add_xcconfig_base_configuration
xcconfig = user_project.files.new('path' => @target_definition.xcconfig_relative_path)
targets.each do |target|
config_build_names_by_overriden_key = {}
target.build_configurations.each do |config|
config_name = config.attributes["name"]
if @target_definition.xcconfig
@target_definition.xcconfig.attributes.each do |key, value|
target_value = config.build_settings[key]
if target_value && !target_value.include?('$(inherited)')
config_build_names_by_overriden_key[key] ||= []
config_build_names_by_overriden_key[key] << config_name
end
end
end
config.base_configuration = xcconfig
end
config_build_names_by_overriden_key.each do |key, config_build_names|
name = "#{target.attributes["name"]} [#{config_build_names.join(' - ')}]"
puts "\n[!] The target `#{name}' overrides the `#{key}' build setting defined in `#{@target_definition.xcconfig_relative_path}'.".yellow
puts " - Use the `$(inherited)' flag, or"
puts " - Remove the build settings from the target."
end
end
end
......
......@@ -143,6 +143,8 @@ module Pod
relative_to_srcroot("Pods/#{xcconfig_name}").to_s
end
attr_accessor :xcconfig
def copy_resources_script_name
"#{label}-resources.sh"
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