build 2.5.1 → 2.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/build/build_node.rb +4 -7
- data/lib/build/dependency_node.rb +16 -2
- data/lib/build/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b25bab5ea87cc44e752b996feef7556f532917a44b5c8a806abcaa835a5be46
|
4
|
+
data.tar.gz: 6994d82f7e62c9b1755f4bfc1cd2e4d59cab5bb635157c289cb7f66cbf17e183
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5463598ea2a50099f0b7d5462fc231eb207009e2f75808da8dd99b976a5639ece50db6822dd36ed5c7674c4afae090098fc77a9d1e6da1c7893f77f3dae40ef2
|
7
|
+
data.tar.gz: 9efd1dc567f4532209c07eac0cb59bc7513bff228078563d58a0c052c29bda3a3eee9123bcc0a698973f5404281699824064ec81efcccb9ce84f1af9ad133d7c
|
data/lib/build/build_node.rb
CHANGED
@@ -25,9 +25,8 @@ require 'console/event/spawn'
|
|
25
25
|
|
26
26
|
module Build
|
27
27
|
class BuildNode < Graph::Node
|
28
|
-
def initialize(environment,
|
28
|
+
def initialize(environment, provisions, arguments)
|
29
29
|
@environment = environment
|
30
|
-
@dependency = dependency
|
31
30
|
@provisions = provisions
|
32
31
|
@arguments = arguments
|
33
32
|
|
@@ -35,20 +34,18 @@ module Build
|
|
35
34
|
end
|
36
35
|
|
37
36
|
attr :environment
|
38
|
-
attr :dependency
|
39
37
|
attr :provisions
|
40
38
|
attr :arguments
|
41
39
|
|
42
40
|
def == other
|
43
41
|
super and
|
44
42
|
@environment == other.environment and
|
45
|
-
@dependency == other.dependency and
|
46
43
|
@provisions == other.provisions and
|
47
44
|
@arguments == other.arguments
|
48
45
|
end
|
49
46
|
|
50
47
|
def hash
|
51
|
-
super ^ @environment.hash ^ @
|
48
|
+
super ^ @environment.hash ^ @provisions.hash ^ @arguments.hash
|
52
49
|
end
|
53
50
|
|
54
51
|
def task_class(parent_task)
|
@@ -56,11 +53,11 @@ module Build
|
|
56
53
|
end
|
57
54
|
|
58
55
|
def initial_environment
|
59
|
-
Build::Environment.new(@environment
|
56
|
+
Build::Environment.new(@environment)
|
60
57
|
end
|
61
58
|
|
62
59
|
def name
|
63
|
-
@
|
60
|
+
@environment.name
|
64
61
|
end
|
65
62
|
|
66
63
|
def apply!(task)
|
@@ -84,6 +84,20 @@ module Build
|
|
84
84
|
def dependency_node_for(dependency)
|
85
85
|
DependencyNode.new(@chain, dependency, @environment, @arguments)
|
86
86
|
end
|
87
|
+
|
88
|
+
def print_dependencies(buffer = $stderr, level = 0)
|
89
|
+
self.provisions.each do |provision|
|
90
|
+
buffer.puts "#{" " * indentation}building #{provision.provider.name} which #{provision} which depends on:"
|
91
|
+
|
92
|
+
provision.each_dependency do |nested_dependency|
|
93
|
+
child = self.dependency_node_for(nested_dependency)
|
94
|
+
|
95
|
+
child.print_dependencies(buffer, level + 1)
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
return nil
|
100
|
+
end
|
87
101
|
end
|
88
102
|
|
89
103
|
class DependencyTask < Task
|
@@ -141,12 +155,12 @@ module Build
|
|
141
155
|
# logger.debug {"Using #{environment}"}
|
142
156
|
# end
|
143
157
|
|
144
|
-
local_environment = Build::Environment.combine(*environments)&.evaluate || Build::Environment.new
|
158
|
+
local_environment = Build::Environment.combine(*environments)&.evaluate(name: dependency.name) || Build::Environment.new(name: dependency.name)
|
145
159
|
|
146
160
|
# logger.debug("Local Environment: #{local_environment}")
|
147
161
|
|
148
162
|
build_task = invoke(
|
149
|
-
BuildNode.new(local_environment,
|
163
|
+
BuildNode.new(local_environment, @node.provisions, @node.arguments)
|
150
164
|
)
|
151
165
|
|
152
166
|
if wait_for_children?
|
data/lib/build/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: build
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: build-graph
|