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
c46a4c1b
Commit
c46a4c1b
authored
May 01, 2012
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Read the configurations from the user's projects and default to :release.
parent
660d5a61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
5 deletions
+25
-5
podfile.rb
lib/cocoapods/podfile.rb
+18
-4
podfile_spec.rb
spec/unit/podfile_spec.rb
+7
-1
No files found.
lib/cocoapods/podfile.rb
View file @
c46a4c1b
...
...
@@ -5,16 +5,16 @@ module Pod
DEFAULT_BUILD_CONFIGURATIONS
=
{
'Debug'
=>
:debug
,
'Release'
=>
:release
}.
freeze
attr_reader
:build_configurations
def
initialize
(
path
=
nil
,
build_configurations
=
{})
self
.
path
=
path
if
path
@build_configurations
=
build_configurations
.
merge
(
DEFAULT_BUILD_CONFIGURATIONS
)
end
def
path
=
(
path
)
path
=
path
.
to_s
@path
=
config
.
project_root
+
(
File
.
extname
(
path
)
==
'.xcodeproj'
?
path
:
"
#{
path
}
.xcodeproj"
)
path
=
path
.
to_s
@path
=
Pathname
.
new
(
File
.
extname
(
path
)
==
'.xcodeproj'
?
path
:
"
#{
path
}
.xcodeproj"
)
@path
=
config
.
project_root
+
@path
unless
@path
.
absolute?
@path
end
def
path
...
...
@@ -27,6 +27,20 @@ module Pod
end
end
end
def
project
Xcodeproj
::
Project
.
new
(
path
)
if
path
end
def
build_configurations
if
project
project
.
build_configurations
.
map
(
&
:name
).
inject
({})
do
|
hash
,
name
|
hash
[
name
]
=
:release
;
hash
end
.
merge
(
@build_configurations
)
else
@build_configurations
end
end
end
class
TargetDefinition
...
...
spec/unit/podfile_spec.rb
View file @
c46a4c1b
...
...
@@ -248,7 +248,8 @@ describe "Pod::Podfile" do
@podfile
.
target_definitions
[
:nested_osx_target
].
should
.
not
.
be
.
exclusive
end
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
it
"returns the specified configurations and wether it should be based on a debug or a release build"
do
Pod
::
Podfile
::
UserProject
.
any_instance
.
stubs
(
:project
)
all
=
{
'Release'
=>
:release
,
'Debug'
=>
:debug
,
'Test'
=>
:debug
}
@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
)
...
...
@@ -257,6 +258,11 @@ describe "Pod::Podfile" do
@podfile
.
user_build_configurations
.
should
==
all
.
merge
(
'iOS App Store'
=>
:release
,
'Mac App Store'
=>
:release
)
end
it
"defaults, for unspecified configurations, to a release build"
do
project
=
Pod
::
Podfile
::
UserProject
.
new
(
fixture
(
'SampleProject/SampleProject.xcodeproj'
),
'Test'
=>
:debug
)
project
.
build_configurations
.
should
==
{
'Release'
=>
:release
,
'Debug'
=>
:debug
,
'Test'
=>
:debug
,
'App Store'
=>
:release
}
end
describe
"with an Xcode project that's not in the project_root"
do
before
do
@target_definition
=
@podfile
.
target_definitions
[
:default
]
...
...
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