Commit a59bd1b8 authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #3622 from CocoaPods/seg-cache-version

[Cache] Remove cache when CocoaPods version changes
parents 9ab00867 7595d668
......@@ -6,13 +6,21 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
## Master
### Bug Fixes
##### Enhancements
* The download cache will automatically be reset when changing CocoaPods
versions.
[Samuel Giddins](https://github.com/segiddins)
[#3542](https://github.com/CocoaPods/CocoaPods/issues/3542)
##### Bug Fixes
* Public headers of vendored frameworks are now automatically linked in
the sandbox. That allows transitive inclusion of headers from other pods.
[Vincent Isambart](https://github.com/vincentisambart)
[#3161](https://github.com/CocoaPods/CocoaPods/issues/3161)
## 0.37.2
##### Enhancements
......
......@@ -19,7 +19,7 @@ module Pod
#
def initialize(root)
@root = Pathname(root)
@root.mkpath
ensure_matching_version
end
# Downloads the Pod from the given `request`
......@@ -40,6 +40,21 @@ module Pod
private
# Ensures the cache on disk was created with the same CocoaPods version as
# is currently running.
#
# @return [Void]
#
def ensure_matching_version
version_file = root + 'VERSION'
version = version_file.read.strip if version_file.file?
root.rmtree if version != Pod::VERSION && root.exist?
root.mkpath
version_file.open('w') { |f| f << Pod::VERSION }
end
# @param [Request] request
# the request to be downloaded.
#
......
......@@ -30,6 +30,15 @@ module Pod
@cache.root.should.be.directory?
end
it 'implodes when the cache is from a different CocoaPods version' do
root = Pathname(Dir.mktmpdir)
root.+('VERSION').open('w') { |f| f << '0.0.0' }
root.+('FILE').open('w') { |f| f << '0.0.0' }
@cache = Downloader::Cache.new(root)
root.+('VERSION').read.should == Pod::VERSION
root.+('FILE').should.not.exist?
end
it 'groups subspecs by platform' do
@spec = Specification.new do |s|
s.ios.deployment_target = '6.0'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment