build-graph 1.4.3 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/build/graph/task.rb +31 -5
- data/lib/build/graph/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f97cf5ec9acee56f42a3e032af5e3e6de28329616c5ec14b1e109372e972fdda
|
4
|
+
data.tar.gz: 139321b3283f1a69cc1230a87724ab43e48b289fccc88b120b527289ecbbeaa2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca5ce68fd6356a1ba5159b6a52eddd9cbeb79152de4f98f3cf57c934d5c247774c3cda2d47d5d1edd4e17621d8870a2dba162349555529806667d5f85bbb3460
|
7
|
+
data.tar.gz: 2620daa61cb84eade19d3fcde21134f650672da610739bf2036b2be7bcd3ad324b945ed220e744ef52e93722acb8d7da0b5e6a7a35372ced7eba9d3ccf473f68
|
data/lib/build/graph/task.rb
CHANGED
@@ -36,7 +36,7 @@ module Build
|
|
36
36
|
end
|
37
37
|
|
38
38
|
class Task
|
39
|
-
def initialize(walker, node)
|
39
|
+
def initialize(walker, node, dependencies: nil)
|
40
40
|
@walker = walker
|
41
41
|
|
42
42
|
@walker.tasks[node] = self
|
@@ -46,6 +46,10 @@ module Build
|
|
46
46
|
|
47
47
|
@error = nil
|
48
48
|
|
49
|
+
# Tasks that must be complete before processing this task.
|
50
|
+
@dependencies = dependencies
|
51
|
+
|
52
|
+
# Tasks that must be complete before finishing this task.
|
49
53
|
@children = []
|
50
54
|
|
51
55
|
@state = nil
|
@@ -57,7 +61,9 @@ module Build
|
|
57
61
|
attr :inputs
|
58
62
|
attr :outputs
|
59
63
|
|
64
|
+
attr :dependencies
|
60
65
|
attr :children
|
66
|
+
|
61
67
|
attr :state
|
62
68
|
|
63
69
|
attr :annotation
|
@@ -154,6 +160,7 @@ module Build
|
|
154
160
|
end
|
155
161
|
|
156
162
|
protected
|
163
|
+
|
157
164
|
def update_inputs_and_outputs
|
158
165
|
# If @node.inputs is a glob, this part of the process converts the glob into an actual list of files.
|
159
166
|
@inputs = Files::State.new(@node.inputs)
|
@@ -188,16 +195,35 @@ module Build
|
|
188
195
|
|
189
196
|
# Returns false if any input failed.
|
190
197
|
def wait_for_inputs?
|
191
|
-
@annotation = "wait for inputs"
|
192
198
|
# Wait on any inputs, returns whether any inputs failed:
|
193
|
-
|
199
|
+
if @inputs&.any?
|
200
|
+
@annotation = "wait for inputs"
|
201
|
+
unless @walker.wait_on_paths(self, @inputs)
|
202
|
+
return false
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
if @dependencies&.any?
|
207
|
+
@annotation = "wait for dependencies"
|
208
|
+
unless @walker.wait_for_children(self, @dependencies)
|
209
|
+
return false
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
return true
|
194
214
|
end
|
195
215
|
|
196
216
|
# Returns false if any child failed.
|
197
217
|
def wait_for_children?
|
198
|
-
@
|
218
|
+
if @children&.any?
|
219
|
+
@annotation = "wait for children"
|
220
|
+
|
221
|
+
unless @walker.wait_for_children(self, @children)
|
222
|
+
return false
|
223
|
+
end
|
224
|
+
end
|
199
225
|
|
200
|
-
|
226
|
+
return true
|
201
227
|
end
|
202
228
|
end
|
203
229
|
end
|
data/lib/build/graph/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: build-graph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.1
|
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-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: process-group
|
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
177
|
- !ruby/object:Gem::Version
|
178
178
|
version: '0'
|
179
179
|
requirements: []
|
180
|
-
rubygems_version: 3.0.
|
180
|
+
rubygems_version: 3.0.4
|
181
181
|
signing_key:
|
182
182
|
specification_version: 4
|
183
183
|
summary: Build::Graph is a framework for build systems, with specific functionality
|