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
703ae63b
Commit
703ae63b
authored
Apr 02, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Cache] Store specs outside of the cached Pod dir
parent
812462a6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
7 deletions
+21
-7
cache.rb
lib/cocoapods/downloader/cache.rb
+21
-7
No files found.
lib/cocoapods/downloader/cache.rb
View file @
703ae63b
...
...
@@ -28,7 +28,10 @@ module Pod
if
!
head
&&
result
.
location
=
path_for_pod
(
name
,
version
,
downloader_opts
)
result
.
checkout_options
=
downloader_opts
result
.
spec
=
spec
||
Sandbox
::
PodspecFinder
.
new
(
result
.
location
).
podspecs
[
name
]
result
.
spec
=
spec
||
begin
cached_spec
=
path_for_spec
(
name
,
version
,
downloader_opts
)
cached_spec
.
file?
&&
Specification
.
from_file
(
cached_spec
)
end
return
result
if
result
.
location
.
directory?
end
...
...
@@ -38,15 +41,17 @@ module Pod
if
released
result
.
location
=
destination
=
path_for_pod
(
name
,
version
)
copy_and_clean
(
target
,
destination
,
spec
)
write_spec
spec
,
path_for_spec
(
name
,
version
)
else
podspecs
=
Sandbox
::
PodspecFinder
.
new
(
target
).
podspecs
podspecs
[
name
]
=
spec
if
spec
podspecs
.
each
do
|
_
,
spec
|
destination
=
path_for_pod
(
spec
.
name
,
nil
,
result
.
checkout_options
)
copy_and_clean
(
target
,
destination
,
spec
)
if
name
==
spec
.
name
podspecs
.
each
do
|
_
,
found_spec
|
destination
=
path_for_pod
(
found_spec
.
name
,
nil
,
result
.
checkout_options
)
copy_and_clean
(
target
,
destination
,
found_spec
)
write_spec
found_spec
,
path_for_spec
(
found_spec
.
name
,
nil
,
result
.
checkout_options
)
if
name
==
found_spec
.
name
result
.
location
=
destination
result
.
spec
=
spec
result
.
spec
=
found_
spec
end
end
end
...
...
@@ -75,6 +80,10 @@ module Pod
root
+
cache_key
(
name
,
version
,
downloader_opts
)
end
def
path_for_spec
(
name
,
version
=
nil
,
downloader_opts
=
nil
)
root
+
'Specs'
+
cache_key
(
name
,
version
,
downloader_opts
)
end
def
download
(
name
,
target
,
params
,
head
)
downloader
=
Downloader
.
for_target
(
target
,
params
)
if
head
...
...
@@ -110,7 +119,12 @@ module Pod
destination
.
parent
.
mkpath
unless
destination
.
parent
.
exist?
FileUtils
.
cp_r
(
source
,
destination
)
Sandbox
::
PodDirCleaner
.
new
(
destination
,
specs_by_platform
).
clean!
(
destination
+
"
#{
spec
.
name
}
.podspec.json"
).
open
(
'w'
)
{
|
f
|
f
.
write
spec
.
to_pretty_json
}
end
def
write_spec
(
spec
,
path
)
path
=
path
.
sub_ext
(
'.podspec.json'
)
FileUtils
.
mkdir_p
path
.
dirname
path
.
open
(
'w'
)
{
|
f
|
f
.
write
spec
.
to_pretty_json
}
end
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