Commit 4c4895f8 authored by Eloy Durán's avatar Eloy Durán

Merge pull request #2700 from HeEAaD/number_prefix_preprocessor_definitions

Improved sanitizing of configuration names which have a number prefix.
parents 238457a7 5369677f
......@@ -61,6 +61,9 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[Eloy Durán](https://github.com/alloy)
[#2723](https://github.com/CocoaPods/CocoaPods/issues/2723)
* Improved sanitizing of configuration names which have a number prefix.
[Steffen Matthischke](https://github.com/HeEAaD)
[#2700](https://github.com/CocoaPods/CocoaPods/pull/2700)
## 0.34.4
......
......@@ -209,7 +209,7 @@ module Pod
#
def add_build_configuration(name, type)
build_configuration = super
values = ["#{name.gsub(/[^a-zA-Z0-9_]/, '_').upcase}=1"]
values = ["#{name.gsub(/[^a-zA-Z0-9_]/, '_').sub(/(^[0-9])/, '_\1').upcase}=1"]
settings = build_configuration.build_settings
definitions = Array(settings['GCC_PREPROCESSOR_DEFINITIONS'])
values.each do |value|
......
......@@ -234,9 +234,9 @@ module Pod
end
it "doesn't create invalid preprocessor definitions for configurations" do
configuration = @project.add_build_configuration('Release-Foo.bar', :release)
configuration = @project.add_build_configuration('1 Release-Foo.bar', :release)
settings = configuration.build_settings
settings['GCC_PREPROCESSOR_DEFINITIONS'].should.include('RELEASE_FOO_BAR=1')
settings['GCC_PREPROCESSOR_DEFINITIONS'].should.include('_1_RELEASE_FOO_BAR=1')
end
it "doesn't duplicate values" 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