Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[Integration] Use aggressive cache

  • Loading branch information...
commit f1464416f5d2b52dd63842b5444990924c38b6b4 1 parent 3ea0215
@fabiopelosin fabiopelosin authored
View
13 lib/cocoapods/config.rb
@@ -66,11 +66,20 @@ class Config
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
#--------------------------------------#
View
2  spec/integration/install_add_pod/after/execution_output.txt
@@ -1,4 +1,4 @@
-$ 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
View
7 spec/integration/install_custom_workspace/after/execution_output.txt
@@ -1,4 +1,4 @@
-$ 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'
View
2  spec/integration/install_external_source/after/execution_output.txt
@@ -1,4 +1,4 @@
-$ 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
View
2  spec/integration/install_local_source/after/execution_output.txt
@@ -1,4 +1,4 @@
-$ 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
View
7 spec/integration/install_multiple_targets/after/execution_output.txt
@@ -1,4 +1,4 @@
-$ 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'
View
7 spec/integration/install_new/after/execution_output.txt
@@ -1,4 +1,4 @@
-$ 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'
View
7 spec/integration/install_podfile_callbacks/after/execution_output.txt
@@ -1,4 +1,4 @@
-$ 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'
View
7 spec/integration/install_podspec/after/execution_output.txt
@@ -1,4 +1,4 @@
-$ 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'
View
2  spec/integration/install_remove_pod/after/execution_output.txt
@@ -1,4 +1,4 @@
-$ 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
View
7 spec/integration/install_spec_callbacks/after/execution_output.txt
@@ -1,4 +1,4 @@
-$ 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'
View
2  spec/integration/install_subspecs/after/execution_output.txt
@@ -1,4 +1,4 @@
-$ 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
View
2  spec/integration/spec_lint/after/execution_output.txt
@@ -1,4 +1,4 @@
-$ 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.
View
7 spec/integration/update/after/execution_output.txt
@@ -1,4 +1,4 @@
-$ 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'
View
2  spec/integration_2.rb
@@ -88,7 +88,7 @@ def copy_files(folder)
# 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
View
7 spec/unit/config_spec.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.