Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
d1c57291
Commit
d1c57291
authored
Dec 30, 2015
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Project] Transform config names to snake case for define
parent
26314037
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
project.rb
lib/cocoapods/project.rb
+2
-1
project_spec.rb
spec/unit/project_spec.rb
+8
-0
No files found.
lib/cocoapods/project.rb
View file @
d1c57291
require
'xcodeproj'
require
'xcodeproj'
require
'active_support/core_ext/string/inflections'
module
Pod
module
Pod
# The Pods project.
# The Pods project.
...
@@ -260,7 +261,7 @@ module Pod
...
@@ -260,7 +261,7 @@ module Pod
# @return [String] The preprocessor definition to set for the configuration.
# @return [String] The preprocessor definition to set for the configuration.
#
#
def
define_for_build_configuration
(
name
)
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
end
private
private
...
...
spec/unit/project_spec.rb
View file @
d1c57291
...
@@ -417,6 +417,14 @@ module Pod
...
@@ -417,6 +417,14 @@ module Pod
[
'POD_CONFIGURATION_MY_AWESOME_CONFIGURATION=1'
,
"$(inherited)"
]
[
'POD_CONFIGURATION_MY_AWESOME_CONFIGURATION=1'
,
"$(inherited)"
]
end
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
it
'adds DEBUG for configurations based upon :debug'
do
configuration
=
@project
.
add_build_configuration
(
configuration
=
@project
.
add_build_configuration
(
'Config'
,
:debug
)
'Config'
,
:debug
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment