Commit f1464416 authored by Fabio Pelosin's avatar Fabio Pelosin

[Integration] Use aggressive cache

parent 3ea02153
......@@ -66,11 +66,20 @@ module Pod
attr_accessor :skip_repo_update
alias_method :skip_repo_update?, :skip_repo_update
# Allows to set whether the downloader should use more aggressive caching
# options.
#
# @note The aggressive cache has lead to issues if a tag is updated to
# point to another commit.
#
attr_writer :aggressive_cache
# @return [Bool] Whether the downloader should use more aggressive caching
# options.
#
attr_accessor :aggressive_cache
alias_method :aggressive_cache?, :aggressive_cache
def aggressive_cache?
@aggressive_cache || (ENV['CP_AGGRESSIVE_CACHE'] != 'FALSE')
end
#--------------------------------------#
......
$ pod install --no-repo-update --no-doc --verbose --no-color 2>&1
CP_AGGRESSIVE_CACHE=TRUE $ pod install --no-repo-update --verbose --no-color 2>&1
Analyzing dependencies
Finding Podfile changes
......
$ pod install --no-repo-update --no-doc --verbose --no-color 2>&1
CP_AGGRESSIVE_CACHE=TRUE $ pod install --no-repo-update --verbose --no-color 2>&1
Analyzing dependencies
Resolving dependencies of `Podfile`
......@@ -19,9 +19,8 @@ Downloading dependencies
true
$ /usr/bin/git config core.bare
true
> Updating cache git repo (CACHES_DIR/GitHub/48f11286750afa2e2eb80564e288f42eed7cbab6)
$ /usr/bin/git remote update
Fetching origin
$ /usr/bin/git rev-list --max-count=1 v3.1.0
f7176f4798d068d233dca5223ae4bd9c8059e830
$ /usr/bin/git init
Initialized empty Git repository in ROOT/tmp/install_custom_workspace/Pods/Reachability/.git/
$ /usr/bin/git remote add origin 'CACHES_DIR/GitHub/48f11286750afa2e2eb80564e288f42eed7cbab6'
......
$ pod install --no-repo-update --no-doc --verbose --no-color 2>&1
CP_AGGRESSIVE_CACHE=TRUE $ pod install --no-repo-update --verbose --no-color 2>&1
Analyzing dependencies
Fetching external sources
......
$ pod install --no-repo-update --no-doc --verbose --no-color 2>&1
CP_AGGRESSIVE_CACHE=TRUE $ pod install --no-repo-update --verbose --no-color 2>&1
Analyzing dependencies
Fetching external sources
......
$ pod install --no-repo-update --no-doc --verbose --no-color 2>&1
CP_AGGRESSIVE_CACHE=TRUE $ pod install --no-repo-update --verbose --no-color 2>&1
Analyzing dependencies
Resolving dependencies of `Podfile`
......@@ -37,9 +37,8 @@ Downloading dependencies
true
$ /usr/bin/git config core.bare
true
> Updating cache git repo (CACHES_DIR/GitHub/48f11286750afa2e2eb80564e288f42eed7cbab6)
$ /usr/bin/git remote update
Fetching origin
$ /usr/bin/git rev-list --max-count=1 v3.1.0
f7176f4798d068d233dca5223ae4bd9c8059e830
$ /usr/bin/git init
Initialized empty Git repository in ROOT/tmp/install_multiple_targets/Pods/Reachability/.git/
$ /usr/bin/git remote add origin 'CACHES_DIR/GitHub/48f11286750afa2e2eb80564e288f42eed7cbab6'
......
$ pod install --no-repo-update --no-doc --verbose --no-color 2>&1
CP_AGGRESSIVE_CACHE=TRUE $ pod install --no-repo-update --verbose --no-color 2>&1
Analyzing dependencies
Resolving dependencies of `Podfile`
......@@ -16,9 +16,8 @@ Downloading dependencies
true
$ /usr/bin/git config core.bare
true
> Updating cache git repo (CACHES_DIR/GitHub/48f11286750afa2e2eb80564e288f42eed7cbab6)
$ /usr/bin/git remote update
Fetching origin
$ /usr/bin/git rev-list --max-count=1 v3.1.0
f7176f4798d068d233dca5223ae4bd9c8059e830
$ /usr/bin/git init
Initialized empty Git repository in ROOT/tmp/install_new/Pods/Reachability/.git/
$ /usr/bin/git remote add origin 'CACHES_DIR/GitHub/48f11286750afa2e2eb80564e288f42eed7cbab6'
......
$ pod install --no-repo-update --no-doc --verbose --no-color 2>&1
CP_AGGRESSIVE_CACHE=TRUE $ pod install --no-repo-update --verbose --no-color 2>&1
Analyzing dependencies
Resolving dependencies of `Podfile`
......@@ -16,9 +16,8 @@ Downloading dependencies
true
$ /usr/bin/git config core.bare
true
> Updating cache git repo (CACHES_DIR/GitHub/48f11286750afa2e2eb80564e288f42eed7cbab6)
$ /usr/bin/git remote update
Fetching origin
$ /usr/bin/git rev-list --max-count=1 v3.1.0
f7176f4798d068d233dca5223ae4bd9c8059e830
$ /usr/bin/git init
Initialized empty Git repository in ROOT/tmp/install_podfile_callbacks/Pods/Reachability/.git/
$ /usr/bin/git remote add origin 'CACHES_DIR/GitHub/48f11286750afa2e2eb80564e288f42eed7cbab6'
......
$ pod install --no-repo-update --no-doc --verbose --no-color 2>&1
CP_AGGRESSIVE_CACHE=TRUE $ pod install --no-repo-update --verbose --no-color 2>&1
Analyzing dependencies
Fetching external sources
......@@ -19,9 +19,8 @@ Downloading dependencies
true
$ /usr/bin/git config core.bare
true
> Updating cache git repo (CACHES_DIR/GitHub/48f11286750afa2e2eb80564e288f42eed7cbab6)
$ /usr/bin/git remote update
Fetching origin
$ /usr/bin/git rev-list --max-count=1 v3.1.0
f7176f4798d068d233dca5223ae4bd9c8059e830
$ /usr/bin/git init
Initialized empty Git repository in ROOT/tmp/install_podspec/Pods/Reachability/.git/
$ /usr/bin/git remote add origin 'CACHES_DIR/GitHub/48f11286750afa2e2eb80564e288f42eed7cbab6'
......
$ pod install --no-repo-update --no-doc --verbose --no-color 2>&1
CP_AGGRESSIVE_CACHE=TRUE $ pod install --no-repo-update --verbose --no-color 2>&1
Analyzing dependencies
Finding Podfile changes
......
$ pod install --no-repo-update --no-doc --verbose --no-color 2>&1
CP_AGGRESSIVE_CACHE=TRUE $ pod install --no-repo-update --verbose --no-color 2>&1
Analyzing dependencies
Fetching external sources
......@@ -19,9 +19,8 @@ Downloading dependencies
true
$ /usr/bin/git config core.bare
true
> Updating cache git repo (CACHES_DIR/GitHub/48f11286750afa2e2eb80564e288f42eed7cbab6)
$ /usr/bin/git remote update
Fetching origin
$ /usr/bin/git rev-list --max-count=1 v3.1.0
f7176f4798d068d233dca5223ae4bd9c8059e830
$ /usr/bin/git init
Initialized empty Git repository in ROOT/tmp/install_spec_callbacks/Pods/Reachability/.git/
$ /usr/bin/git remote add origin 'CACHES_DIR/GitHub/48f11286750afa2e2eb80564e288f42eed7cbab6'
......
$ pod install --no-repo-update --no-doc --verbose --no-color 2>&1
CP_AGGRESSIVE_CACHE=TRUE $ pod install --no-repo-update --verbose --no-color 2>&1
Analyzing dependencies
Fetching external sources
......
$ pod spec lint --quick --verbose --no-color 2>&1
CP_AGGRESSIVE_CACHE=TRUE $ pod spec lint --quick --verbose --no-color 2>&1
-> Reachability -> Reachability (3.1.0)
Analyzed 1 podspec.
......
$ pod update --no-repo-update --no-doc --verbose --no-color 2>&1
CP_AGGRESSIVE_CACHE=TRUE $ pod update --no-repo-update --verbose --no-color 2>&1
Analyzing dependencies
Finding Podfile changes
......@@ -19,9 +19,8 @@ Downloading dependencies
true
$ /usr/bin/git config core.bare
true
> Updating cache git repo (CACHES_DIR/GitHub/48f11286750afa2e2eb80564e288f42eed7cbab6)
$ /usr/bin/git remote update
Fetching origin
$ /usr/bin/git rev-list --max-count=1 v3.1.0
f7176f4798d068d233dca5223ae4bd9c8059e830
$ /usr/bin/git init
Initialized empty Git repository in ROOT/tmp/update/Pods/Reachability/.git/
$ /usr/bin/git remote add origin 'CACHES_DIR/GitHub/48f11286750afa2e2eb80564e288f42eed7cbab6'
......
......@@ -88,7 +88,7 @@ end
# environment.
#
def launch_binary(arguments, folder)
command = "#{POD_BINARY} #{arguments} --verbose --no-color 2>&1"
command = "CP_AGGRESSIVE_CACHE=TRUE #{POD_BINARY} #{arguments} --verbose --no-color 2>&1"
Dir.chdir(TMP_DIR + folder) do
output = `#{command}`
it "$ pod #{arguments}" do
......
......@@ -21,6 +21,13 @@ module Pod
config.repos_dir.should == Pathname.new("~/.cocoapods").expand_path
end
it "allows to specify whether the aggressive cache should be used with an environment variable" do
config.aggressive_cache = false
ENV['CP_AGGRESSIVE_CACHE'] = 'TRUE'
config.aggressive_cache?.should.be.true
ENV.delete('CP_AGGRESSIVE_CACHE')
end
it "allows to specify the repos dir with an environment variable" do
ENV['CP_REPOS_DIR'] = '~/custom_repos_dir'
config.repos_dir.should == Pathname.new("~/custom_repos_dir").expand_path
......
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