build 2.6.0 → 2.6.2

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: 0ad08615d58ed88206dd99c9a77400daf263343bf9e00d8c724cc73050abb702
4
- data.tar.gz: 840fde0567eccfce19a4eb3b99219f8aec9d798ca6443a67dafa825bef8c01df
3
+ metadata.gz: 76c69fcd958a49d0cf6a3ab9bda243ae4bace5e42e73d126fbbcaaf315a05b18
4
+ data.tar.gz: eb7f5be1e576b3d00f141bd681819e610a68a196e3634bb1d396aa3cca6dc498
5
5
  SHA512:
6
- metadata.gz: 86a6d619396f7215c3b816a12bfbfb4c6b3aecf57b83ae48a57549cddf94b4ee77d08a41ffcc222241c981d73fb3686b56b23f818044200512c0cfbda70fb61a
7
- data.tar.gz: 99ff73db7486709ab8691d6243bffd28342bce8de5afc0783b90c72a396fccc15bd838e4ddfd8b3d25f212abdaa111d31ae5bf54402cd4a84306e1b7ed640794
6
+ metadata.gz: 35f9975fc06d7d01ca2d03326c44d4a86e0ab4765baaae868df450eb2af06833b347b32f46e4b05919de4a1c35957144f9eacf6a7b6c9c6e93ad727efc5cf550
7
+ data.tar.gz: 11a2f6059d7264aec3cddafc588ebc7778c74f0fd89c734d57c8af8434afc855827033387b86e51b4e3967db9d31202d72428d18745ceac32742c98627431f12
checksums.yaml.gz.sig ADDED
Binary file
@@ -99,10 +99,10 @@ module Build
99
99
  @node.dirty?
100
100
  end
101
101
 
102
- def spawn(*arguments)
102
+ def spawn(*arguments, **options)
103
103
  if wet?
104
- @logger&.info(self) {Console::Event::Spawn.for(*arguments)}
105
- status = @group.spawn(*arguments)
104
+ @logger&.info(self) {Console::Event::Spawn.for(*arguments, **options)}
105
+ status = @group.spawn(*arguments, **options)
106
106
 
107
107
  if status != 0
108
108
  raise CommandFailure.new(self, arguments, status)
@@ -114,28 +114,28 @@ module Build
114
114
  @shell_environment ||= environment.flatten.export
115
115
  end
116
116
 
117
- def run!(*arguments)
118
- self.spawn(shell_environment, *arguments)
117
+ def run!(*arguments, **options)
118
+ self.spawn(shell_environment, *arguments, **options)
119
119
  end
120
120
 
121
121
  def touch(path)
122
122
  return unless wet?
123
123
 
124
- @logger&.info(self) {Console::Shell.for('touch', path)}
124
+ Console::Event::Spawn.for('touch', path).emit(self)
125
125
  FileUtils.touch(path)
126
126
  end
127
127
 
128
128
  def cp(source_path, destination_path)
129
129
  return unless wet?
130
130
 
131
- @logger&.info(self) {Console::Shell.for('cp', source_path, destination_path)}
131
+ Console::Event::Spawn.for('cp', source_path, destination_path).emit(self)
132
132
  FileUtils.copy(source_path, destination_path)
133
133
  end
134
134
 
135
135
  def rm(path)
136
136
  return unless wet?
137
137
 
138
- @logger&.info(self) {Console::Shell.for('rm -rf', path)}
138
+ Console::Event::Spawn.for('rm', '-rf', path).emit(self)
139
139
  FileUtils.rm_rf(path)
140
140
  end
141
141
 
@@ -143,7 +143,7 @@ module Build
143
143
  return unless wet?
144
144
 
145
145
  unless File.exist?(path)
146
- @logger&.info(self) {Console::Shell.for('mkpath', path)}
146
+ Console::Event::Spawn.for('mkdir', '-p', path).emit(self)
147
147
  FileUtils.mkpath(path)
148
148
  end
149
149
  end
@@ -151,14 +151,14 @@ module Build
151
151
  def install(source_path, destination_path)
152
152
  return unless wet?
153
153
 
154
- @logger&.info(self) {Console::Shell.for('install', source_path, destination_path)}
154
+ Console::Event::Spawn.for('install', source_path, destination_path).emit(self)
155
155
  FileUtils.install(source_path, destination_path)
156
156
  end
157
157
 
158
158
  def write(path, data, mode = "w")
159
159
  return unless wet?
160
160
 
161
- @logger&.info(self) {Console::Shell.for("write", path, "#{data.size}bytes")}
161
+ Console::Event::Spawn.for('write', path).emit(self, size: data.size)
162
162
  File.open(path, mode) do |file|
163
163
  file.write(data)
164
164
  end
data/lib/build/version.rb CHANGED
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Build
22
- VERSION = "2.6.0"
22
+ VERSION = "2.6.2"
23
23
  end
data.tar.gz.sig ADDED
Binary file
metadata CHANGED
@@ -1,29 +1,58 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
- cert_chain: []
11
- date: 2019-10-07 00:00:00.000000000 Z
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIE2DCCA0CgAwIBAgIBATANBgkqhkiG9w0BAQsFADBhMRgwFgYDVQQDDA9zYW11
14
+ ZWwud2lsbGlhbXMxHTAbBgoJkiaJk/IsZAEZFg1vcmlvbnRyYW5zZmVyMRIwEAYK
15
+ CZImiZPyLGQBGRYCY28xEjAQBgoJkiaJk/IsZAEZFgJuejAeFw0yMjA4MDYwNDUz
16
+ MjRaFw0zMjA4MDMwNDUzMjRaMGExGDAWBgNVBAMMD3NhbXVlbC53aWxsaWFtczEd
17
+ MBsGCgmSJomT8ixkARkWDW9yaW9udHJhbnNmZXIxEjAQBgoJkiaJk/IsZAEZFgJj
18
+ bzESMBAGCgmSJomT8ixkARkWAm56MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIB
19
+ igKCAYEAomvSopQXQ24+9DBB6I6jxRI2auu3VVb4nOjmmHq7XWM4u3HL+pni63X2
20
+ 9qZdoq9xt7H+RPbwL28LDpDNflYQXoOhoVhQ37Pjn9YDjl8/4/9xa9+NUpl9XDIW
21
+ sGkaOY0eqsQm1pEWkHJr3zn/fxoKPZPfaJOglovdxf7dgsHz67Xgd/ka+Wo1YqoE
22
+ e5AUKRwUuvaUaumAKgPH+4E4oiLXI4T1Ff5Q7xxv6yXvHuYtlMHhYfgNn8iiW8WN
23
+ XibYXPNP7NtieSQqwR/xM6IRSoyXKuS+ZNGDPUUGk8RoiV/xvVN4LrVm9upSc0ss
24
+ RZ6qwOQmXCo/lLcDUxJAgG95cPw//sI00tZan75VgsGzSWAOdjQpFM0l4dxvKwHn
25
+ tUeT3ZsAgt0JnGqNm2Bkz81kG4A2hSyFZTFA8vZGhp+hz+8Q573tAR89y9YJBdYM
26
+ zp0FM4zwMNEUwgfRzv1tEVVUEXmoFCyhzonUUw4nE4CFu/sE3ffhjKcXcY//qiSW
27
+ xm4erY3XAgMBAAGjgZowgZcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O
28
+ BBYEFO9t7XWuFf2SKLmuijgqR4sGDlRsMC4GA1UdEQQnMCWBI3NhbXVlbC53aWxs
29
+ aWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MC4GA1UdEgQnMCWBI3NhbXVlbC53aWxs
30
+ aWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MA0GCSqGSIb3DQEBCwUAA4IBgQB5sxkE
31
+ cBsSYwK6fYpM+hA5B5yZY2+L0Z+27jF1pWGgbhPH8/FjjBLVn+VFok3CDpRqwXCl
32
+ xCO40JEkKdznNy2avOMra6PFiQyOE74kCtv7P+Fdc+FhgqI5lMon6tt9rNeXmnW/
33
+ c1NaMRdxy999hmRGzUSFjozcCwxpy/LwabxtdXwXgSay4mQ32EDjqR1TixS1+smp
34
+ 8C/NCWgpIfzpHGJsjvmH2wAfKtTTqB9CVKLCWEnCHyCaRVuKkrKjqhYCdmMBqCws
35
+ JkxfQWC+jBVeG9ZtPhQgZpfhvh+6hMhraUYRQ6XGyvBqEUe+yo6DKIT3MtGE2+CP
36
+ eX9i9ZWBydWb8/rvmwmX2kkcBbX0hZS1rcR593hGc61JR6lvkGYQ2MYskBveyaxt
37
+ Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
38
+ voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
39
+ -----END CERTIFICATE-----
40
+ date: 2024-07-23 00:00:00.000000000 Z
12
41
  dependencies:
