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
7f7aa877
Commit
7f7aa877
authored
Apr 26, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Pod::Podfile] enhanced support for non integration
parent
56e8c133
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
6 deletions
+23
-6
podfile.rb
lib/cocoapods/podfile.rb
+2
-5
podfile_spec.rb
spec/unit/podfile_spec.rb
+21
-1
No files found.
lib/cocoapods/podfile.rb
View file @
7f7aa877
...
@@ -64,11 +64,8 @@ module Pod
...
@@ -64,11 +64,8 @@ module Pod
# Returns a path, which is relative to the project_root, relative to the
# Returns a path, which is relative to the project_root, relative to the
# `$(SRCROOT)` of the user's project.
# `$(SRCROOT)` of the user's project.
def
relative_to_srcroot
(
path
)
def
relative_to_srcroot
(
path
)
if
config
.
integrate_targets
raise
Informative
,
"[!] Unable to find an Xcode project to integrate"
.
red
unless
xcodeproj
||
!
config
.
integrate_targets
(
config
.
project_root
+
path
).
relative_path_from
(
xcodeproj
.
dirname
)
xcodeproj
?
(
config
.
project_root
+
path
).
relative_path_from
(
xcodeproj
.
dirname
)
:
path
else
"Pods"
end
end
end
def
relative_pods_root
def
relative_pods_root
...
...
spec/unit/podfile_spec.rb
View file @
7f7aa877
...
@@ -48,7 +48,7 @@ describe "Pod::Podfile" do
...
@@ -48,7 +48,7 @@ describe "Pod::Podfile" do
Pod
::
Podfile
.
new
{}.
should
.
not
.
generate_bridge_support
Pod
::
Podfile
.
new
{}.
should
.
not
.
generate_bridge_support
Pod
::
Podfile
.
new
{
generate_bridge_support!
}.
should
.
generate_bridge_support
Pod
::
Podfile
.
new
{
generate_bridge_support!
}.
should
.
generate_bridge_support
end
end
it
'specifies that ARC compatibility flag should be generated'
do
it
'specifies that ARC compatibility flag should be generated'
do
Pod
::
Podfile
.
new
{
set_arc_compatibility_flag!
}.
should
.
set_arc_compatibility_flag
Pod
::
Podfile
.
new
{
set_arc_compatibility_flag!
}.
should
.
set_arc_compatibility_flag
end
end
...
@@ -260,6 +260,15 @@ describe "Pod::Podfile" do
...
@@ -260,6 +260,15 @@ describe "Pod::Podfile" do
@target_definition
.
relative_pods_root
.
should
==
'${SRCROOT}/../Pods'
@target_definition
.
relative_pods_root
.
should
==
'${SRCROOT}/../Pods'
end
end
it
"simply returns the $(PODS_ROOT) path if no xcodeproj file is available and doesn't needs to integrate"
do
config
.
integrate_targets
.
should
.
equal
true
config
.
integrate_targets
=
false
@target_definition
.
relative_pods_root
.
should
==
'${SRCROOT}/../Pods'
@target_definition
.
stubs
(
:xcodeproj
).
returns
(
nil
)
@target_definition
.
relative_pods_root
.
should
==
'${SRCROOT}/Pods'
config
.
integrate_targets
=
true
end
it
"returns the xcconfig file path relative to the project's $(SRCROOT)"
do
it
"returns the xcconfig file path relative to the project's $(SRCROOT)"
do
@target_definition
.
xcconfig_relative_path
.
should
==
'../Pods/Pods.xcconfig'
@target_definition
.
xcconfig_relative_path
.
should
==
'../Pods/Pods.xcconfig'
end
end
...
@@ -271,6 +280,17 @@ describe "Pod::Podfile" do
...
@@ -271,6 +280,17 @@ describe "Pod::Podfile" do
end
end
describe
"concerning validations"
do
describe
"concerning validations"
do
it
"raises if it should integrate and can't find an xcodeproj"
do
config
.
integrate_targets
.
should
.
equal
true
target_definition
=
Pod
::
Podfile
.
new
{}.
target_definitions
[
:default
]
target_definition
.
stubs
(
:xcodeproj
).
returns
(
nil
)
exception
=
lambda
{
target_definition
.
relative_pods_root
}.
should
.
raise
Pod
::
Informative
exception
.
message
.
should
.
include
"Xcode project"
end
xit
"raises if no platform is specified"
do
xit
"raises if no platform is specified"
do
exception
=
lambda
{
exception
=
lambda
{
Pod
::
Podfile
.
new
{}.
validate!
Pod
::
Podfile
.
new
{}.
validate!
...
...
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