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
310610b6
Commit
310610b6
authored
Apr 29, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Cache] Keep files needed by subspecs that have a higher minimum deployment target than root spec
parent
48f6579a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
4 deletions
+39
-4
CHANGELOG.md
CHANGELOG.md
+10
-0
cache.rb
lib/cocoapods/downloader/cache.rb
+12
-4
cache_spec.rb
spec/unit/downloader/cache_spec.rb
+17
-0
No files found.
CHANGELOG.md
View file @
310610b6
...
@@ -4,6 +4,16 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
...
@@ -4,6 +4,16 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
To install release candidates run
`[sudo] gem install cocoapods --pre`
To install release candidates run
`[sudo] gem install cocoapods --pre`
## Master
##### Bug Fixes
*
Handle caching specs that have subspecs with higher minimum deployment targets
without deleting needed source files.
[
Samuel Giddins
](
https://github.com/segiddins
)
[
#3471
](
https://github.com/CocoaPods/CocoaPods/issues/3471
)
## 0.37.0.rc.1
## 0.37.0.rc.1
[
Core
](
https://github.com/CocoaPods/Core/compare/0.37.0.beta.1...0.37.0.rc.1
)
[
Core
](
https://github.com/CocoaPods/Core/compare/0.37.0.beta.1...0.37.0.rc.1
)
...
...
lib/cocoapods/downloader/cache.rb
View file @
310610b6
...
@@ -182,16 +182,24 @@ module Pod
...
@@ -182,16 +182,24 @@ module Pod
# @return [Void]
# @return [Void]
#
#
def
copy_and_clean
(
source
,
destination
,
spec
)
def
copy_and_clean
(
source
,
destination
,
spec
)
specs_by_platform
=
{}
specs_by_platform
=
group_subspecs_by_platform
(
spec
)
spec
.
available_platforms
.
each
do
|
platform
|
specs_by_platform
[
platform
]
=
[
spec
,
*
spec
.
recursive_subspecs
].
select
{
|
ss
|
ss
.
supported_on_platform?
(
platform
)
}
end
destination
.
parent
.
mkpath
destination
.
parent
.
mkpath
FileUtils
.
cp_r
(
source
,
destination
)
FileUtils
.
cp_r
(
source
,
destination
)
Pod
::
Installer
::
PodSourcePreparer
.
new
(
spec
,
destination
).
prepare!
Pod
::
Installer
::
PodSourcePreparer
.
new
(
spec
,
destination
).
prepare!
Sandbox
::
PodDirCleaner
.
new
(
destination
,
specs_by_platform
).
clean!
Sandbox
::
PodDirCleaner
.
new
(
destination
,
specs_by_platform
).
clean!
end
end
def
group_subspecs_by_platform
(
spec
)
specs_by_platform
=
{}
[
spec
,
*
spec
.
recursive_subspecs
].
each
do
|
ss
|
ss
.
available_platforms
.
each
do
|
platform
|
specs_by_platform
[
platform
]
||=
[]
specs_by_platform
[
platform
]
<<
ss
end
end
specs_by_platform
end
# Writes the given `spec` to the given `path`.
# Writes the given `spec` to the given `path`.
#
#
# @param [Specification] spec
# @param [Specification] spec
...
...
spec/unit/downloader/cache_spec.rb
View file @
310610b6
...
@@ -24,6 +24,23 @@ module Pod
...
@@ -24,6 +24,23 @@ module Pod
@cache
.
root
.
should
.
be
.
directory?
@cache
.
root
.
should
.
be
.
directory?
end
end
it
'groups subspecs by platform'
do
@spec
=
Specification
.
new
do
|
s
|
s
.
ios
.
deployment_target
=
'6.0'
s
.
osx
.
deployment_target
=
'10.7'
s
.
subspec
'subspec'
do
|
ss
|
ss
.
ios
.
deployment_target
=
'8.0'
end
end
@cache
.
send
(
:group_subspecs_by_platform
,
@spec
).
should
==
{
Platform
.
new
(
:ios
,
'8.0'
)
=>
[
@spec
.
subspecs
.
first
],
Platform
.
new
(
:ios
,
'6.0'
)
=>
[
@spec
],
Platform
.
new
(
:osx
,
'10.7'
)
=>
[
@spec
],
}
end
describe
'when the download is not cached'
do
describe
'when the download is not cached'
do
describe
'when downloading a released pod'
do
describe
'when downloading a released pod'
do
it
'downloads the source'
do
it
'downloads the source'
do
...
...
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