13
42
  - !ruby/object:Gem::Dependency
14
- name: build-graph
43
+ name: build-dependency
15
44
  requirement: !ruby/object:Gem::Requirement
16
45
  requirements:
17
46
  - - "~>"
18
47
  - !ruby/object:Gem::Version
19
- version: '2.1'
48
+ version: '1.5'
20
49
  type: :runtime
21
50
  prerelease: false
22
51
  version_requirements: !ruby/object:Gem::Requirement
23
52
  requirements:
24
53
  - - "~>"
25
54
  - !ruby/object:Gem::Version
26
- version: '2.1'
55
+ version: '1.5'
27
56
  - !ruby/object:Gem::Dependency
28
57
  name: build-environment
29
58
  requirement: !ruby/object:Gem::Requirement
@@ -39,19 +68,19 @@ dependencies:
39
68
  - !ruby/object:Gem::Version
40
69
  version: '1.12'
41
70
  - !ruby/object:Gem::Dependency
42
- name: build-dependency
71
+ name: build-graph
43
72
  requirement: !ruby/object:Gem::Requirement
44
73
  requirements:
45
74
  - - "~>"
46
75
  - !ruby/object:Gem::Version
47
- version: '1.5'
76
+ version: '2.1'
48
77
  type: :runtime
49
78
  prerelease: false
50
79
  version_requirements: !ruby/object:Gem::Requirement
51
80
  requirements:
52
81
  - - "~>"
53
82
  - !ruby/object:Gem::Version
54
- version: '1.5'
83
+ version: '2.1'
55
84
  - !ruby/object:Gem::Dependency
56
85
  name: build-makefile
57
86
  requirement: !ruby/object:Gem::Requirement
@@ -67,7 +96,7 @@ dependencies:
67
96
  - !ruby/object:Gem::Version
68
97
  version: '1.0'
69
98
  - !ruby/object:Gem::Dependency
70
- name: graphviz
99
+ name: console
71
100
  requirement: !ruby/object:Gem::Requirement
72
101
  requirements:
73
102
  - - "~>"
@@ -81,7 +110,7 @@ dependencies:
81
110
  - !ruby/object:Gem::Version
82
111
  version: '1.0'
83
112
  - !ruby/object:Gem::Dependency
84
- name: console
113
+ name: graphviz
85
114
  requirement: !ruby/object:Gem::Requirement
86
115
  requirements:
87
116
  - - "~>"
@@ -95,7 +124,7 @@ dependencies:
95
124
  - !ruby/object:Gem::Version
96
125
  version: '1.0'
97
126
  - !ruby/object:Gem::Dependency
98
- name: covered
127
+ name: bundler
99
128
  requirement: !ruby/object:Gem::Requirement
100
129
  requirements:
101
130
  - - ">="
@@ -109,7 +138,7 @@ dependencies:
109
138
  - !ruby/object:Gem::Version
110
139
  version: '0'
111
140
  - !ruby/object:Gem::Dependency
112
- name: bundler
141
+ name: covered
113
142
  requirement: !ruby/object:Gem::Requirement
114
143
  requirements:
115
144
  - - ">="
@@ -123,48 +152,39 @@ dependencies:
123
152
  - !ruby/object:Gem::Version
124
153
  version: '0'
125
154
  - !ruby/object:Gem::Dependency
126
- name: rspec
155
+ name: rake
127
156
  requirement: !ruby/object:Gem::Requirement
128
157
  requirements:
129
- - - "~>"
158
+ - - ">="
130
159
  - !ruby/object:Gem::Version
131
- version: '3.6'
160
+ version: '0'
132
161
  type: :development
133
162
  prerelease: false
134
163
  version_requirements: !ruby/object:Gem::Requirement
135
164
  requirements:
136
- - - "~>"
165
+ - - ">="
137
166
  - !ruby/object:Gem::Version
138
- version: '3.6'
167
+ version: '0'
139
168
  - !ruby/object:Gem::Dependency
140
- name: rake
169
+ name: rspec
141
170
  requirement: !ruby/object:Gem::Requirement
142
171
  requirements:
143
- - - ">="
172
+ - - "~>"
144
173
  - !ruby/object:Gem::Version
145
- version: '0'
174
+ version: '3.6'
146
175
  type: :development
147
176
  prerelease: false
148
177
  version_requirements: !ruby/object:Gem::Requirement
149
178
  requirements:
150
- - - ">="
179
+ - - "~>"
151
180
  - !ruby/object:Gem::Version
152
- version: '0'
153
- description:
181
+ version: '3.6'
182
+ description:
154
183
  email:
155
- - samuel.williams@oriontransfer.co.nz
156
184
  executables: []
157
185
  extensions: []
158
186
  extra_rdoc_files: []
159
187
  files:
160
- - ".gitignore"
161
- - ".rspec"
162
- - ".travis.yml"
163
- - Gemfile
164
- - Gemfile.local
165
- - README.md
166
- - Rakefile
167
- - build.gemspec
168
188
  - lib/build.rb
169
189
  - lib/build/build_node.rb
170
190
  - lib/build/chain_node.rb
@@ -178,17 +198,11 @@ files:
178
198
  - lib/build/rulebook.rb
179
199
  - lib/build/task.rb
180
200
  - lib/build/version.rb
181
- - spec/build/controller_spec.rb
182
- - spec/build/name_spec.rb
183
- - spec/build/rule_spec.rb
184
- - spec/build/rulebook_spec.rb
185
- - spec/build/target.rb
186
- - spec/spec_helper.rb
187
- homepage: ''
201
+ homepage: https://github.com/kurocha/build
188
202
  licenses:
189
203
  - MIT
190
204
  metadata: {}
191
- post_install_message:
205
+ post_install_message:
192
206
  rdoc_options: []
193
207
  require_paths:
194
208
  - lib
@@ -203,14 +217,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
217
  - !ruby/object:Gem::Version
204
218
  version: '0'
205
219
  requirements: []
206
- rubygems_version: 3.0.4
207
- signing_key:
220
+ rubygems_version: 3.5.11
221
+ signing_key:
208
222
  specification_version: 4
