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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07b55af0a6f9982b66d444ce0fa0ef1c3eabdd67b310b1c8a192ff6d660569e9
4
- data.tar.gz: 937115e5283051629a7d6bd30315dd6cb889b887f2225b8ec125dc4f69886aa3
3
+ metadata.gz: f97cf5ec9acee56f42a3e032af5e3e6de28329616c5ec14b1e109372e972fdda
4
+ data.tar.gz: 139321b3283f1a69cc1230a87724ab43e48b289fccc88b120b527289ecbbeaa2
5
5
  SHA512:
6
- metadata.gz: 57775111484491d38cc9f3b0f589be6171b093d5cdd3707f7a5a37151f4a31a21d7eec724646c5f5f4642ef9b8f3142968e6d76ed7074895d3cabf4879ff440e
7
- data.tar.gz: f45877e83f579ce571957f75c0db8c93f0777d459897d3090c74db639045380fff10cce4d27801812a941f7de5c61f7542ff672a6f2c38c50650f656cfac2d7d
6
+ metadata.gz: ca5ce68fd6356a1ba5159b6a52eddd9cbeb79152de4f98f3cf57c934d5c247774c3cda2d47d5d1edd4e17621d8870a2dba162349555529806667d5f85bbb3460
7
+ data.tar.gz: 2620daa61cb84eade19d3fcde21134f650672da610739bf2036b2be7bcd3ad324b945ed220e744ef52e93722acb8d7da0b5e6a7a35372ced7eba9d3ccf473f68
@@ -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
- @walker.wait_on_paths(self, @inputs)
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
- @annotation = "wait for children"
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
- @walker.wait_for_children(self, @children)
226
+ return true
201
227
  end
202
228
  end
203
229
  end
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Build
22
22
  module Graph
23
- VERSION = "1.4.3"
23
+ VERSION = "1.5.1"
24
24
  end
25
25
  end
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.3
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-05-02 00:00:00.000000000 Z
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.3
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