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
d52828ef
Commit
d52828ef
authored
Mar 08, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use caching for ExternalSources::DownloaderSource pods
parent
b664f190
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
16 deletions
+13
-16
config.rb
lib/cocoapods/config.rb
+1
-1
cache.rb
lib/cocoapods/downloader/cache.rb
+5
-3
abstract_external_source.rb
lib/cocoapods/external_sources/abstract_external_source.rb
+5
-10
abstract_external_source_spec.rb
spec/unit/external_sources/abstract_external_source_spec.rb
+2
-2
No files found.
lib/cocoapods/config.rb
View file @
d52828ef
...
@@ -20,7 +20,7 @@ module Pod
...
@@ -20,7 +20,7 @@ module Pod
:integrate_targets
=>
true
,
:integrate_targets
=>
true
,
:new_version_message
=>
true
,
:new_version_message
=>
true
,
:cache_root
=>
Pathname
(
Dir
.
home
)
+
'Library/Caches/CocoaPods'
,
:cache_root
=>
Pathname
(
Dir
.
home
)
+
'Library/Caches/CocoaPods'
,
}
}
public
public
...
...
lib/cocoapods/downloader/cache.rb
View file @
d52828ef
...
@@ -41,9 +41,11 @@ module Pod
...
@@ -41,9 +41,11 @@ module Pod
result
=
Result
.
new
result
=
Result
.
new
result
.
checkout_options
=
downloader_opts
if
!
head
&&
result
.
location
=
path_for_pod
(
name
,
version
,
downloader_opts
)
result
.
location
=
path_for_pod
(
name
,
version
,
downloader_opts
)
unless
head
result
.
checkout_options
=
downloader_opts
return
result
if
!
head
&&
result
.
location
.
directory?
result
.
spec
=
spec
||
Sandbox
::
PodspecFinder
.
new
(
result
.
location
).
podspecs
[
name
]
return
result
if
result
.
location
.
directory?
end
in_tmpdir
do
|
target
|
in_tmpdir
do
|
target
|
result
.
checkout_options
=
download
(
name
,
target
,
downloader_opts
,
head
)
result
.
checkout_options
=
download
(
name
,
target
,
downloader_opts
,
head
)
...
...
lib/cocoapods/external_sources/abstract_external_source.rb
View file @
d52828ef
...
@@ -99,22 +99,17 @@ module Pod
...
@@ -99,22 +99,17 @@ module Pod
UI
.
titled_section
(
title
,
:verbose_prefix
=>
'-> '
)
do
UI
.
titled_section
(
title
,
:verbose_prefix
=>
'-> '
)
do
target
=
sandbox
.
pod_dir
(
name
)
target
=
sandbox
.
pod_dir
(
name
)
target
.
rmtree
if
target
.
exist?
target
.
rmtree
if
target
.
exist?
downloader
=
Downloader
.
for_target
(
target
,
params
)
downloader
.
download
podspec_finder
=
Sandbox
::
PodspecFinder
.
new
(
target
)
download_result
=
Config
.
instance
.
download_cache
.
download_pod
(
name
,
false
,
params
)
spec
=
podspec_finder
.
podspecs
[
name
]
FileUtils
.
cp_r
(
download_result
.
location
,
target
)
spec
=
download_result
.
spec
raise
Informative
,
"Unable to find a specification for '
#{
name
}
'."
unless
spec
raise
Informative
,
"Unable to find a specification for '
#{
name
}
'."
unless
spec
store_podspec
(
sandbox
,
spec
)
store_podspec
(
sandbox
,
spec
)
sandbox
.
store_pre_downloaded_pod
(
name
)
sandbox
.
store_pre_downloaded_pod
(
name
)
if
downloader
.
options_specific?
sandbox
.
store_checkout_source
(
name
,
download_result
.
checkout_options
)
source
=
params
else
source
=
downloader
.
checkout_options
end
sandbox
.
store_checkout_source
(
name
,
source
)
end
end
end
end
...
...
spec/unit/external_sources/abstract_external_source_spec.rb
View file @
d52828ef
...
@@ -45,9 +45,9 @@ module Pod
...
@@ -45,9 +45,9 @@ module Pod
end
end
it
'checks for JSON podspecs'
do
it
'checks for JSON podspecs'
do
path
=
config
.
sandbox
.
pod_dir
(
'Reachability'
)
path
=
config
.
download_cache
.
send
(
:path_for_pod
,
'Reachability'
,
nil
,
@subject
.
params
)
podspec_path
=
path
+
'Reachability.podspec.json'
podspec_path
=
path
+
'Reachability.podspec.json'
Dir
.
mkdir
(
path
)
path
.
mkpath
File
.
open
(
podspec_path
,
'w'
)
{
|
f
|
f
.
write
'{"name":"Reachability"}'
}
File
.
open
(
podspec_path
,
'w'
)
{
|
f
|
f
.
write
'{"name":"Reachability"}'
}
Pathname
.
any_instance
.
stubs
(
:rmtree
)
Pathname
.
any_instance
.
stubs
(
:rmtree
)
Downloader
::
Git
.
any_instance
.
stubs
(
:download
)
Downloader
::
Git
.
any_instance
.
stubs
(
:download
)
...
...
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