Commit 73622564 authored by Steffen Matthischke's avatar Steffen Matthischke

Improved sanitizing of configuration names which have a number prefix.

parent ca511f0f
...@@ -209,7 +209,7 @@ module Pod ...@@ -209,7 +209,7 @@ module Pod
# #
def add_build_configuration(name, type) def add_build_configuration(name, type)
build_configuration = super build_configuration = super
values = ["#{name.gsub(/[^a-zA-Z0-9_]/, '_').upcase}=1"] values = ["#{name.gsub(/[^a-zA-Z0-9_]/, '_').gsub(/(^[0-9])/, '_\1').upcase}=1"]
settings = build_configuration.build_settings settings = build_configuration.build_settings
definitions = Array(settings['GCC_PREPROCESSOR_DEFINITIONS']) definitions = Array(settings['GCC_PREPROCESSOR_DEFINITIONS'])
values.each do |value| values.each do |value|
......
...@@ -234,9 +234,9 @@ module Pod ...@@ -234,9 +234,9 @@ module Pod
end end
it "doesn't create invalid preprocessor definitions for configurations" do 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 = 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 end
it "doesn't duplicate values" do 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