build-graph 2.0.2 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/build/graph/task.rb +19 -7
- data/lib/build/graph/version.rb +1 -1
- data/lib/build/graph/walker.rb +5 -0
- data/spec/build/graph/listing.txt +8 -0
- data/spec/build/graph/process_graph.rb +13 -4
- data/spec/build/graph/program/Benchmark.cpp.d +1 -0
- data/spec/build/graph/program/Benchmark.cpp.o +0 -0
- data/spec/build/graph/program/dictionary-sort +0 -0
- data/spec/build/graph/program/main.cpp.d +1 -0
- data/spec/build/graph/program/main.cpp.o +0 -0
- data.tar.gz.sig +0 -0
- metadata +76 -52
- metadata.gz.sig +0 -0
- data/.gitignore +0 -24
- data/.rspec +0 -4
- data/.travis.yml +0 -19
- data/Gemfile +0 -14
- data/README.md +0 -99
- data/Rakefile +0 -6
- data/build-graph.gemspec +0 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aec6fa0f0986fcf74ca7e3c3debb16f96d7001acbb6f2db9ffb6266973520d39
|
4
|
+
data.tar.gz: 13568cfcc7dc26b1d2a1a4dbbcbe26b3b127756caaff3eb92873ce139d094c53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 368c3f2a8b146ff538ef5381f1d394965a4d7fde720fcd0757b36c578614da8b4ad81a968611a32ca05372278554a08fd4484ea1dd7ab5f59bbcce9564189bdd
|
7
|
+
data.tar.gz: 92233e7a0535b6b89a0e40716c527357c345bf441387e500d86690d690f0bea21e7b1c86c58e335933efe0535f6599f6e0d0125823136484c60e87c0d908710a
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data/lib/build/graph/task.rb
CHANGED
@@ -95,11 +95,9 @@ module Build
|
|
95
95
|
fail!(InputsFailed)
|
96
96
|
end
|
97
97
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
fail!(ChildrenFailed)
|
102
|
-
end
|
98
|
+
wait_for_children!
|
99
|
+
|
100
|
+
update_outputs!
|
103
101
|
|
104
102
|
@state ||= :complete
|
105
103
|
|
@@ -156,7 +154,21 @@ module Build
|
|
156
154
|
"#<#{self.class} #{node_string} #{state_string}>"
|
157
155
|
end
|
158
156
|
|
159
|
-
|
157
|
+
def inspect
|
158
|
+
"\#<#{self.class}:0x#{self.object_id.to_s(16)} #{node_string} #{state_string}>"
|
159
|
+
end
|
160
|
+
|
161
|
+
protected
|
162
|
+
|
163
|
+
def wait_for_children!
|
164
|
+
unless wait_for_children?
|
165
|
+
fail!(ChildrenFailed)
|
166
|
+
|
167
|
+
return false
|
168
|
+
end
|
169
|
+
|
170
|
+
return true
|
171
|
+
end
|
160
172
|
|
161
173
|
def state_string
|
162
174
|
if @state
|
@@ -187,7 +199,7 @@ module Build
|
|
187
199
|
end
|
188
200
|
|
189
201
|
# If the node's outputs were a glob, this checks the filesystem to figure out what files were actually generated. If it inherits the outputs of the child tasks, merge them into our own outputs.
|
190
|
-
def update_outputs
|
202
|
+
def update_outputs!
|
191
203
|
if @node.inherit_outputs?
|
192
204
|
@outputs = Files::State.new(self.children_outputs)
|
193
205
|
else
|
data/lib/build/graph/version.rb
CHANGED
data/lib/build/graph/walker.rb
CHANGED
@@ -20,6 +20,7 @@
|
|
20
20
|
|
21
21
|
require 'set'
|
22
22
|
require 'console'
|
23
|
+
require 'build/files/monitor'
|
23
24
|
|
24
25
|
require_relative 'task'
|
25
26
|
require_relative 'node'
|
@@ -237,6 +238,10 @@ module Build
|
|
237
238
|
yield
|
238
239
|
end
|
239
240
|
end
|
241
|
+
|
242
|
+
def inspect
|
243
|
+
"\#<#{self.class}:0x#{self.object_id.to_s(16)} #{@tasks.count} tasks, #{@failed_tasks.count} failed>"
|
244
|
+
end
|
240
245
|
end
|
241
246
|
end
|
242
247
|
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
-rwxr-xr-x 1 samuel users 1988 Mar 14 2019 /home/samuel/Projects/ioquatix/build-graph/spec/build/graph/build_test.rb
|
2
|
+
-rw-r--r-- 1 samuel users 1527 Feb 7 2016 /home/samuel/Projects/ioquatix/build-graph/spec/build/graph/edge_spec.rb
|
3
|
+
-rw-r--r-- 1 samuel users 5074 Mar 14 2019 /home/samuel/Projects/ioquatix/build-graph/spec/build/graph/graph_spec.rb
|
4
|
+
-rw-r--r-- 1 samuel users 1945 Oct 1 2019 /home/samuel/Projects/ioquatix/build-graph/spec/build/graph/inherit_spec.rb
|
5
|
+
-rw-r--r-- 1 samuel users 2747 Oct 1 2019 /home/samuel/Projects/ioquatix/build-graph/spec/build/graph/node_spec.rb
|
6
|
+
-rw-r--r-- 1 samuel users 2030 May 23 12:32 /home/samuel/Projects/ioquatix/build-graph/spec/build/graph/process_graph.rb
|
7
|
+
-rw-r--r-- 1 samuel users 2380 Oct 1 2019 /home/samuel/Projects/ioquatix/build-graph/spec/build/graph/task_spec.rb
|
8
|
+
-rw-r--r-- 1 samuel users 4150 Oct 1 2019 /home/samuel/Projects/ioquatix/build-graph/spec/build/graph/walker_spec.rb
|
@@ -55,14 +55,23 @@ class ProcessTask < Build::Graph::Task
|
|
55
55
|
@node.dirty?
|
56
56
|
end
|
57
57
|
|
58
|
-
|
58
|
+
class CommandError < RuntimeError
|
59
|
+
def initialize(command, status)
|
60
|
+
@command = command
|
61
|
+
@status = status
|
62
|
+
|
63
|
+
super "#{command.join(' ')} failed: #{status}!"
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def run(*arguments, **options)
|
59
68
|
if wet?
|
60
|
-
@walker.logger.debug(self) {Console::Event::Spawn.for(*arguments)}
|
69
|
+
@walker.logger.debug(self) {Console::Event::Spawn.for(*arguments, **options)}
|
61
70
|
|
62
|
-
status = @group.spawn(*arguments)
|
71
|
+
status = @group.spawn(*arguments, **options)
|
63
72
|
|
64
73
|
if status != 0
|
65
|
-
raise CommandError.new(status)
|
74
|
+
raise CommandError.new(arguments, status)
|
66
75
|
end
|
67
76
|
end
|
68
77
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
Benchmark.cpp.o: Benchmark.cpp Benchmark.h
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
main.cpp.o: main.cpp Benchmark.h DictionarySort.h ParallelMergeSort.h
|
Binary file
|
data.tar.gz.sig
ADDED
Binary file
|
metadata
CHANGED
@@ -1,43 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: build-graph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
|
-
cert_chain:
|
11
|
-
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIEhDCCAuygAwIBAgIBATANBgkqhkiG9w0BAQsFADA3MTUwMwYDVQQDDCxzYW11
|
14
|
+
ZWwud2lsbGlhbXMvREM9b3Jpb250cmFuc2Zlci9EQz1jby9EQz1uejAeFw0yMTA4
|
15
|
+
MTYwNjMzNDRaFw0yMjA4MTYwNjMzNDRaMDcxNTAzBgNVBAMMLHNhbXVlbC53aWxs
|
16
|
+
aWFtcy9EQz1vcmlvbnRyYW5zZmVyL0RDPWNvL0RDPW56MIIBojANBgkqhkiG9w0B
|
17
|
+
AQEFAAOCAY8AMIIBigKCAYEAyXLSS/cw+fXJ5e7hi+U/TeChPWeYdwJojDsFY1xr
|
18
|
+
xvtqbTTL8gbLHz5LW3QD2nfwCv3qTlw0qI3Ie7a9VMJMbSvgVEGEfQirqIgJXWMj
|
19
|
+
eNMDgKsMJtC7u/43abRKx7TCURW3iWyR19NRngsJJmaR51yGGGm2Kfsr+JtKKLtL
|
20
|
+
L188Wm3f13KAx7QJU8qyuBnj1/gWem076hzdA7xi1DbrZrch9GCRz62xymJlrJHn
|
21
|
+
9iZEZ7AxrS7vokhMlzSr/XMUihx/8aFKtk+tMLClqxZSmBWIErWdicCGTULXCBNb
|
22
|
+
E/mljo4zEVKhlTWpJklMIhr55ZRrSarKFuW7en0+tpJrfsYiAmXMJNi4XAYJH7uL
|
23
|
+
rgJuJwSaa/dMz+VmUoo7VKtSfCoOI+6v5/z0sK3oT6sG6ZwyI47DBq2XqNC6tnAj
|
24
|
+
w+XmCywiTQrFzMMAvcA7rPI4F0nU1rZId51rOvvfxaONp+wgTi4P8owZLw0/j0m4
|
25
|
+
8C20DYi6EYx4AHDXiLpElWh3AgMBAAGjgZowgZcwCQYDVR0TBAIwADALBgNVHQ8E
|
26
|
+
BAMCBLAwHQYDVR0OBBYEFB6ZaeWKxQjGTI+pmz7cKRmMIywwMC4GA1UdEQQnMCWB
|
27
|
+
I3NhbXVlbC53aWxsaWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MC4GA1UdEgQnMCWB
|
28
|
+
I3NhbXVlbC53aWxsaWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MA0GCSqGSIb3DQEB
|
29
|
+
CwUAA4IBgQBVoM+pu3dpdUhZM1w051iw5GfiqclAr1Psypf16Tiod/ho//4oAu6T
|
30
|
+
9fj3DPX/acWV9P/FScvqo4Qgv6g4VWO5ZU7z2JmPoTXZtYMunRAmQPFL/gSUc6aK
|
31
|
+
vszMHIyhtyzRc6DnfW2AiVOjMBjaYv8xXZc9bduniRVPrLR4J7ozmGLh4o4uJp7w
|
32
|
+
x9KCFaR8Lvn/r0oJWJOqb/DMAYI83YeN2Dlt3jpwrsmsONrtC5S3gOUle5afSGos
|
33
|
+
bYt5ocnEpKSomR9ZtnCGljds/aeO1Xgpn2r9HHcjwnH346iNrnHmMlC7BtHUFPDg
|
34
|
+
Ts92S47PTOXzwPBDsrFiq3VLbRjHSwf8rpqybQBH9MfzxGGxTaETQYOd6b4e4Ag6
|
35
|
+
y92abGna0bmIEb4+Tx9rQ10Uijh1POzvr/VTH4bbIPy9FbKrRsIQ24qDbNJRtOpE
|
36
|
+
RAOsIl+HOBTb252nx1kIRN5hqQx272AJCbCjKx8egcUQKffFVVCI0nye09v5CK+a
|
37
|
+
HiLJ8VOFx6w=
|
38
|
+
-----END CERTIFICATE-----
|
39
|
+
date: 2022-05-23 00:00:00.000000000 Z
|
12
40
|
dependencies:
|
13
41
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
42
|
+
name: build-files
|
15
43
|
requirement: !ruby/object:Gem::Requirement
|
16
44
|
requirements:
|
17
45
|
- - "~>"
|
18
46
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
47
|
+
version: '1.8'
|
20
48
|
type: :runtime
|
21
49
|
prerelease: false
|
22
50
|
version_requirements: !ruby/object:Gem::Requirement
|
23
51
|
requirements:
|
24
52
|
- - "~>"
|
25
53
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
54
|
+
version: '1.8'
|
27
55
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: build-files
|
56
|
+
name: build-files-monitor
|
29
57
|
requirement: !ruby/object:Gem::Requirement
|
30
58
|
requirements:
|
31
59
|
- - "~>"
|
32
60
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
61
|
+
version: '0.2'
|
34
62
|
type: :runtime
|
35
63
|
prerelease: false
|
36
64
|
version_requirements: !ruby/object:Gem::Requirement
|
37
65
|
requirements:
|
38
66
|
- - "~>"
|
39
67
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
68
|
+
version: '0.2'
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
70
|
name: console
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,6 +80,20 @@ dependencies:
|
|
52
80
|
- - "~>"
|
53
81
|
- !ruby/object:Gem::Version
|
54
82
|
version: '1.1'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: process-group
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.1'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.1'
|
55
97
|
- !ruby/object:Gem::Dependency
|
56
98
|
name: build-makefile
|
57
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,7 +109,7 @@ dependencies:
|
|
67
109
|
- !ruby/object:Gem::Version
|
68
110
|
version: '1.0'
|
69
111
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
112
|
+
name: bundler
|
71
113
|
requirement: !ruby/object:Gem::Requirement
|
72
114
|
requirements:
|
73
115
|
- - ">="
|
@@ -81,7 +123,7 @@ dependencies:
|
|
81
123
|
- !ruby/object:Gem::Version
|
82
124
|
version: '0'
|
83
125
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
126
|
+
name: covered
|
85
127
|
requirement: !ruby/object:Gem::Requirement
|
86
128
|
requirements:
|
87
129
|
- - ">="
|
@@ -95,49 +137,39 @@ dependencies:
|
|
95
137
|
- !ruby/object:Gem::Version
|
96
138
|
version: '0'
|
97
139
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
140
|
+
name: rake
|
99
141
|
requirement: !ruby/object:Gem::Requirement
|
100
142
|
requirements:
|
101
|
-
- - "
|
143
|
+
- - ">="
|
102
144
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
145
|
+
version: '0'
|
104
146
|
type: :development
|
105
147
|
prerelease: false
|
106
148
|
version_requirements: !ruby/object:Gem::Requirement
|
107
149
|
requirements:
|
108
|
-
- - "
|
150
|
+
- - ">="
|
109
151
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
152
|
+
version: '0'
|
111
153
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
154
|
+
name: rspec
|
113
155
|
requirement: !ruby/object:Gem::Requirement
|
114
156
|
requirements:
|
115
|
-
- - "
|
157
|
+
- - "~>"
|
116
158
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
159
|
+
version: '3.4'
|
118
160
|
type: :development
|
119
161
|
prerelease: false
|
120
162
|
version_requirements: !ruby/object:Gem::Requirement
|
121
163
|
requirements:
|
122
|
-
- - "
|
164
|
+
- - "~>"
|
123
165
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
125
|
-
description:
|
126
|
-
It provides graph based build functionality which monitors the file-system for changes.
|
127
|
-
Because of this, it can efficiently manage large and complex process based builds.\n"
|
166
|
+
version: '3.4'
|
167
|
+
description:
|
128
168
|
email:
|
129
|
-
- samuel.williams@oriontransfer.co.nz
|
130
169
|
executables: []
|
131
170
|
extensions: []
|
132
171
|
extra_rdoc_files: []
|
133
172
|
files:
|
134
|
-
- ".gitignore"
|
135
|
-
- ".rspec"
|
136
|
-
- ".travis.yml"
|
137
|
-
- Gemfile
|
138
|
-
- README.md
|
139
|
-
- Rakefile
|
140
|
-
- build-graph.gemspec
|
141
173
|
- lib/build/graph.rb
|
142
174
|
- lib/build/graph/edge.rb
|
143
175
|
- lib/build/graph/node.rb
|
@@ -148,21 +180,27 @@ files:
|
|
148
180
|
- spec/build/graph/edge_spec.rb
|
149
181
|
- spec/build/graph/graph_spec.rb
|
150
182
|
- spec/build/graph/inherit_spec.rb
|
183
|
+
- spec/build/graph/listing.txt
|
151
184
|
- spec/build/graph/node_spec.rb
|
152
185
|
- spec/build/graph/process_graph.rb
|
153
186
|
- spec/build/graph/program/Benchmark.cpp
|
187
|
+
- spec/build/graph/program/Benchmark.cpp.d
|
188
|
+
- spec/build/graph/program/Benchmark.cpp.o
|
154
189
|
- spec/build/graph/program/Benchmark.h
|
155
190
|
- spec/build/graph/program/DictionarySort.h
|
156
191
|
- spec/build/graph/program/ParallelMergeSort.h
|
192
|
+
- spec/build/graph/program/dictionary-sort
|
157
193
|
- spec/build/graph/program/main.cpp
|
194
|
+
- spec/build/graph/program/main.cpp.d
|
195
|
+
- spec/build/graph/program/main.cpp.o
|
158
196
|
- spec/build/graph/task_spec.rb
|
159
197
|
- spec/build/graph/walker_spec.rb
|
160
198
|
- spec/spec_helper.rb
|
161
|
-
homepage:
|
199
|
+
homepage:
|
162
200
|
licenses:
|
163
201
|
- MIT
|
164
202
|
metadata: {}
|
165
|
-
post_install_message:
|
203
|
+
post_install_message:
|
166
204
|
rdoc_options: []
|
167
205
|
require_paths:
|
168
206
|
- lib
|
@@ -177,23 +215,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
215
|
- !ruby/object:Gem::Version
|
178
216
|
version: '0'
|
179
217
|
requirements: []
|
180
|
-
rubygems_version: 3.
|
181
|
-
signing_key:
|
218
|
+
rubygems_version: 3.3.7
|
219
|
+
signing_key:
|
182
220
|
specification_version: 4
|
183
221
|
summary: Build::Graph is a framework for build systems, with specific functionality
|
184
222
|
for dealing with file based processes.
|
185
|
-
test_files:
|
186
|
-
- spec/build/graph/build_test.rb
|
187
|
-
- spec/build/graph/edge_spec.rb
|
188
|
-
- spec/build/graph/graph_spec.rb
|
189
|
-
- spec/build/graph/inherit_spec.rb
|
190
|
-
- spec/build/graph/node_spec.rb
|
191
|
-
- spec/build/graph/process_graph.rb
|
192
|
-
- spec/build/graph/program/Benchmark.cpp
|
193
|
-
- spec/build/graph/program/Benchmark.h
|
194
|
-
- spec/build/graph/program/DictionarySort.h
|
195
|
-
- spec/build/graph/program/ParallelMergeSort.h
|
196
|
-
- spec/build/graph/program/main.cpp
|
197
|
-
- spec/build/graph/task_spec.rb
|
198
|
-
- spec/build/graph/walker_spec.rb
|
199
|
-
- spec/spec_helper.rb
|
223
|
+
test_files: []
|
metadata.gz.sig
ADDED
Binary file
|
data/.gitignore
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
.bundle
|
4
|
-
.config
|
5
|
-
.yardoc
|
6
|
-
Gemfile.lock
|
7
|
-
InstalledFiles
|
8
|
-
_yardoc
|
9
|
-
coverage
|
10
|
-
doc/
|
11
|
-
lib/bundler/man
|
12
|
-
pkg
|
13
|
-
rdoc
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
17
|
-
tmp
|
18
|
-
*.bundle
|
19
|
-
*.so
|
20
|
-
*.o
|
21
|
-
*.a
|
22
|
-
*.d
|
23
|
-
mkmf.log
|
24
|
-
.rspec_status
|
data/.rspec
DELETED
data/.travis.yml
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
dist: xenial
|
3
|
-
cache: bundler
|
4
|
-
|
5
|
-
addons:
|
6
|
-
apt:
|
7
|
-
sources:
|
8
|
-
- ubuntu-toolchain-r-test
|
9
|
-
packages:
|
10
|
-
- libstdc++-4.8-dev
|
11
|
-
|
12
|
-
matrix:
|
13
|
-
include:
|
14
|
-
- rvm: 2.3
|
15
|
-
- rvm: 2.4
|
16
|
-
- rvm: 2.5
|
17
|
-
- rvm: 2.6
|
18
|
-
- rvm: 2.6
|
19
|
-
env: COVERAGE=BriefSummary,Coveralls
|
data/Gemfile
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
# Use local code for testing.
|
4
|
-
# gem "build-files", path: "../build-files"
|
5
|
-
|
6
|
-
# Specify your gem's dependencies in build.gemspec
|
7
|
-
gemspec
|
8
|
-
|
9
|
-
group :test do
|
10
|
-
gem 'rb-fsevent'
|
11
|
-
gem 'rb-inotify'
|
12
|
-
|
13
|
-
gem 'graphviz'
|
14
|
-
end
|
data/README.md
DELETED
@@ -1,99 +0,0 @@
|
|
1
|
-
# Build::Graph
|
2
|
-
|
3
|
-
Build::Graph is a framework for build systems, with specific functionality for dealing with file based processes.
|
4
|
-
|
5
|
-
[![Build Status](https://secure.travis-ci.org/ioquatix/build-graph.svg)](http://travis-ci.org/ioquatix/build-graph)
|
6
|
-
[![Code Climate](https://codeclimate.com/github/ioquatix/build-graph.svg)](https://codeclimate.com/github/ioquatix/build-graph)
|
7
|
-
[![Coverage Status](https://coveralls.io/repos/ioquatix/build-graph/badge.svg)](https://coveralls.io/r/ioquatix/build-graph)
|
8
|
-
|
9
|
-
## Installation
|
10
|
-
|
11
|
-
Add this line to your application's Gemfile:
|
12
|
-
|
13
|
-
gem 'build-graph'
|
14
|
-
|
15
|
-
And then execute:
|
16
|
-
|
17
|
-
$ bundle
|
18
|
-
|
19
|
-
Or install it yourself as:
|
20
|
-
|
21
|
-
$ gem install build-graph
|
22
|
-
|
23
|
-
## Usage
|
24
|
-
|
25
|
-
A build graph is an abstract set of `[input, process, output]` nodes. A node executes it's process within the context of a `Task` which represents a specific set of inputs and outputs and is managed within a `Walker` that walks over graph nodes, regenerating tasks where required. If inputs or outputs change (i.e. become dirty), the old task is nullified.
|
26
|
-
|
27
|
-
A `Walker` is used to traverse the build graph once. As it walks over the graph it builds a set of `Edge` relationships between nodes and only traverses relationships which are complete `Walker#wait_on_paths`. Parent nodes also wait until all their children are complete `Walker#wait_on_nodes` It also keeps track of failures `Walker#failed?` and fails all dependencies of a node.
|
28
|
-
|
29
|
-
A `Task` is instantiated once per node when traversing the graph. The task represents a specific process being applied to the graph, e.g. build, clean, etc. It is responsible for actually performing any real actions and providing the methods to do so. A `Task` contains all details about the specific graph state at that point in time, e.g. `Task#children` and updating the node state in `Task#exit`. Statistics on the build graph are also captured through `Task` and `Walker`, e.g. number of nodes visited, etc.
|
30
|
-
|
31
|
-
### Inputs and Outputs
|
32
|
-
|
33
|
-
Inputs to a node should be all on-disk state and any additional parameters which cause it's behavior to produce different results.
|
34
|
-
|
35
|
-
Outputs from a node should be all files that are generated directly by the processes within the node and sometimes it's children.
|
36
|
-
|
37
|
-
### Dirty Propagation
|
38
|
-
|
39
|
-
A `Node` has a set of `#inputs` and `#outputs` but these are abstract. For example, `#outputs` could be `:inherit` which means that the node symbolically has all the outputs of all it's direct children. A `Task`, at the time of execution, captures it's inputs and outputs and these may be monitored for changes in real time.
|
40
|
-
|
41
|
-
File changes are currently detected using `File::mtime` as this is generally a good trade off between efficiency and accuracy.
|
42
|
-
|
43
|
-
When a task is marked as dirty, it also marks all it's outputs as being dirty, which in cause could mark other tasks as dirty. This is the mechanism for which dirtiness propagates through the graph. The walker should only have to traverse the graph once to build it completely. If multiple updates are required (i.e. buidling one part of the graph implicitly dirties another part of the graph), the specification of the graph is incomplete and this may lead to problems within the build graph.
|
44
|
-
|
45
|
-
### Example Graph
|
46
|
-
|
47
|
-
target("Library/UnitTest", [] -> :inherit) do
|
48
|
-
library([UnitTest.cpp] -> UnitTest.a) do
|
49
|
-
compile([UnitTest.cpp] -> UnitTest.o)
|
50
|
-
link([UnitTest.o] -> libUnitTest.a)
|
51
|
-
end
|
52
|
-
|
53
|
-
copy headers: [UnitTest.hpp]
|
54
|
-
|
55
|
-
# Outputs become libUnitTest.a and UnitTest.hpp
|
56
|
-
end
|
57
|
-
|
58
|
-
target("Executable/UnitTest", [] -> :inherit) do
|
59
|
-
depends("Library/UnitTest")
|
60
|
-
|
61
|
-
executable(main.cpp -> UnitTest) do
|
62
|
-
compile(main.cpp -> main.o)
|
63
|
-
link([main.o, libUnitTest.a] -> UnitTest)
|
64
|
-
end
|
65
|
-
|
66
|
-
# Outputs become UnitTest
|
67
|
-
end
|
68
|
-
|
69
|
-
## Contributing
|
70
|
-
|
71
|
-
1. Fork it
|
72
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
73
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
74
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
75
|
-
5. Create new Pull Request
|
76
|
-
|
77
|
-
## License
|
78
|
-
|
79
|
-
Released under the MIT license.
|
80
|
-
|
81
|
-
Copyright, 2012, 2014, 2016, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams).
|
82
|
-
|
83
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
84
|
-
of this software and associated documentation files (the "Software"), to deal
|
85
|
-
in the Software without restriction, including without limitation the rights
|
86
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
87
|
-
copies of the Software, and to permit persons to whom the Software is
|
88
|
-
furnished to do so, subject to the following conditions:
|
89
|
-
|
90
|
-
The above copyright notice and this permission notice shall be included in
|
91
|
-
all copies or substantial portions of the Software.
|
92
|
-
|
93
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
94
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
95
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
96
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
97
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
98
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
99
|
-
THE SOFTWARE.
|
data/Rakefile
DELETED
data/build-graph.gemspec
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'build/graph/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "build-graph"
|
8
|
-
spec.version = Build::Graph::VERSION
|
9
|
-
spec.authors = ["Samuel Williams"]
|
10
|
-
spec.email = ["samuel.williams@oriontransfer.co.nz"]
|
11
|
-
spec.summary = %q{Build::Graph is a framework for build systems, with specific functionality for dealing with file based processes.}
|
12
|
-
spec.description = <<-EOF
|
13
|
-
Build::Graph is a framework for managing file-system based build processes. It provides graph based build functionality which monitors the file-system for changes. Because of this, it can efficiently manage large and complex process based builds.
|
14
|
-
EOF
|
15
|
-
spec.homepage = ""
|
16
|
-
spec.license = "MIT"
|
17
|
-
|
18
|
-
spec.files = `git ls-files`.split($/)
|
19
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
20
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
21
|
-
spec.require_paths = ["lib"]
|
22
|
-
|
23
|
-
spec.required_ruby_version = '>= 2.0'
|
24
|
-
|
25
|
-
spec.add_dependency "process-group", "~> 1.1"
|
26
|
-
spec.add_dependency "build-files", "~> 1.0"
|
27
|
-
spec.add_dependency "console", "~> 1.1"
|
28
|
-
|
29
|
-
spec.add_development_dependency "build-makefile", "~> 1.0"
|
30
|
-
|
31
|
-
spec.add_development_dependency "covered"
|
32
|
-
spec.add_development_dependency "bundler"
|
33
|
-
spec.add_development_dependency "rspec", "~> 3.4"
|
34
|
-
spec.add_development_dependency "rake"
|
35
|
-
end
|