209
- summary: Build is a framework for working with task based build systems.
210
- test_files:
211
- - spec/build/controller_spec.rb
212
- - spec/build/name_spec.rb
213
- - spec/build/rule_spec.rb
214
- - spec/build/rulebook_spec.rb
215
- - spec/build/target.rb
216
- - spec/spec_helper.rb
223
+ summary: Build is a framework for creating task based build systems.
224
+ test_files: []
metadata.gz.sig ADDED
Binary file
data/.gitignore DELETED
@@ -1,23 +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
- mkmf.log
23
- .rspec_status
data/.rspec DELETED
@@ -1,4 +0,0 @@
1
- --format documentation
2
- --backtrace
3
- --warnings
4
- --require spec_helper
data/.travis.yml DELETED
@@ -1,12 +0,0 @@
1
- language: ruby
2
- dist: xenial
3
- cache: bundler
4
-
5
- matrix:
6
- include:
7
- - rvm: 2.3
8
- - rvm: 2.4
9
- - rvm: 2.5
10
- - rvm: 2.6
11
- - rvm: 2.6
12
- env: COVERAGE=BriefSummary,Coveralls
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in build.gemspec
4
- gemspec
data/Gemfile.local DELETED
@@ -1,24 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in build.gemspec
4
- gemspec
5
-
6
- group :development do
7
- gem 'pry'
8
- gem 'pry-coolline'
9
-
10
- gem 'build-environment', path: '../build-environment'
11
- gem 'build-files', path: '../build-files'
12
- gem 'build-graph', path: '../build-graph'
13
- gem 'build-makefile', path: '../build-makefile'
14
-
15
- gem 'process-daemon', path: '../process-daemon'
16
- gem 'process-group', path: '../process-group'
17
-
18
- gem 'graphviz', path: '../graphviz'
19
- end
20
-
21
- group :test do
22
- gem 'simplecov'
23
- gem 'coveralls', require: false
24
- end
data/README.md DELETED
@@ -1,57 +0,0 @@
1
- # Build
2
-
3
- Build is a ruby gem providing systems for building task driven build systems similar to make.
4
-
5
- [![Build Status](https://secure.travis-ci.org/ioquatix/build.svg)](http://travis-ci.org/ioquatix/build)
6
- [![Code Climate](https://codeclimate.com/github/ioquatix/build.svg)](https://codeclimate.com/github/ioquatix/build)
7
- [![Coverage Status](https://coveralls.io/repos/ioquatix/build/badge.svg)](https://coveralls.io/r/ioquatix/build)
8
-
9
- ## Installation
10
-
11
- Add this line to your application's Gemfile:
12
-
13
- gem 'build'
14
-
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install build
22
-
23
- ## Usage
24
-
25
- This gem is a container for `build-files` and `build-graph`.
26
-
27
- ## Contributing
28
-
29
- 1. Fork it
30
- 2. Create your feature branch (`git checkout -b my-new-feature`)
31
- 3. Commit your changes (`git commit -am 'Add some feature'`)
32
- 4. Push to the branch (`git push origin my-new-feature`)
33
- 5. Create new Pull Request
34
-
35
- ## License
36
-
37
- Released under the MIT license.
38
-
39
- Copyright, 2015, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams).
40
-
41
- Permission is hereby granted, free of charge, to any person obtaining a copy
42
- of this software and associated documentation files (the "Software"), to deal
43
- in the Software without restriction, including without limitation the rights
44
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
45
- copies of the Software, and to permit persons to whom the Software is
46
- furnished to do so, subject to the following conditions:
47
-
48
- The above copyright notice and this permission notice shall be included in
49
- all copies or substantial portions of the Software.
50
-
51
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
52
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
53
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
54
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
55
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
56
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
57
- THE SOFTWARE.
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
-
2
- require "bundler/gem_tasks"
3
- require "rspec/core/rake_task"
4
-
5
- # Load all rake tasks:
6
- import(*Dir.glob('tasks/**/*.rake'))
7
-
8
- RSpec::Core::RakeTask.new(:spec)
9
-
10
- task :default => :spec
data/build.gemspec DELETED
@@ -1,32 +0,0 @@
1
-
2
- require_relative 'lib/build/version'
3
-
4
- Gem::Specification.new do |spec|
5
- spec.name = "build"
6
- spec.version = Build::VERSION
7
- spec.authors = ["Samuel Williams"]
8
- spec.email = ["samuel.williams@oriontransfer.co.nz"]
9
- spec.summary = %q{Build is a framework for working with task based build systems.}
10
- spec.homepage = ""
11
- spec.license = "MIT"
12
-
13
- spec.files = `git ls-files -z`.split("\x0")
14
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
15
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
16
- spec.require_paths = ["lib"]
17
-
18
- spec.required_ruby_version = '>= 2.0'
19
-
20
- spec.add_dependency "build-graph", "~> 2.1"
21
- spec.add_dependency "build-environment", "~> 1.12"
22
- spec.add_dependency "build-dependency", "~> 1.5"
23
- spec.add_dependency "build-makefile", "~> 1.0"
24
-
25
- spec.add_dependency "graphviz", "~> 1.0"
26
- spec.add_dependency "console", "~> 1.0"
27
-
28
- spec.add_development_dependency "covered"
29
- spec.add_development_dependency "bundler"
30
- spec.add_development_dependency "rspec", "~> 3.6"
31
- spec.add_development_dependency "rake"
32
- end
@@ -1,129 +0,0 @@
1
- #!/usr/bin/env rspec
2
-
3
- # Copyright, 2015, by Samuel G. D. Williams. <http://www.codeotaku.com>
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- # THE SOFTWARE.
22
-
23
- require 'build/rulebook'
24
- require 'build/controller'
25
-
26
- require_relative 'target'
27
-
28
- RSpec.describe Build::Controller do
29
- let(:base) {Build::Environment.new(name: "base")}
30
-
31
- context "failure exit status" do
32
- let(:make_target) do
33
- Target.new("make") do |target|
34
- target.provides "make" do
35
- define Build::Rule, "make.file" do
36
- output :destination
37
-
38
- apply do |parameters|
39
- run! "exit -1"
40
- end
41
- end
42
- end
43
- end
44
- end
45
-
46
- let(:build_target) do
47
- Target.new("foo") do |target|
48
- target.depends "make"
49
-
50
- target.provides "foo" do
51
- foo_path = Build::Files::Path['foo']
52
-
53
- make destination: foo_path
54
- end
55
- end
56
- end
57
-
58
- it "build graph should fail" do
59
- chain = Build::Dependency::Chain.expand(["foo"], [make_target, build_target])
60
-
61
- controller = Build::Controller.new do |controller|
62
- controller.add_chain(chain, [], base)
63
- end
64
-
65
- controller.logger.level = Logger::DEBUG
66
-
67
- controller.update
68
-
69
- expect(controller.failed?).to be_truthy
70
- end
71
- end
72
-
73
- context "copying files" do
74
- let(:files_target) do
75
- Target.new("files") do |target|
76
- target.provides "files" do
77
- define Build::Rule, "make.file" do
78
- output :destination
79
-
80
- apply do |parameters|
81
- run! 'sleep 0.1'
82
- touch parameters[:destination]
83
- end
84
- end
85
-
86
- define Build::Rule, "copy.file" do
87
- input :source
88
- output :destination
89
-
90
- apply do |parameters|
91
- cp parameters[:source], parameters[:destination]
92
- end
93
- end
94
- end
95
- end
96
- end
97
-
98
- let(:build_target) do
99
- Target.new("build") do |target|
100
- target.depends "files"
101
-
102
- target.provides "foo" do
103
- foo_path = Build::Files::Path['foo']
104
- bar_path = Build::Files::Path['bar']
105
-
106
- make destination: foo_path
107
- copy source: foo_path, destination: bar_path
108
- end
109
- end
110
- end
111
-
112
- it "should execute the build graph" do
113
- chain = Build::Dependency::Chain.expand(["foo"], [files_target, build_target])
114
-
115
- controller = Build::Controller.new do |controller|
116
- controller.add_chain(chain, [], base)
117
- end
118
-
119
- expect(controller.nodes.size).to be 1
120
-
121
- controller.update
122
-
123
- expect(File).to be_exist('foo')
124
- expect(File).to be_exist('bar')
125
-
126
- FileUtils.rm ['foo', 'bar']
127
- end
128
- end
129
- end
@@ -1,52 +0,0 @@
1
- # Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
20
-
21
- require 'build/name'
22
-
23
- RSpec.describe Build::Name do
24
- let(:name) {Build::Name.new('Foo Bar')}
25
- it "retains the original text" do
26
- expect(name.text).to be == 'Foo Bar'
27
- end
28
-
29
- it "should generate useful identifiers" do
30
- expect(name.identifier).to be == 'FooBar'
31
- end
32
-
33
- it "should generate useful target names" do
34
- expect(name.target).to be == 'foo-bar'
35
- end
36
-
37
- it "should generate useful key names" do
38
- expect(name.key('executable')).to be == 'foo_bar_executable'
39
- end
40
-
41
- it "should generate useful macro names" do
42
- expect(name.macro).to be == 'FOO_BAR'
43
- end
44
-
45
- it "should generate useful macro names" do
46
- expect(name.macro).to be == 'FOO_BAR'
47
- end
48
-
49
- it "can be constructed from target name" do
50
- expect(Build::Name.from_target(name.target).text).to be == name.text
51
- end
52
- end
@@ -1,53 +0,0 @@
1
- # Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
20
-
21
- require 'build/rule'
22
-
23
- RSpec.describe Build::Rule do
24
- it "should validate input and output parameters" do
25
- rule = Build::Rule.new("compile", "cpp")
26
-
27
- rule.input :source
28
- rule.output :destination
29
-
30
- expect(rule.parameters.size).to be 2
31
-
32
- expect(rule.applicable?(source: 'foo', destination: 'bar')).to be_truthy
33
- expect(rule.applicable?(source: 'foo')).to be_falsey
34
- end
35
-
36
- it "respects false argument" do
37
- rule = Build::Rule.new("compile", "cpp")
38
-
39
- rule.parameter :install, default: true
40
-
41
- expect(
42
- rule.normalize({}, binding)
43
- ).to be == {install: true}
44
-
45
- expect(
46
- rule.normalize({install: true}, binding)
47
- ).to be == {install: true}
48
-
49
- expect(
50
- rule.normalize({install: false}, binding)
51
- ).to be == {install: false}
52
- end
53
- end
@@ -1,52 +0,0 @@
1
- # Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
20
-
21
- require 'build/environment'
22
- require 'build/rulebook'
23
-
24
- RSpec.describe Build::Rulebook do
25
- it "should generate a valid rulebook" do
26
- environment = Build::Environment.new do
27
- define Build::Rule, "copy.file" do
28
- input :source
29
- output :destination
30
-
31
- apply do |parameters|
32
- cp parameters[:source], parameters[:destination]
33
- end
34
- end
35
-
36
- define Build::Rule, "delete.file" do
37
- input :target
38
-
39
- apply do |parameters|
40
- rm parameters[:target]
41
- end
42
- end
43
- end
44
-
45
- rulebook = Build::Rulebook.for(environment.flatten)
46
-
47
- expect(rulebook.rules.size).to be 2
48
-
49
- expect(rulebook.rules).to be_include 'copy.file'
50
- expect(rulebook.rules).to be_include 'delete.file'
51
- end
52
- end
data/spec/build/target.rb DELETED
@@ -1,20 +0,0 @@
1
-
2
- require 'build/dependency'
3
-
4
- class Target
5
- include Build::Dependency
6
-
7
- def initialize(name = nil)
8
- @name = name
9
-
10
- if block_given?
11
- yield self
12
- end
13
- end
14
-
15
- attr :name
16
-
17
- def inspect
18
- "\#<#{self.class}: #{@name}>"
19
- end
20
- end
data/spec/spec_helper.rb DELETED
@@ -1,12 +0,0 @@
1
-
2
- require 'covered/rspec'
3
- require 'build'
4
-
5
- RSpec.configure do |config|
6
- # Enable flags like --only-failures and --next-failure
7
- config.example_status_persistence_file_path = ".rspec_status"
8
-
9
- config.expect_with :rspec do |c|
10
- c.syntax = :expect
11
- end
12
- end