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
df0112ea
Commit
df0112ea
authored
Mar 09, 2012
by
Ben Scheirman
Committed by
Eloy Duran
Apr 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move logic for generating PODS_ROOT to a class
parent
28b1e0f9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
1 deletion
+39
-1
TODO
TODO
+1
-0
cocoapods.rb
lib/cocoapods.rb
+1
-0
target_installer.rb
lib/cocoapods/installer/target_installer.rb
+2
-1
pod_path_resolver.rb
lib/cocoapods/pod_path_resolver.rb
+20
-0
pod_path_resolver_spec.rb
spec/unit/pod_path_resolver_spec.rb
+15
-0
No files found.
TODO
View file @
df0112ea
...
@@ -5,3 +5,4 @@
...
@@ -5,3 +5,4 @@
* Validate that there are dependencies in a Podfile.
* Validate that there are dependencies in a Podfile.
* Validate that the dependencies in the targets don't conflict. E.g. two different versions of the same pod.
* Validate that the dependencies in the targets don't conflict. E.g. two different versions of the same pod.
* Move Podfile.lock generator from Installer into its own file.
* Move Podfile.lock generator from Installer into its own file.
* Remove better_installer.rb file
lib/cocoapods.rb
View file @
df0112ea
...
@@ -17,6 +17,7 @@ module Pod
...
@@ -17,6 +17,7 @@ module Pod
autoload
:Podfile
,
'cocoapods/podfile'
autoload
:Podfile
,
'cocoapods/podfile'
autoload
:Project
,
'cocoapods/project'
autoload
:Project
,
'cocoapods/project'
autoload
:Resolver
,
'cocoapods/resolver'
autoload
:Resolver
,
'cocoapods/resolver'
autoload
:PodPathResolver
,
'cocoapods/pod_path_resolver'
autoload
:Sandbox
,
'cocoapods/sandbox'
autoload
:Sandbox
,
'cocoapods/sandbox'
autoload
:Source
,
'cocoapods/source'
autoload
:Source
,
'cocoapods/source'
autoload
:Spec
,
'cocoapods/specification'
autoload
:Spec
,
'cocoapods/specification'
...
...
lib/cocoapods/installer/target_installer.rb
View file @
df0112ea
...
@@ -10,10 +10,11 @@ module Pod
...
@@ -10,10 +10,11 @@ module Pod
@podfile
,
@project
,
@target_definition
=
podfile
,
project
,
target_definition
@podfile
,
@project
,
@target_definition
=
podfile
,
project
,
target_definition
end
end
def
xcconfig
def
xcconfig
@xcconfig
||=
Xcodeproj
::
Config
.
new
({
@xcconfig
||=
Xcodeproj
::
Config
.
new
({
# In a workspace this is where the static library headers should be found.
# In a workspace this is where the static library headers should be found.
'PODS_ROOT'
=>
'$(SRCROOT)/Pods'
,
'PODS_ROOT'
=>
Pod
::
PodPathResolver
.
new
(
@podfile
).
pods_root
,
'ALWAYS_SEARCH_USER_PATHS'
=>
'YES'
,
# needed to make EmbedReader build
'ALWAYS_SEARCH_USER_PATHS'
=>
'YES'
,
# needed to make EmbedReader build
'OTHER_LDFLAGS'
=>
default_ld_flags
,
'OTHER_LDFLAGS'
=>
default_ld_flags
,
})
})
...
...
lib/cocoapods/pod_path_resolver.rb
0 → 100644
View file @
df0112ea
module
Pod
class
PodPathResolver
include
Config
::
Mixin
def
initialize
(
podfile
)
@podfile
=
podfile
end
def
relative_path_for_pods
pods_path
=
config
.
project_pods_root
xcode_proj_path
=
@podfile
.
xcodeproj
||
''
source_root
=
(
config
.
project_root
+
xcode_proj_path
).
parent
pods_path
.
relative_path_from
(
source_root
)
end
def
pods_root
"$(SRCROOT)/
#{
relative_path_for_pods
}
"
end
end
end
spec/unit/pod_path_resolver_spec.rb
0 → 100644
View file @
df0112ea
require
File
.
expand_path
(
'../../spec_helper'
,
__FILE__
)
describe
"Pod::PodPathResolver"
do
it
"should default to a path underneath source root"
do
podfile
=
Pod
::
Podfile
.
new
{
platform
:ios
;
xcodeproj
'foo.xcodeproj'
}
resolver
=
Pod
::
PodPathResolver
.
new
(
podfile
)
resolver
.
pods_root
.
should
==
"$(SRCROOT)/Pods"
end
it
"should work with source root one level deeper"
do
podfile
=
Pod
::
Podfile
.
new
{
platform
:ios
;
xcodeproj
'subdir/foo.xcodeproj'
}
resolver
=
Pod
::
PodPathResolver
.
new
(
podfile
)
resolver
.
pods_root
.
should
==
"$(SRCROOT)/../Pods"
end
end
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