Commit d1c57291 authored by Samuel Giddins's avatar Samuel Giddins

[Project] Transform config names to snake case for define

parent 26314037
require 'xcodeproj'
require 'active_support/core_ext/string/inflections'
module Pod
# The Pods project.
......@@ -260,7 +261,7 @@ module Pod
# @return [String] The preprocessor definition to set for the configuration.
#
def define_for_build_configuration(name)
"POD_CONFIGURATION_#{name}".gsub(/[^a-zA-Z0-9_]/, '_').upcase
"POD_CONFIGURATION_#{name.underscore}".gsub(/[^a-zA-Z0-9_]/, '_').upcase
end
private
......
......@@ -417,6 +417,14 @@ module Pod
['POD_CONFIGURATION_MY_AWESOME_CONFIGURATION=1', "$(inherited)"]
end
it 'transforms camel-cased configuration names to snake case' do
configuration = @project.add_build_configuration(
'MyAwesomeConfiguration', :release)
settings = configuration.build_settings
settings['GCC_PREPROCESSOR_DEFINITIONS'].should ==
['POD_CONFIGURATION_MY_AWESOME_CONFIGURATION=1', "$(inherited)"]
end
it 'adds DEBUG for configurations based upon :debug' do
configuration = @project.add_build_configuration(
'Config', :debug)
......
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