Commit 82da9411 authored by Paul Beusterien's avatar Paul Beusterien

Fix xcconfig boolean merging

parent 89d2091d
...@@ -38,6 +38,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -38,6 +38,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Danielle Tomlinson](https://github.com/dantoml) [Danielle Tomlinson](https://github.com/dantoml)
[#6971](https://github.com/CocoaPods/CocoaPods/issue/6971) [#6971](https://github.com/CocoaPods/CocoaPods/issue/6971)
* Fix xcconfig boolean merging when substrings include yes or no
[Paul Beusterien](https://github.com/paulb777)
[#6997](https://github.com/CocoaPods/CocoaPods/pull/6997)
## 1.3.1 (2017-08-02) ## 1.3.1 (2017-08-02)
......
...@@ -218,7 +218,7 @@ module Pod ...@@ -218,7 +218,7 @@ module Pod
settings = user_target_xcconfig_values_by_consumer_by_key settings = user_target_xcconfig_values_by_consumer_by_key
settings.each_with_object({}) do |(key, values_by_consumer), xcconfig| settings.each_with_object({}) do |(key, values_by_consumer), xcconfig|
uniq_values = values_by_consumer.values.uniq uniq_values = values_by_consumer.values.uniq
values_are_bools = uniq_values.all? { |v| v =~ /(yes|no)/i } values_are_bools = uniq_values.all? { |v| v =~ /^(yes|no)$/i }
if values_are_bools if values_are_bools
# Boolean build settings # Boolean build settings
if uniq_values.count > 1 if uniq_values.count > 1
......
...@@ -412,6 +412,13 @@ module Pod ...@@ -412,6 +412,13 @@ module Pod
'["BananaLib", "OrangeFramework"]. Boolean build setting '\ '["BananaLib", "OrangeFramework"]. Boolean build setting '\
'ENABLE_HEADER_DEPENDENCIES has different values.' 'ENABLE_HEADER_DEPENDENCIES has different values.'
end end
it 'make sure "no" or "yes" substring doesnt get treated as boolean' do
@consumer_a.stubs(:user_target_xcconfig).returns('GCC_PREPROCESSOR_DEFINITIONS' => '-DNOWAY')
@consumer_b.stubs(:user_target_xcconfig).returns('GCC_PREPROCESSOR_DEFINITIONS' => '-DYESWAY')
@xcconfig = @generator.generate
@xcconfig.to_hash['GCC_PREPROCESSOR_DEFINITIONS'].should == '$(inherited) COCOAPODS=1 -DNOWAY -DYESWAY'
end
end end
describe 'with list build settings' do describe 'with list build settings' do
......
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