cocoapods-binary-cache 0.1.7 → 0.1.8

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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cocoapods-binary-cache/cache/validation_result.rb +4 -0
  3. data/lib/cocoapods-binary-cache/dependencies_graph/dependencies_graph.rb +20 -25
  4. data/lib/cocoapods-binary-cache/dependencies_graph/graph_visualizer.rb +29 -38
  5. data/lib/cocoapods-binary-cache/diagnosis/diagnosis.rb +9 -1
  6. data/lib/cocoapods-binary-cache/diagnosis/integration.rb +3 -1
  7. data/lib/cocoapods-binary-cache/helper/podspec.rb +5 -2
  8. data/lib/cocoapods-binary-cache/helper/prebuild_order.rb +12 -0
  9. data/lib/cocoapods-binary-cache/hooks/post_install.rb +4 -3
  10. data/lib/cocoapods-binary-cache/hooks/pre_install.rb +7 -34
  11. data/lib/cocoapods-binary-cache/pod-binary/helper/build.rb +1 -0
  12. data/lib/cocoapods-binary-cache/pod-binary/helper/detected_prebuilt_pods/installer.rb +1 -1
  13. data/lib/cocoapods-binary-cache/pod-binary/helper/prebuild_sandbox.rb +14 -13
  14. data/lib/cocoapods-binary-cache/pod-binary/helper/target_checker.rb +7 -10
  15. data/lib/cocoapods-binary-cache/pod-binary/integration.rb +1 -2
  16. data/lib/cocoapods-binary-cache/pod-binary/integration/patch/embed_framework_script.rb +1 -1
  17. data/lib/cocoapods-binary-cache/pod-binary/integration/patch/resolve_dependencies.rb +0 -3
  18. data/lib/cocoapods-binary-cache/pod-binary/integration/patch/sandbox_analyzer_state.rb +29 -0
  19. data/lib/cocoapods-binary-cache/pod-binary/integration/patch/source_installation.rb +2 -2
  20. data/lib/cocoapods-binary-cache/pod-binary/prebuild.rb +16 -93
  21. data/lib/cocoapods-binary-cache/pod-binary/prebuild_dsl.rb +0 -2
  22. data/lib/cocoapods-binary-cache/pod-binary/prebuild_hook.rb +0 -1
  23. data/lib/cocoapods-binary-cache/pod-rome/xcodebuild_command.rb +64 -48
  24. data/lib/cocoapods-binary-cache/pod-rome/xcodebuild_raw.rb +3 -3
  25. data/lib/cocoapods-binary-cache/prebuild_output/output.rb +6 -4
  26. data/lib/cocoapods-binary-cache/scheme_editor.rb +16 -15
  27. data/lib/cocoapods-binary-cache/state_store.rb +16 -6
  28. data/lib/command/config.rb +25 -3
  29. data/lib/command/executor/base.rb +7 -0
  30. data/lib/command/executor/prebuilder.rb +1 -1
  31. data/lib/command/executor/visualizer.rb +3 -2
  32. metadata +4 -6
  33. data/lib/cocoapods-binary-cache/pod-binary/helper/feature_switches.rb +0 -52
  34. data/lib/cocoapods-binary-cache/pod-binary/helper/passer.rb +0 -25
  35. data/lib/cocoapods-binary-cache/pod-binary/integration/remove_target_files.rb +0 -29
  36. data/lib/cocoapods-binary-cache/pod-binary/tool/tool.rb +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e068bdcb9e91a8e599e3ad1732837a1a7dbd49a4409e05b97b1cdc476bfb76a7
4
- data.tar.gz: 21d3e3fa0374a8818efa927bb822ce9386e43e18ec26a1ab5be7d8b481a688d6
3
+ metadata.gz: 939a85addd611d4a4bcd2b9ce1eeb7e036d58a937a14bdd4f772a6c8170e4394
4
+ data.tar.gz: 0372d8f94f6e486259669f4db5431585a08645c1a23ad363258581fc5f679eff
5
5
  SHA512:
6
- metadata.gz: f5588698b1d818071b2bfb568bcbd44bc1e02084f7caf0b4b554a50277f2064209ec527339de4c8166ab74ff358b0a173f149b5db67f33a808c8d562f8d02625
7
- data.tar.gz: dd21d19ff94f2a8dcf3b4b1dd7372484993e0aba4705512fde75be14e66d72ddadc592fc88b9ea81ae3983f156e5fe251e4dbcfe8047f7904db1b0fd3cf0cbcf
6
+ metadata.gz: aa2bbc570dc6a1f462a85286578b8dc41a7ce189df2017177d083a70df9ac0d026c8ca8dea310eee2ae5b517b3418004045b8bcc782aa0440f755d8bab1dd0d4
7
+ data.tar.gz: c98e55ae66d034897db4969bf9c12b0386a69a5139bc78ada10298875c5a9487d499852bb77195ffca42f11b0d2ab97fad940348da90d21296f6f0d6952b64af
@@ -7,6 +7,10 @@ module PodPrebuild
7
7
  @hit = hit.to_set - missed_with_reasons.keys
8
8
  end
9
9
 
10
+ def all
11
+ (hit + missed).to_set
12
+ end
13
+
10
14
  def missed
11
15
  @missed_with_reasons.keys.to_set
12
16
  end
@@ -1,56 +1,50 @@
1
1
  # Copyright 2019 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved.
2
2
  # Use of this source code is governed by an MIT-style license that can be found in the LICENSE file
3
3
 
4
- require 'rgl/adjacency'
5
- require 'rgl/dot'
6
- require_relative 'graph_visualizer'
4
+ require "rgl/adjacency"
5
+ require "rgl/dot"
6
+ require_relative "graph_visualizer"
7
7
 
8
- # Using RGL graph because GraphViz doesn't store adjacent of a node/vertex but we need to traverse a substree from any node
8
+ # Using RGL graph because GraphViz doesn't store adjacent of a node/vertex
9
+ # but we need to traverse a substree from any node
9
10
  # https://github.com/monora/rgl/blob/master/lib/rgl/adjacency.rb
10
11
 
11
12
  class DependenciesGraph
12
13
  def initialize(lockfile)
13
14
  @lockfile = lockfile
14
- @invert_edge = true # A normal edge is an edge (one direction) from library A to library B which is a dependency of A.
15
+ # A normal edge is an edge (one direction) from library A to library B which is a dependency of A.
16
+ @invert_edge = true
15
17
  end
16
18
 
17
19
  # Input : a list of library names.
18
20
  # Output: a set of library names which are clients (directly and indirectly) of those input libraries.
19
21
  def get_clients(libnames)
20
- result = Set.new()
22
+ result = Set.new
21
23
  libnames.each do |lib|
22
24
  if graph.has_vertex?(lib)
23
25
  result.merge(traverse_sub_tree(graph, lib))
24
26
  else
25
- puts "Warning: cannot find lib: #{lib}"
27
+ Pod::UI.puts "Warning: cannot find lib: #{lib}"
26
28
  end
27
29
  end
28
30
  result
29
31
  end
30
32
 
31
- def write_graphic_file(output_graphic_fmt, filename='graph', highlight_nodes=Set[])
32
- if !output_graphic_fmt
33
- puts 'Error: Need graphic format.'
34
- return
35
- end
36
- graph.write_to_graphic_file(output_graphic_fmt, dotfile=filename, options={}, highlight_nodes)
33
+ def write_graphic_file(options)
34
+ graph.write_to_graphic_file(options)
37
35
  end
38
36
 
39
37
  private
40
38
 
41
39
  def dependencies
42
- @dependencies ||= begin
43
- if @lockfile
44
- @lockfile.to_hash['PODS']
45
- else
46
- nil
47
- end
48
- end
40
+ @dependencies ||= (@lockfile && @lockfile.to_hash["PODS"])
49
41
  end
50
42
 
51
43
  # Convert array of dictionaries -> a dictionary with format {A: [A's dependencies]}
52
44
  def pod_to_dependencies
53
- dependencies.map { |d| d.is_a?(Hash) ? d : { d => [] } }.reduce({}) { |combined, individual| combined.merge!(individual) }
45
+ dependencies
46
+ .map { |d| d.is_a?(Hash) ? d : { d => [] } }
47
+ .reduce({}) { |combined, individual| combined.merge!(individual) }
54
48
  end
55
49
 
56
50
  def add_vertex(graph, pod)
@@ -65,14 +59,15 @@ class DependenciesGraph
65
59
 
66
60
  def graph
67
61
  @graph ||= begin
68
- graph = RGL::DirectedAdjacencyGraph.new()
69
-
62
+ graph = RGL::DirectedAdjacencyGraph.new
70
63
  pod_to_dependencies.each do |pod, dependencies|
71
64
  pod_node = add_vertex(graph, pod)
72
65
  next if pod_node.nil?
66
+
73
67
  dependencies.each do |dependency|
74
68
  dep_node = add_vertex(graph, dependency)
75
69
  next if dep_node.nil?
70
+
76
71
  if @invert_edge
77
72
  graph.add_edge(dep_node, pod_node)
78
73
  else
@@ -85,11 +80,11 @@ class DependenciesGraph
85
80
  end
86
81
 
87
82
  def traverse_sub_tree(graph, vertex)
88
- visited_nodes = Set.new()
83
+ visited_nodes = Set.new
89
84
  graph.each_adjacent(vertex) do |v|
90
85
  visited_nodes.add(v)
91
86
  visited_nodes.merge(traverse_sub_tree(graph, v))
92
87
  end
93
88
  visited_nodes
94
89
  end
95
- end
90
+ end
@@ -2,73 +2,64 @@
2
2
  # Use of this source code is governed by an MIT-style license that can be found in the LICENSE file
3
3
  # https://github.com/monora/rgl/blob/0b526e16f9fb344abf387f4c5523d7917ce8f4b1/lib/rgl/dot.rb
4
4
 
5
- require 'rgl/rdot'
5
+ require "rgl/rdot"
6
6
 
7
7
  module RGL
8
8
  module Graph
9
- def to_dot_graph(params={}, highlight_nodes)
10
- params['name'] ||= self.class.name.gsub(/:/, '_')
11
- fontsize = params['fontsize'] ? params['fontsize'] : '12'
12
- graph = (directed? ? DOT::Digraph : DOT::Graph).new(params)
13
- edge_class = directed? ? DOT::DirectedEdge : DOT::Edge
14
- vertex_options = params['vertex'] || {}
15
- edge_options = params['edge'] || {}
9
+ def to_dot_graph(options)
10
+ highlight_nodes = options[:highlight_nodes] || Set.new
11
+ options["name"] ||= self.class.name.gsub(/:/, "_")
12
+ fontsize = options["fontsize"] || "12"
13
+ graph = (directed? ? DOT::Digraph : DOT::Graph).new(options)
14
+ edge_class = directed? ? DOT::DirectedEdge : DOT::Edge
15
+ vertex_options = options["vertex"] || {}
16
+ edge_options = options["edge"] || {}
16
17
 
17
18
  each_vertex do |v|
18
- default_vertex_options = {
19
- 'name' => vertex_id(v),
20
- 'fontsize' => fontsize,
21
- 'label' => vertex_label(v),
22
- 'style' => 'filled',
19
+ default_vertex_options = {
20
+ "name" => vertex_id(v),
21
+ "fontsize" => fontsize,
22
+ "label" => vertex_label(v),
23
+ "style" => "filled"
23
24
  }
24
- if highlight_nodes.include?(v)
25
- default_vertex_options = default_vertex_options.merge({
26
- 'color' => 'red',
27
- 'fillcolor' => 'red'
28
- })
29
- else
30
- default_vertex_options = default_vertex_options.merge({
31
- 'color' => 'blue',
32
- 'fillcolor' => 'blue'
33
- })
34
- end
35
-
25
+ default_vertex_options.merge!("color" => "red", "fillcolor" => "red") if highlight_nodes.include?(v)
36
26
  each_vertex_options = default_vertex_options.merge(vertex_options)
37
- vertex_options.each{|option, val| each_vertex_options[option] = val.call(v) if val.is_a?(Proc)}
27
+ vertex_options.each { |option, val| each_vertex_options[option] = val.call(v) if val.is_a?(Proc) }
38
28
  graph << DOT::Node.new(each_vertex_options)
39
29
  end
40
30
 
41
31
  each_edge do |u, v|
42
32
  default_edge_options = {
43
- 'from' => vertex_id(u),
44
- 'to' => vertex_id(v),
45
- 'fontsize' => fontsize
33
+ "from" => vertex_id(u),
34
+ "to" => vertex_id(v),
35
+ "fontsize" => fontsize
46
36
  }
47
37
  each_edge_options = default_edge_options.merge(edge_options)
48
- edge_options.each{|option, val| each_edge_options[option] = val.call(u, v) if val.is_a?(Proc)}
38
+ edge_options.each { |option, val| each_edge_options[option] = val.call(u, v) if val.is_a?(Proc) }
49
39
  graph << edge_class.new(each_edge_options)
50
40
  end
51
41
 
52
42
  graph
53
43
  end
54
44
 
55
- def write_to_graphic_file(fmt='png', dotfile="graph", options={}, highlight_nodes)
56
- src = dotfile + ".dot"
57
- dot = dotfile + "." + fmt
45
+ def write_to_graphic_file(options)
46
+ output_path = Pathname.new(options[:output_path])
47
+ fmt = output_path.extname.delete_prefix(".")
48
+ dotfile = output_path.sub_ext(".dot")
58
49
 
59
- File.open(src, 'w') do |f|
60
- f << self.to_dot_graph(params=options, highlight_nodes=highlight_nodes).to_s << "\n"
50
+ File.open(dotfile, "w") do |f|
51
+ f << to_dot_graph(options).to_s
61
52
  end
62
53
 
63
- unless system("dot -T#{fmt} #{src} -o #{dot}")
64
- message = <<-HEREDOC # Use <<- to indent End of String terminator
54
+ unless system("dot -T#{fmt} #{dotfile} -o #{output_path}")
55
+ message = <<~HEREDOC
65
56
  Error executing dot. Did you install GraphViz?
66
57
  Try installing it via Homebrew: `brew install graphviz`.
67
58
  Visit https://graphviz.org/download/ for more installation instructions.
68
59
  HEREDOC
69
60
  raise message
70
61
  end
71
- dot
62
+ output_path
72
63
  end
73
64
  end
74
65
  end
@@ -10,7 +10,15 @@ module PodPrebuild
10
10
  end
11
11
 
12
12
  def run
13
- @diagnosers.each(&:run)
13
+ diagnosis = @diagnosers.map(&:run)
14
+ errors = diagnosis.select { |d| d[0] == :error }.map { |d| d[1] }
15
+ warnings = diagnosis.select { |d| d[0] == :error }.map { |d| d[1] }
16
+
17
+ warnings.each { |d| Pod::UI.puts "⚠️ #{d[1]}" }
18
+ errors.each { |d| Pod::UI.puts "🚩 #{d[1]}" }
19
+ return if errors.empty? || !PodPrebuild.config.strict_diagnosis?
20
+
21
+ raise "There are #{errors.count} error(s) spotted after the diagnosis"
14
22
  end
15
23
  end
16
24
  end
@@ -15,7 +15,9 @@ module PodPrebuild
15
15
  PodPrebuild.config.prebuilt_path(path: "#{module_name}.framework")
16
16
  framework_path.exist?
17
17
  end
18
- Pod::UI.puts "🚩 Unintegrated frameworks: #{unintegrated}".yellow unless unintegrated.empty?
18
+ return [] if unintegrated.empty?
19
+
20
+ [[:error, "Unintegrated frameworks: #{unintegrated}"]]
19
21
  end
20
22
  end
21
23
  end
@@ -1,8 +1,11 @@
1
1
  module Pod
2
2
  class Specification
3
- # TODO: this detect objc lib as empty source, eg. Realm
4
3
  def empty_source_files?
5
- return subspecs.all?(&:empty_source_files?) unless subspecs.empty?
4
+
5
+ unless subspecs.empty?
6
+ # return early if there are some files in subpec(s) but process the spec itself
7
+ return false unless subspecs.all?(&:empty_source_files?)
8
+ end
6
9
 
7
10
  check = lambda do |patterns|
8
11
  patterns = [patterns] if patterns.is_a?(String)
@@ -0,0 +1,12 @@
1
+ module PodPrebuild
2
+ module BuildOrder
3
+ def self.order_targets(targets)
4
+ # It's more efficient to build frameworks that have more dependencies first
5
+ # so that the build parallelism is ultilized
6
+ # >> --- MyFramework ----------------------------------|
7
+ # >> --- ADependency ---|
8
+ # >> --- AnotherADependency ---|
9
+ targets.sort_by { |t| -t.recursive_dependent_targets.count }
10
+ end
11
+ end
12
+ end
@@ -12,9 +12,9 @@ module PodPrebuild
12
12
  private
13
13
 
14
14
  def diagnose
15
- Pod::UI.section("Diagnosing cocoapods-binary-cache") do
15
+ Pod::UI.title("Diagnosing cocoapods-binary-cache") do
16
16
  PodPrebuild::Diagnosis.new(
17
- cache_validation: PodPrebuild::StateStore.cache_validation,
17
+ cache_validation: PodPrebuild.state.cache_validation,
18
18
  standard_sandbox: @installer_context.sandbox,
19
19
  specs: @installer_context.umbrella_targets.map(&:specs).flatten
20
20
  ).run
@@ -22,7 +22,8 @@ module PodPrebuild
22
22
  end
23
23
 
24
24
  def edit_scheme_for_code_coverage
25
- return unless PodPrebuild.config.dev_pods_enabled? && @installer_context.sandbox.instance_of?(Pod::PrebuildSandbox)
25
+ return unless PodPrebuild.config.dev_pods_enabled?
26
+ return unless @installer_context.sandbox.instance_of?(Pod::PrebuildSandbox)
26
27
 
27
28
  # Modify pods scheme to support code coverage
28
29
  # If we don't prebuild dev pod -> no need to care about this in Pod project
@@ -15,17 +15,13 @@ module PodPrebuild
15
15
  def run
16
16
  return if @installer_context.sandbox.is_a?(Pod::PrebuildSandbox)
17
17
 
18
- require_relative "../pod-binary/helper/feature_switches"
19
-
20
18
  log_section "🚀 Prebuild frameworks"
21
19
  ensure_valid_podfile
22
20
  save_installation_states
23
- Pod::UI.section("Prepare environment") { prepare_environment }
24
21
  create_prebuild_sandbox
25
- Pod::UI.section("Detect implicit dependencies") { detect_implicit_dependencies }
26
- Pod::UI.section("Validate prebuilt cache") { validate_cache }
22
+ Pod::UI.title("Detect implicit dependencies") { detect_implicit_dependencies }
23
+ Pod::UI.title("Validate prebuilt cache") { validate_cache }
27
24
  prebuild! if PodPrebuild.config.prebuild_job?
28
- Pod::UI.section("Reset environment") { reset_environment }
29
25
 
30
26
  PodPrebuild::Env.next_stage!
31
27
  log_section "🤖 Resume pod installation"
@@ -36,7 +32,6 @@ module PodPrebuild
36
32
 
37
33
  def save_installation_states
38
34
  save_pod_install_options
39
- save_states_from_dsl
40
35
  end
41
36
 
42
37
  def save_pod_install_options
@@ -55,26 +50,6 @@ module PodPrebuild
55
50
  end
56
51
  end
57
52
 
58
- def prepare_environment
59
- Pod::Installer.force_disable_integration true # don't integrate targets
60
- Pod::Config.force_disable_write_lockfile true # disbale write lock file for perbuild podfile
61
- Pod::Installer.disable_install_complete_message true # disable install complete message
62
- end
63
-
64
- def reset_environment
65
- Pod::Installer.force_disable_integration false
66
- Pod::Config.force_disable_write_lockfile false
67
- Pod::Installer.disable_install_complete_message false
68
- Pod::UserInterface.warnings = [] # clean the warning in the prebuild step, it's duplicated.
69
- end
70
-
71
- def save_states_from_dsl
72
- # Note: DSL is reloaded when creating an installer (Pod::Installer.new).
73
- # Any mutation to DSL is highly discouraged
74
- # --> Rather, perform mutation on PodPrebuild::StateStore instead
75
- PodPrebuild::StateStore.excluded_pods += PodPrebuild.config.excluded_pods
76
- end
77
-
78
53
  def create_prebuild_sandbox
79
54
  standard_sandbox = installer_context.sandbox
80
55
  @prebuild_sandbox = Pod::PrebuildSandbox.from_standard_sandbox(standard_sandbox)
@@ -88,11 +63,9 @@ module PodPrebuild
88
63
  .group_by { |spec| spec.name.split("/")[0] }
89
64
  .select { |_, specs| specs.all?(&:empty_source_files?) }
90
65
  .keys
91
-
92
- PodPrebuild::StateStore.excluded_pods += pods_with_empty_source_files
66
+ PodPrebuild.config.update_detected_excluded_pods!(pods_with_empty_source_files)
67
+ PodPrebuild.config.update_detected_prebuilt_pod_names!(@original_installer.prebuilt_pod_names)
93
68
  Pod::UI.puts "Exclude pods with empty source files: #{pods_with_empty_source_files.to_a}"
94
-
95
- # TODO (thuyen): Detect dependencies of a prebuilt pod and treat them as prebuilt pods as well
96
69
  end
97
70
 
98
71
  def validate_cache
@@ -104,13 +77,13 @@ module PodPrebuild
104
77
  validate_prebuilt_settings: PodPrebuild.config.validate_prebuilt_settings,
105
78
  generated_framework_path: prebuild_sandbox.generate_framework_path,
106
79
  sandbox_root: prebuild_sandbox.root,
107
- ignored_pods: PodPrebuild::StateStore.excluded_pods,
108
- prebuilt_pod_names: @original_installer.prebuilt_pod_names
80
+ ignored_pods: PodPrebuild.config.excluded_pods,
81
+ prebuilt_pod_names: PodPrebuild.config.prebuilt_pod_names
109
82
  ).validate
110
83
  path_to_save_cache_validation = PodPrebuild.config.save_cache_validation_to
111
84
  @cache_validation.update_to(path_to_save_cache_validation) unless path_to_save_cache_validation.nil?
112
85
  cache_validation.print_summary
113
- PodPrebuild::StateStore.cache_validation = cache_validation
86
+ PodPrebuild.state.update(:cache_validation => cache_validation)
114
87
  end
115
88
 
116
89
  def prebuild!
@@ -7,6 +7,7 @@ module Pod
7
7
  target = options[:target]
8
8
  return if target.nil?
9
9
 
10
+ Pod::UI.puts "Building target: #{target}...".magenta
10
11
  options[:sandbox] = Pod::Sandbox.new(Pathname(options[:sandbox])) unless options[:sandbox].is_a?(Pod::Sandbox)
11
12
  options[:build_dir] = build_dir(options[:sandbox].root)
12
13
 
@@ -3,7 +3,7 @@ module Pod
3
3
  # Returns the names of pod targets detected as prebuilt, including
4
4
  # those declared in Podfile and their dependencies
5
5
  def prebuilt_pod_names
6
- prebuilt_pod_targets.map(&:name)
6
+ prebuilt_pod_targets.map(&:name).to_set
7
7
  end
8
8
 
9
9
  # Returns the pod targets detected as prebuilt, including
@@ -5,42 +5,43 @@ module Pod
5
5
  # [String] standard_sandbox_path
6
6
  def self.from_standard_sanbox_path(path)
7
7
  prebuild_sandbox_path = Pathname.new(path).realpath + ".." + PodPrebuild.config.prebuild_sandbox_path
8
- self.new(prebuild_sandbox_path)
8
+ new(prebuild_sandbox_path)
9
9
  end
10
10
 
11
11
  def self.from_standard_sandbox(sandbox)
12
- self.from_standard_sanbox_path(sandbox.root)
12
+ from_standard_sanbox_path(sandbox.root)
13
13
  end
14
14
 
15
15
  def standard_sanbox_path
16
- self.root.parent
16
+ root.parent
17
17
  end
18
18
 
19
19
  def generate_framework_path
20
- self.root + "GeneratedFrameworks"
20
+ root + "GeneratedFrameworks"
21
21
  end
22
22
 
23
23
  # @param name [String] pass the target.name (may containing platform suffix)
24
24
  # @return [Pathname] the folder containing the framework file.
25
25
  def framework_folder_path_for_target_name(name)
26
- self.generate_framework_path + name
26
+ generate_framework_path + name
27
27
  end
28
28
 
