cocoapods-binary-cache 0.1.10 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d362803909e7c1d6490e6e589706882e9b8b3e1a94c58fb496f790f8a8d41a5
4
- data.tar.gz: ed54d6a54246ac70cf8b5a55e11d76b407b8e7f75aeaf1dfa863ecd6e15972c5
3
+ metadata.gz: 0baf85dbe90fee58da87dd415914283de859c15267e14c7562cdc631a52c74f2
4
+ data.tar.gz: ffa3a8be9fe5cc5c55c502e8eb98a9963f04cb0f9076b67ed74af3f7f50d4c2e
5
5
  SHA512:
6
- metadata.gz: 786d8ae14ca79bd43a4d2a0fda5b56f47bf59d8ba6043855609ad14f8ca18bca5ce5c7f40d121106756bf7cf4882f0b8c158f5f73fffc521c88dcf59f2c81d32
7
- data.tar.gz: 7f213efbebb1cf27da7ac2794d154f83abb45ec16ae0b81b8f6a510af8e44101ae1b6b10341ac57c07d7ada16161551a42bd2ebd0e7c8680dff3029739d8cc38
6
+ metadata.gz: 971f985d73911276ff9dd46bc963bc67e9ffaf70f367d9398eb2573c16ef9b6f5a5d031d51bc480b044e6d3d881052a4a9a03a89f7beddc5dc1d08a58c837603
7
+ data.tar.gz: 3d8f0429cb6b06e44b7231b6c484e617ff659d97685b162f4fa44d7101f8378bd5d5500b9812da3fb0e156be190ee7dc6c50b8368aa9ef3e54b68a9f7893021f
@@ -57,6 +57,7 @@ module PodPrebuild
57
57
  args_[:default] += ["DEBUG_INFORMATION_FORMAT=dwarf"] if disable_dsym?
58
58
  args_[:simulator] += ["ARCHS=x86_64", "ONLY_ACTIVE_ARCH=NO"] if simulator == "iphonesimulator"
59
59
  args_[:simulator] += args_[:default]
60
+ args_[:device] += ["ONLY_ACTIVE_ARCH=NO"]
60
61
  args_[:device] += args_[:default]
61
62
  args_
62
63
  end
@@ -14,7 +14,7 @@ module PodPrebuild
14
14
  platform = PLATFORM_OF_SDK[sdk]
15
15
 
16
16
  cmd = ["xcodebuild"]
17
- cmd << "-project" << options[:sandbox].project_path.realdirpath
17
+ cmd << "-project" << options[:sandbox].project_path.realdirpath.shellescape
18
18
  targets.each { |target| cmd << "-target" << target }
19
19
  cmd << "-configuration" << options[:configuration]
20
20
  cmd << "-sdk" << sdk
@@ -29,6 +29,10 @@ module PodPrebuild
29
29
  @cache_repo ||= cache_repo_config["remote"]
30
30
  end
31
31
 
32
+ def local_cache?
33
+ cache_repo.nil?
34
+ end
35
+
32
36
  def cache_path
33
37
  @cache_path ||= File.expand_path(cache_repo_config["local"])
34
38
  end
@@ -2,6 +2,7 @@ module PodPrebuild
2
2
  class CommandExecutor
3
3
  def initialize(options)
4
4
  @config = options[:config]
5
+ prepare_cache_dir
5
6
  end
6
7
 
7
8
  def installer
@@ -11,6 +12,14 @@ module PodPrebuild
11
12
  end
12
13
  end
13
14
 
15
+ def use_local_cache?
16
+ @config.cache_repo.nil?
17
+ end
18
+
19
+ def prepare_cache_dir
20
+ FileUtils.mkdir_p(@config.cache_path) if @config.cache_path
21
+ end
22
+
14
23
  def git(cmd, options = {})
15
24
  comps = ["git"]
16
25
  comps << "-C" << @config.cache_path unless options[:cache_repo] == false
@@ -12,14 +12,28 @@ module PodPrebuild
12
12
 
13
13
  def run
14
14
  Pod::UI.step("Fetching cache") do
15
- fetch_cache(@config.cache_repo, @cache_branch, @config.cache_path)
15
+ if @config.local_cache?
16
+ print_message_for_local_cache(@config.cache_path)
17
+ else
18
+ fetch_remote_cache(@config.cache_repo, @cache_branch, @config.cache_path)
19
+ end
16
20
  unzip_cache
17
21
  end
18
22
  end
19
23
 
20
24
  private
21
25
 
22
- def fetch_cache(repo, branch, dest_dir)
26
+ def print_message_for_local_cache(cache_dir)
27
+ Pod::UI.puts "You're using local cache at: #{cache_dir}.".yellow
28
+ message = <<~HEREDOC
29
+ To enable remote cache (with a git repo), add the `remote` field to the repo config in the `cache_repo` option.
30
+ For more details, check out this doc:
31
+ https://github.com/grab/cocoapods-binary-cache/blob/master/docs/configure_cocoapods_binary_cache.md#cache_repo-
32
+ HEREDOC
33
+ Pod::UI.puts message
34
+ end
35
+
36
+ def fetch_remote_cache(repo, branch, dest_dir)
23
37
  Pod::UI.puts "Fetching cache from #{repo} (branch: #{branch})".green
24
38
  if Dir.exist?(dest_dir + "/.git")
25
39
  git("fetch origin #{branch}")
@@ -11,11 +11,25 @@ module PodPrebuild
11
11
 
12
12
  def run
13
13
  Pod::UI.step("Pushing cache") do
14
- commit_message = "Update prebuilt cache".shellescape
15
- git("add .")
16
- git("commit -m '#{commit_message}'")
17
- git("push origin #{@cache_branch}")
14
+ if @config.local_cache?
15
+ print_message_for_local_cache
16
+ else
17
+ commit_and_push_cache
18
+ end
18
19
  end
19
20
  end
21
+
22
+ private
23
+
24
+ def print_message_for_local_cache
25
+ Pod::UI.puts "Skip pushing cache as you're using local cache".yellow
26
+ end
27
+
28
+ def commit_and_push_cache
29
+ commit_message = "Update prebuilt cache"
30
+ git("add .")
31
+ git("commit -m '#{commit_message}'")
32
+ git("push origin #{@cache_branch}")
33
+ end
20
34
  end
21
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-binary-cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bang Nguyen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-03 00:00:00.000000000 Z
11
+ date: 2020-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods