cocoapods-binary-cache 0.1.2 → 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.
- checksums.yaml +4 -4
- data/lib/cocoapods-binary-cache/cache/validation_result.rb +4 -0
- data/lib/cocoapods-binary-cache/cache/validator.rb +2 -3
- data/lib/cocoapods-binary-cache/cache/validator_base.rb +28 -8
- data/lib/cocoapods-binary-cache/cache/validator_dependencies_graph.rb +7 -2
- data/lib/cocoapods-binary-cache/cache/validator_dev_pods.rb +21 -13
- data/lib/cocoapods-binary-cache/cache/validator_non_dev_pods.rb +1 -1
- data/lib/cocoapods-binary-cache/dependencies_graph/dependencies_graph.rb +20 -25
- data/lib/cocoapods-binary-cache/dependencies_graph/graph_visualizer.rb +29 -38
- data/lib/cocoapods-binary-cache/diagnosis/base.rb +13 -0
- data/lib/cocoapods-binary-cache/diagnosis/diagnosis.rb +24 -0
- data/lib/cocoapods-binary-cache/diagnosis/integration.rb +23 -0
- data/lib/cocoapods-binary-cache/env.rb +32 -0
- data/lib/cocoapods-binary-cache/helper/checksum.rb +10 -4
- data/lib/cocoapods-binary-cache/helper/lockfile.rb +26 -3
- data/lib/cocoapods-binary-cache/helper/podspec.rb +5 -1
- data/lib/cocoapods-binary-cache/helper/prebuild_order.rb +12 -0
- data/lib/cocoapods-binary-cache/hooks/post_install.rb +20 -2
- data/lib/cocoapods-binary-cache/hooks/pre_install.rb +14 -44
- data/lib/cocoapods-binary-cache/main.rb +2 -1
- data/lib/cocoapods-binary-cache/pod-binary/helper/build.rb +40 -0
- data/lib/cocoapods-binary-cache/pod-binary/helper/detected_prebuilt_pods/installer.rb +2 -2
- data/lib/cocoapods-binary-cache/pod-binary/helper/detected_prebuilt_pods/target_definition.rb +3 -10
- data/lib/cocoapods-binary-cache/pod-binary/helper/names.rb +2 -11
- data/lib/cocoapods-binary-cache/pod-binary/helper/prebuild_sandbox.rb +15 -15
- data/lib/cocoapods-binary-cache/pod-binary/helper/target_checker.rb +7 -10
- data/lib/cocoapods-binary-cache/pod-binary/integration.rb +1 -3
- data/lib/cocoapods-binary-cache/pod-binary/integration/alter_specs.rb +4 -1
- data/lib/cocoapods-binary-cache/pod-binary/integration/patch/embed_framework_script.rb +1 -1
- data/lib/cocoapods-binary-cache/pod-binary/integration/patch/resolve_dependencies.rb +0 -3
- data/lib/cocoapods-binary-cache/pod-binary/integration/patch/sandbox_analyzer_state.rb +29 -0
- data/lib/cocoapods-binary-cache/pod-binary/integration/patch/source_installation.rb +6 -3
- data/lib/cocoapods-binary-cache/pod-binary/integration/source_installer.rb +42 -50
- data/lib/cocoapods-binary-cache/pod-binary/prebuild.rb +45 -110
- data/lib/cocoapods-binary-cache/pod-binary/prebuild_dsl.rb +2 -61
- data/lib/cocoapods-binary-cache/pod-binary/prebuild_hook.rb +0 -1
- data/lib/cocoapods-binary-cache/pod-rome/xcodebuild_command.rb +192 -0
- data/lib/cocoapods-binary-cache/pod-rome/xcodebuild_raw.rb +43 -0
- data/lib/cocoapods-binary-cache/prebuild_output/metadata.rb +16 -0
- data/lib/cocoapods-binary-cache/prebuild_output/output.rb +12 -39
- data/lib/cocoapods-binary-cache/scheme_editor.rb +17 -16
- data/lib/cocoapods-binary-cache/state_store.rb +16 -6
- data/lib/command/binary.rb +21 -2
- data/lib/command/config.rb +173 -10
- data/lib/command/executor/base.rb +7 -0
- data/lib/command/executor/fetcher.rb +4 -4
- data/lib/command/executor/prebuilder.rb +2 -2
- data/lib/command/executor/pusher.rb +1 -1
- data/lib/command/executor/visualizer.rb +3 -2
- data/lib/command/fetch.rb +0 -1
- data/lib/command/prebuild.rb +14 -2
- data/lib/command/push.rb +22 -0
- metadata +15 -11
- data/lib/cocoapods-binary-cache/pod-binary/helper/feature_switches.rb +0 -90
- data/lib/cocoapods-binary-cache/pod-binary/helper/passer.rb +0 -25
- data/lib/cocoapods-binary-cache/pod-binary/integration/remove_target_files.rb +0 -29
- data/lib/cocoapods-binary-cache/pod-binary/tool/tool.rb +0 -12
- data/lib/cocoapods-binary-cache/pod-rome/build_framework.rb +0 -247
- data/lib/cocoapods-binary-cache/prebuild_cache.rb +0 -49
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 939a85addd611d4a4bcd2b9ce1eeb7e036d58a937a14bdd4f772a6c8170e4394
|
|
4
|
+
data.tar.gz: 0372d8f94f6e486259669f4db5431585a08645c1a23ad363258581fc5f679eff
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aa2bbc570dc6a1f462a85286578b8dc41a7ce189df2017177d083a70df9ac0d026c8ca8dea310eee2ae5b517b3418004045b8bcc782aa0440f755d8bab1dd0d4
|
|
7
|
+
data.tar.gz: c98e55ae66d034897db4969bf9c12b0386a69a5139bc78ada10298875c5a9487d499852bb77195ffca42f11b0d2ab97fad940348da90d21296f6f0d6952b64af
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
module PodPrebuild
|
|
2
|
-
class CacheValidator
|
|
2
|
+
class CacheValidator
|
|
3
3
|
def initialize(options)
|
|
4
|
-
super(options)
|
|
5
4
|
@validators = [
|
|
6
5
|
PodPrebuild::PodfileChangesCacheValidator.new(options),
|
|
7
6
|
PodPrebuild::NonDevPodsCacheValidator.new(options)
|
|
8
7
|
]
|
|
9
|
-
@validators << PodPrebuild::DevPodsCacheValidator.new(options) if
|
|
8
|
+
@validators << PodPrebuild::DevPodsCacheValidator.new(options) if PodPrebuild.config.dev_pods_enabled?
|
|
10
9
|
@validators << PodPrebuild::DependenciesGraphCacheValidator.new(options)
|
|
11
10
|
@validators << PodPrebuild::ExclusionCacheValidator.new(options)
|
|
12
11
|
end
|
|
@@ -37,6 +37,7 @@ module PodPrebuild
|
|
|
37
37
|
hit = Set.new
|
|
38
38
|
|
|
39
39
|
check_pod = lambda do |name|
|
|
40
|
+
root_name = name.split("/")[0]
|
|
40
41
|
version = pods[name]
|
|
41
42
|
prebuilt_version = prebuilt_pods[name]
|
|
42
43
|
result = false
|
|
@@ -44,13 +45,15 @@ module PodPrebuild
|
|
|
44
45
|
missed[name] = "Not available (#{version})"
|
|
45
46
|
elsif prebuilt_version != version
|
|
46
47
|
missed[name] = "Outdated: (prebuilt: #{prebuilt_version}) vs (#{version})"
|
|
48
|
+
elsif load_metadata(root_name).blank?
|
|
49
|
+
missed[name] = "Metadata not available (probably #{root_name}.zip is not in GeneratedFrameworks)"
|
|
47
50
|
else
|
|
48
|
-
|
|
49
|
-
if
|
|
51
|
+
diff = incompatible_pod(root_name)
|
|
52
|
+
if diff.empty?
|
|
50
53
|
hit << name
|
|
51
54
|
result = true
|
|
52
55
|
else
|
|
53
|
-
missed[name] = "Incompatible
|
|
56
|
+
missed[name] = "Incompatible: #{diff}"
|
|
54
57
|
end
|
|
55
58
|
end
|
|
56
59
|
result
|
|
@@ -70,11 +73,10 @@ module PodPrebuild
|
|
|
70
73
|
PodPrebuild::CacheValidationResult.new(missed, hit)
|
|
71
74
|
end
|
|
72
75
|
|
|
73
|
-
def
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
metadata.build_settings
|
|
76
|
+
def incompatible_pod(name)
|
|
77
|
+
# Pod incompatibility is a universal concept. Generally, it requires build settings compatibility.
|
|
78
|
+
# For more checks, do override this function to define what it means by `incompatible`.
|
|
79
|
+
incompatible_build_settings(name)
|
|
78
80
|
end
|
|
79
81
|
|
|
80
82
|
def incompatible_build_settings(name)
|
|
@@ -88,5 +90,23 @@ module PodPrebuild
|
|
|
88
90
|
end
|
|
89
91
|
settings_diff
|
|
90
92
|
end
|
|
93
|
+
|
|
94
|
+
def load_metadata(name)
|
|
95
|
+
@metadata_cache ||= {}
|
|
96
|
+
cache = @metadata_cache[name]
|
|
97
|
+
return cache unless cache.nil?
|
|
98
|
+
|
|
99
|
+
metadata = PodPrebuild::Metadata.in_dir(generated_framework_path + name)
|
|
100
|
+
@metadata_cache[name] = metadata
|
|
101
|
+
metadata
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
def read_prebuilt_build_settings(name)
|
|
105
|
+
load_metadata(name).build_settings
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
def read_source_hash(name)
|
|
109
|
+
load_metadata(name).source_hash
|
|
110
|
+
end
|
|
91
111
|
end
|
|
92
112
|
end
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
module PodPrebuild
|
|
2
2
|
class DependenciesGraphCacheValidator < AccumulatedCacheValidator
|
|
3
|
+
def initialize(options)
|
|
4
|
+
super(options)
|
|
5
|
+
@ignored_pods = options[:ignored_pods] || Set.new
|
|
6
|
+
end
|
|
7
|
+
|
|
3
8
|
def validate(accumulated)
|
|
4
9
|
return accumulated if library_evolution_supported? || @pod_lockfile.nil?
|
|
5
10
|
|
|
6
11
|
dependencies_graph = DependenciesGraph.new(@pod_lockfile.lockfile)
|
|
7
|
-
clients = dependencies_graph.get_clients(accumulated.missed.to_a)
|
|
8
|
-
unless
|
|
12
|
+
clients = dependencies_graph.get_clients(accumulated.discard(@ignored_pods).missed.to_a)
|
|
13
|
+
unless PodPrebuild.config.dev_pods_enabled?
|
|
9
14
|
clients = clients.reject { |client| @pod_lockfile.dev_pods.keys.include?(client) }
|
|
10
15
|
end
|
|
11
16
|
|
|
@@ -1,22 +1,30 @@
|
|
|
1
1
|
module PodPrebuild
|
|
2
2
|
class DevPodsCacheValidator < BaseCacheValidator
|
|
3
|
-
def initialize(options)
|
|
4
|
-
super(options)
|
|
5
|
-
@sandbox_root = options[:sandbox_root]
|
|
6
|
-
end
|
|
7
|
-
|
|
8
3
|
def validate(*)
|
|
9
4
|
return PodPrebuild::CacheValidationResult.new if @pod_lockfile.nil?
|
|
10
5
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@
|
|
15
|
-
@generated_framework_path,
|
|
16
|
-
@pod_lockfile.lockfile
|
|
6
|
+
validate_pods(
|
|
7
|
+
pods: @pod_lockfile.dev_pods,
|
|
8
|
+
subspec_pods: [],
|
|
9
|
+
prebuilt_pods: @prebuilt_lockfile.nil? ? {} : @prebuilt_lockfile.dev_pods
|
|
17
10
|
)
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def incompatible_pod(name)
|
|
14
|
+
diff = super(name)
|
|
15
|
+
return diff unless diff.empty?
|
|
16
|
+
|
|
17
|
+
incompatible_source(name)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def incompatible_source(name)
|
|
21
|
+
diff = {}
|
|
22
|
+
prebuilt_hash = read_source_hash(name)
|
|
23
|
+
expected_hash = pod_lockfile.dev_pod_hash(name)
|
|
24
|
+
unless prebuilt_hash == expected_hash
|
|
25
|
+
diff[name] = { :prebuilt_hash => prebuilt_hash, :expected_hash => expected_hash}
|
|
26
|
+
end
|
|
27
|
+
diff
|
|
20
28
|
end
|
|
21
29
|
end
|
|
22
30
|
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
|
|
5
|
-
require
|
|
6
|
-
require_relative
|
|
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
|
|
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
|
-
|
|
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(
|
|
32
|
-
|
|
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 ||=
|
|
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
|
|
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
|
|
5
|
+
require "rgl/rdot"
|
|
6
6
|
|
|
7
7
|
module RGL
|
|
8
8
|
module Graph
|
|
9
|
-
def to_dot_graph(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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(
|
|
56
|
-
|
|
57
|
-
|
|
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(
|
|
60
|
-
f <<
|
|
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} #{
|
|
64
|
-
message =
|
|
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
|
-
|
|
62
|
+
output_path
|
|
72
63
|
end
|
|
73
64
|
end
|
|
74
65
|
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module PodPrebuild
|
|
2
|
+
class BaseDiagnosis
|
|
3
|
+
def initialize(options)
|
|
4
|
+
@cache_validation = options[:cache_validation]
|
|
5
|
+
@standard_sandbox = options[:standard_sandbox]
|
|
6
|
+
@specs = (options[:specs] || []).map { |s| [s.name, s] }.to_h
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def spec(name)
|
|
10
|
+
@specs[name]
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
require_relative "base"
|
|
2
|
+
require_relative "integration"
|
|
3
|
+
|
|
4
|
+
module PodPrebuild
|
|
5
|
+
class Diagnosis
|
|
6
|
+
def initialize(options)
|
|
7
|
+
@diagnosers = [
|
|
8
|
+
IntegrationDiagnosis
|
|
9
|
+
].map { |klazz| klazz.new(options) }
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def 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"
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative "base"
|
|
2
|
+
|
|
3
|
+
module PodPrebuild
|
|
4
|
+
class IntegrationDiagnosis < BaseDiagnosis
|
|
5
|
+
def run
|
|
6
|
+
should_be_integrated = if PodPrebuild.config.prebuild_job? \
|
|
7
|
+
then @cache_validation.hit + @cache_validation.missed \
|
|
8
|
+
else @cache_validation.hit \
|
|
9
|
+
end
|
|
10
|
+
should_be_integrated = should_be_integrated.map { |name| name.split("/")[0] }.to_set
|
|
11
|
+
unintegrated = should_be_integrated.reject do |name|
|
|
12
|
+
module_name = spec(name)&.module_name || name
|
|
13
|
+
framework_path = \
|
|
14
|
+
@standard_sandbox.pod_dir(name) + \
|
|
15
|
+
PodPrebuild.config.prebuilt_path(path: "#{module_name}.framework")
|
|
16
|
+
framework_path.exist?
|
|
17
|
+
end
|
|
18
|
+
return [] if unintegrated.empty?
|
|
19
|
+
|
|
20
|
+
[[:error, "Unintegrated frameworks: #{unintegrated}"]]
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|