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
660d5a61
Commit
660d5a61
authored
Apr 28, 2012
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add build configs of all the user's projects to the Pods project.
Still need to do it at the target level too.
parent
8453f585
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
13 deletions
+32
-13
podfile.rb
lib/cocoapods/podfile.rb
+14
-9
project.rb
lib/cocoapods/project.rb
+8
-0
podfile_spec.rb
spec/unit/podfile_spec.rb
+5
-4
project_spec.rb
spec/unit/project_spec.rb
+5
-0
No files found.
lib/cocoapods/podfile.rb
View file @
660d5a61
...
...
@@ -3,13 +3,13 @@ module Pod
class
UserProject
include
Config
::
Mixin
DEFAULT_CONFIGURATIONS
=
{
'Debug'
=>
:debug
,
'Release'
=>
:release
}.
freeze
DEFAULT_
BUILD_
CONFIGURATIONS
=
{
'Debug'
=>
:debug
,
'Release'
=>
:release
}.
freeze
attr_reader
:configurations
attr_reader
:
build_
configurations
def
initialize
(
path
=
nil
,
configurations
=
{})
def
initialize
(
path
=
nil
,
build_
configurations
=
{})
self
.
path
=
path
if
path
@
configurations
=
configurations
.
merge
(
DEFAULT
_CONFIGURATIONS
)
@
build_configurations
=
build_configurations
.
merge
(
DEFAULT_BUILD
_CONFIGURATIONS
)
end
def
path
=
(
path
)
...
...
@@ -71,10 +71,10 @@ module Pod
def
label
if
name
==
:default
"Pods"
elsif
@parent
"
#{
@parent
.
label
}
-
#{
name
}
"
else
elsif
exclusive?
"Pods-
#{
name
}
"
else
"
#{
@parent
.
label
}
-
#{
name
}
"
end
end
...
...
@@ -208,8 +208,8 @@ module Pod
# xcodeproj 'TestProject'
# end
#
def
xcodeproj
(
path
,
configurations
=
{})
@target_definition
.
user_project
=
UserProject
.
new
(
path
,
configurations
)
def
xcodeproj
(
path
,
build_
configurations
=
{})
@target_definition
.
user_project
=
UserProject
.
new
(
path
,
build_
configurations
)
end
# Specifies the target(s) in the user’s project that this Pods library
...
...
@@ -427,6 +427,11 @@ module Pod
@set_arc_compatibility_flag
end
def
user_build_configurations
configs_array
=
@target_definitions
.
values
.
map
{
|
td
|
td
.
user_project
.
build_configurations
}
configs_array
.
inject
({})
{
|
hash
,
config
|
hash
.
merge
(
config
)
}
end
def
post_install!
(
installer
)
@post_install_callback
.
call
(
installer
)
if
@post_install_callback
end
...
...
lib/cocoapods/project.rb
View file @
660d5a61
...
...
@@ -17,6 +17,14 @@ module Pod
main_group
<<
groups
.
new
(
'name'
=>
'Pods'
)
end
def
add_build_configurations
(
user_configurations
)
user_configurations
.
each
do
|
name
,
_
|
unless
build_configurations
.
map
(
&
:name
).
include?
(
name
)
build_configurations
.
new
(
'name'
=>
name
)
end
end
end
# Shortcut access to the `Pods' PBXGroup.
def
pods
groups
.
find
{
|
g
|
g
.
name
==
'Pods'
}
||
groups
.
new
({
'name'
=>
'Pods'
})
...
...
spec/unit/podfile_spec.rb
View file @
660d5a61
...
...
@@ -250,10 +250,11 @@ describe "Pod::Podfile" do
it
"returns the custom configurations, that the user's project contains, and wether it should be based on a debug or a release build"
do
all
=
{
'Release'
=>
:release
,
'Debug'
=>
:debug
,
'Test'
=>
:debug
}
@podfile
.
target_definitions
[
:default
].
user_project
.
configurations
.
should
==
all
.
merge
(
'iOS App Store'
=>
:release
)
@podfile
.
target_definitions
[
:test
].
user_project
.
configurations
.
should
==
all
.
merge
(
'iOS App Store'
=>
:release
)
@podfile
.
target_definitions
[
:osx_target
].
user_project
.
configurations
.
should
==
all
.
merge
(
'Mac App Store'
=>
:release
)
@podfile
.
target_definitions
[
:nested_osx_target
].
user_project
.
configurations
.
should
==
all
.
merge
(
'Mac App Store'
=>
:release
)
@podfile
.
target_definitions
[
:default
].
user_project
.
build_configurations
.
should
==
all
.
merge
(
'iOS App Store'
=>
:release
)
@podfile
.
target_definitions
[
:test
].
user_project
.
build_configurations
.
should
==
all
.
merge
(
'iOS App Store'
=>
:release
)
@podfile
.
target_definitions
[
:osx_target
].
user_project
.
build_configurations
.
should
==
all
.
merge
(
'Mac App Store'
=>
:release
)
@podfile
.
target_definitions
[
:nested_osx_target
].
user_project
.
build_configurations
.
should
==
all
.
merge
(
'Mac App Store'
=>
:release
)
@podfile
.
user_build_configurations
.
should
==
all
.
merge
(
'iOS App Store'
=>
:release
,
'Mac App Store'
=>
:release
)
end
describe
"with an Xcode project that's not in the project_root"
do
...
...
spec/unit/project_spec.rb
View file @
660d5a61
...
...
@@ -33,6 +33,11 @@ describe 'Pod::Project' do
@project
.
targets
.
first
.
build_phases
.
should
.
include
phase
end
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
.
build_configurations
.
map
(
&
:name
).
sort
.
should
==
%w{ AppStore Debug Release Test }
end
describe
"concerning its :ios targets"
do
it
"sets VALIDATE_PRODUCT to YES for the Release configuration"
do
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