29
29
  def exsited_framework_target_names
30
- exsited_framework_name_pairs.map { |pair| pair[0] }.uniq
30
+ existed_framework_name_pairs.map { |pair| pair[0] }.uniq
31
31
  end
32
32
 
33
33
  def exsited_framework_pod_names
34
- exsited_framework_name_pairs.map { |pair| pair[1] }.uniq
34
+ existed_framework_name_pairs.map { |pair| pair[1] }.uniq
35
35
  end
36
36
 
37
37
  def existed_target_names_for_pod_name(pod_name)
38
- exsited_framework_name_pairs.select { |pair| pair[1] == pod_name }.map { |pair| pair[0] }
38
+ existed_framework_name_pairs.select { |pair| pair[1] == pod_name }.map { |pair| pair[0] }
39
39
  end
40
40
 
41
41
  def save_pod_name_for_target(target)
42
42
  folder = framework_folder_path_for_target_name(target.name)
43
43
  return unless folder.exist?
44
+
44
45
  flag_file_path = folder + "#{target.pod_name}.pod_name"
45
46
  File.write(flag_file_path.to_s, "")
46
47
  end
@@ -53,16 +54,16 @@ module Pod
53
54
  end
54
55
  name = name.basename(".pod_name").to_s unless name.nil?
55
56
  name ||= Pathname.new(target_folder_path).basename.to_s # for compatibility with older version
57
+ name
56
58
  end
57
59
 
58
60
  # Array<[target_name, pod_name]>
59
- def exsited_framework_name_pairs
61
+ def existed_framework_name_pairs
60
62
  return [] unless generate_framework_path.exist?
61
- generate_framework_path.children().map do |framework_path|
62
- if framework_path.directory? && (not framework_path.children.empty?)
63
+
64
+ generate_framework_path.children.map do |framework_path|
65
+ if framework_path.directory? && !framework_path.children.empty?
63
66
  [framework_path.basename.to_s, pod_name_for_target_folder(framework_path)]
64
- else
65
- nil
66
67
  end
67
68
  end.reject(&:nil?).uniq
68
69
  end