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
a0a15ccc
Commit
a0a15ccc
authored
May 06, 2012
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add build configurations to the Pods targets based on Debug and Release.
parent
c46a4c1b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
project.rb
lib/cocoapods/project.rb
+14
-2
project_spec.rb
spec/unit/project_spec.rb
+8
-1
No files found.
lib/cocoapods/project.rb
View file @
a0a15ccc
...
@@ -15,10 +15,14 @@ module Pod
...
@@ -15,10 +15,14 @@ module Pod
def
initialize
(
*
)
def
initialize
(
*
)
super
super
main_group
<<
groups
.
new
(
'name'
=>
'Pods'
)
main_group
<<
groups
.
new
(
'name'
=>
'Pods'
)
@user_build_configurations
=
[]
end
end
def
add_build_configurations
(
user_configurations
)
def
user_build_configurations
=
(
user_build_configurations
)
user_configurations
.
each
do
|
name
,
_
|
@user_build_configurations
=
user_build_configurations
# The configurations at the top level only need to exist, they don't hold
# any build settings themselves, that's left to `add_pod_target`.
user_build_configurations
.
each
do
|
name
,
_
|
unless
build_configurations
.
map
(
&
:name
).
include?
(
name
)
unless
build_configurations
.
map
(
&
:name
).
include?
(
name
)
build_configurations
.
new
(
'name'
=>
name
)
build_configurations
.
new
(
'name'
=>
name
)
end
end
...
@@ -49,6 +53,14 @@ module Pod
...
@@ -49,6 +53,14 @@ module Pod
target
.
build_settings
(
'Debug'
).
merge!
(
settings
)
target
.
build_settings
(
'Debug'
).
merge!
(
settings
)
target
.
build_settings
(
'Release'
).
merge!
(
settings
)
target
.
build_settings
(
'Release'
).
merge!
(
settings
)
@user_build_configurations
.
each
do
|
name
,
type
|
unless
target
.
build_configurations
.
map
(
&
:name
).
include?
(
name
)
config
=
target
.
build_configurations
.
new
(
'name'
=>
name
)
# Copy the settings from either the Debug or the Release configuration.
config
.
build_settings
=
target
.
build_settings
(
type
.
to_s
.
capitalize
).
merge
(
settings
)
end
end
target
target
end
end
end
end
...
...
spec/unit/project_spec.rb
View file @
a0a15ccc
...
@@ -34,10 +34,17 @@ describe 'Pod::Project' do
...
@@ -34,10 +34,17 @@ describe 'Pod::Project' do
end
end
it
"adds build configurations named after every configuration across all of the user's projects"
do
it
"adds build configurations named after every configuration across all of the user's projects"
do
@project
.
add_build_configurations
(
'Debug'
=>
:debug
,
'Release'
=>
:release
,
'Test'
=>
:debug
,
'AppStore'
=>
:release
)
@project
.
user_build_configurations
=
{
'Debug'
=>
:debug
,
'Release'
=>
:release
,
'Test'
=>
:debug
,
'AppStore'
=>
:release
}
@project
.
build_configurations
.
map
(
&
:name
).
sort
.
should
==
%w{ AppStore Debug Release Test }
@project
.
build_configurations
.
map
(
&
:name
).
sort
.
should
==
%w{ AppStore Debug Release Test }
end
end
it
"adds build configurations named after every configuration across all of the user's projects to a target"
do
@project
.
user_build_configurations
=
{
'Debug'
=>
:debug
,
'Release'
=>
:release
,
'Test'
=>
:debug
,
'AppStore'
=>
:release
}
target
=
@project
.
add_pod_target
(
'SomeTarget'
,
Pod
::
Platform
.
ios
)
target
.
build_settings
(
'Test'
)[
"VALIDATE_PRODUCT"
].
should
==
nil
target
.
build_settings
(
'AppStore'
)[
"VALIDATE_PRODUCT"
].
should
==
"YES"
end
describe
"concerning its :ios targets"
do
describe
"concerning its :ios targets"
do
it
"sets VALIDATE_PRODUCT to YES for the Release configuration"
do
it
"sets VALIDATE_PRODUCT to YES for the Release configuration"
do
target
=
Pod
::
Project
.
new
.
add_pod_target
(
'Pods'
,
Pod
::
Platform
.
ios
)
target
=
Pod
::
Project
.
new
.
add_pod_target
(
'Pods'
,
Pod
::
Platform
.
ios
)
...
...
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