autoproj 2.9.0 → 2.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +113 -0
- data/.travis.yml +0 -2
- data/Gemfile +1 -0
- data/README.md +59 -14
- data/bin/autoproj_bootstrap +21 -12
- data/bin/autoproj_bootstrap.in +2 -2
- data/bin/autoproj_install +21 -12
- data/bin/autoproj_install.in +2 -2
- data/lib/autoproj/aruba_minitest.rb +4 -4
- data/lib/autoproj/autobuild_extensions/dsl.rb +91 -70
- data/lib/autoproj/autobuild_extensions/package.rb +20 -1
- data/lib/autoproj/build_option.rb +24 -7
- data/lib/autoproj/cli/base.rb +12 -1
- data/lib/autoproj/cli/bootstrap.rb +9 -3
- data/lib/autoproj/cli/build.rb +17 -13
- data/lib/autoproj/cli/envsh.rb +1 -1
- data/lib/autoproj/cli/exec.rb +5 -7
- data/lib/autoproj/cli/main.rb +44 -9
- data/lib/autoproj/cli/main_test.rb +2 -0
- data/lib/autoproj/cli/test.rb +29 -6
- data/lib/autoproj/cli/version.rb +52 -0
- data/lib/autoproj/cli/versions.rb +4 -1
- data/lib/autoproj/cli/watch.rb +2 -1
- data/lib/autoproj/configuration.rb +49 -11
- data/lib/autoproj/default.osdeps +9 -0
- data/lib/autoproj/manifest.rb +6 -6
- data/lib/autoproj/ops/build.rb +5 -15
- data/lib/autoproj/ops/import.rb +22 -3
- data/lib/autoproj/ops/install.rb +19 -10
- data/lib/autoproj/ops/main_config_switcher.rb +12 -6
- data/lib/autoproj/ops/snapshot.rb +5 -1
- data/lib/autoproj/os_package_resolver.rb +245 -209
- data/lib/autoproj/package_selection.rb +18 -0
- data/lib/autoproj/reporter.rb +45 -31
- data/lib/autoproj/test.rb +107 -56
- data/lib/autoproj/version.rb +1 -1
- data/lib/autoproj/workspace.rb +90 -72
- data/shell/completion/amake_bash +1 -0
- data/shell/completion/amake_zsh +1 -0
- data/shell/completion/autoproj_bash +2 -0
- data/shell/completion/autoproj_zsh +2 -0
- metadata +5 -3
@@ -50,6 +50,24 @@ def empty?
|
|
50
50
|
selection.empty?
|
51
51
|
end
|
52
52
|
|
53
|
+
# Test if a package is in the ignore list
|
54
|
+
#
|
55
|
+
# @param [String] pkg_name Name of the package
|
56
|
+
# @return [Bool] true, if package is in the ignore list, false
|
57
|
+
# otherwise
|
58
|
+
def ignored?(pkg_name)
|
59
|
+
ignores.include?(pkg_name)
|
60
|
+
end
|
61
|
+
|
62
|
+
# Test if a package is in the exclusions list
|
63
|
+
#
|
64
|
+
# @param [String] pkg_name Name of the package
|
65
|
+
# @return [Bool] true, if package is in the exclusion list, false
|
66
|
+
# otherwise
|
67
|
+
def excluded?(pkg_name)
|
68
|
+
exclusions.include?(pkg_name)
|
69
|
+
end
|
70
|
+
|
53
71
|
# Returns the source packages selected explicitely or through
|
54
72
|
# dependencies
|
55
73
|
#
|
data/lib/autoproj/reporter.rb
CHANGED
@@ -15,6 +15,14 @@ def self.silent(&block)
|
|
15
15
|
Autobuild.silent(&block)
|
16
16
|
end
|
17
17
|
|
18
|
+
def self.not_silent
|
19
|
+
silent = Autobuild.silent?
|
20
|
+
Autobuild.silent = false
|
21
|
+
yield
|
22
|
+
ensure
|
23
|
+
Autobuild.silent = silent
|
24
|
+
end
|
25
|
+
|
18
26
|
def self.message(*args)
|
19
27
|
Autobuild.message(*args)
|
20
28
|
end
|
@@ -43,10 +51,12 @@ def self.report_interrupt(io = STDERR)
|
|
43
51
|
class Reporter < Autobuild::Reporter
|
44
52
|
def error(error)
|
45
53
|
error_lines = error.to_s.split("\n")
|
46
|
-
Autoproj.
|
47
|
-
|
48
|
-
|
49
|
-
|
54
|
+
Autoproj.not_silent do
|
55
|
+
Autoproj.message("Command failed", :bold, :red, STDERR)
|
56
|
+
Autoproj.message(error_lines.shift.to_s, :bold, :red, STDERR)
|
57
|
+
error_lines.each do |line|
|
58
|
+
Autoproj.message line, STDERR
|
59
|
+
end
|
50
60
|
end
|
51
61
|
end
|
52
62
|
|
@@ -56,6 +66,7 @@ def reset_timer
|
|
56
66
|
|
57
67
|
def elapsed_time
|
58
68
|
return unless @timer_start
|
69
|
+
|
59
70
|
secs = Time.now - @timer_start
|
60
71
|
return if secs < 1
|
61
72
|
|
@@ -63,6 +74,7 @@ def elapsed_time
|
|
63
74
|
if secs > 0
|
64
75
|
secs, n = secs.divmod(count)
|
65
76
|
next if (val = n.to_i) == 0
|
77
|
+
|
66
78
|
"#{val} #{val > 1 ? name + 's' : name}"
|
67
79
|
end
|
68
80
|
end.compact.reverse.join(' ')
|
@@ -70,7 +82,8 @@ def elapsed_time
|
|
70
82
|
|
71
83
|
def success
|
72
84
|
elapsed_string = elapsed_time ? " (took #{elapsed_time})" : ''
|
73
|
-
Autoproj.message("Command finished successfully at
|
85
|
+
Autoproj.message("Command finished successfully at "\
|
86
|
+
"#{Time.now}#{elapsed_string}", :bold, :green)
|
74
87
|
if Autobuild.post_success_message
|
75
88
|
Autoproj.message Autobuild.post_success_message
|
76
89
|
end
|
@@ -79,57 +92,58 @@ def success
|
|
79
92
|
|
80
93
|
def self.report(root_dir: nil, silent: nil, debug: Autobuild.debug,
|
81
94
|
on_package_success: :report,
|
82
|
-
on_package_failures: Autobuild::Reporting
|
95
|
+
on_package_failures: Autobuild::Reporting
|
96
|
+
.default_report_on_package_failures)
|
83
97
|
reporter = Autoproj::Reporter.new
|
84
98
|
Autobuild::Reporting << reporter
|
85
99
|
interrupted = nil
|
86
100
|
|
87
|
-
|
101
|
+
unless silent.nil?
|
88
102
|
on_package_success = silent ? :silent : :report
|
89
103
|
end
|
90
|
-
silent_errors = [
|
91
|
-
|
92
|
-
package_failures =
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
104
|
+
silent_errors = %I[report_silent exit_silent].include?(on_package_failures)
|
105
|
+
|
106
|
+
package_failures =
|
107
|
+
Autobuild::Reporting.report(on_package_failures: :report_silent) do
|
108
|
+
begin
|
109
|
+
reporter.reset_timer
|
110
|
+
yield
|
111
|
+
rescue Interrupt => e
|
112
|
+
interrupted = e
|
113
|
+
end
|
98
114
|
end
|
99
|
-
end
|
100
115
|
|
101
116
|
|
102
117
|
if package_failures.empty?
|
103
|
-
if interrupted
|
104
|
-
|
105
|
-
|
106
|
-
Autobuild::Reporting.success
|
107
|
-
end
|
118
|
+
raise interrupted if interrupted
|
119
|
+
|
120
|
+
Autobuild::Reporting.success if on_package_success == :report
|
108
121
|
return []
|
109
122
|
else
|
110
|
-
Autobuild::Reporting.report_finish_on_error(
|
111
|
-
|
123
|
+
Autobuild::Reporting.report_finish_on_error(package_failures,
|
124
|
+
on_package_failures: on_package_failures,
|
125
|
+
interrupted_by: interrupted)
|
112
126
|
end
|
113
|
-
|
114
127
|
rescue CLI::CLIException, InvalidWorkspace, ConfigError => e
|
115
128
|
if silent_errors
|
116
|
-
|
129
|
+
[e]
|
117
130
|
elsif on_package_failures == :raise
|
118
131
|
raise e
|
119
132
|
elsif on_package_failures == :report
|
120
|
-
Autoproj.
|
133
|
+
Autoproj.not_silent do
|
134
|
+
Autoproj.error e.message
|
135
|
+
end
|
121
136
|
[e]
|
122
137
|
elsif on_package_failures == :exit
|
123
|
-
Autoproj.
|
138
|
+
Autoproj.not_silent do
|
139
|
+
Autoproj.error e.message
|
140
|
+
end
|
124
141
|
exit 1
|
125
142
|
end
|
126
|
-
|
127
143
|
rescue SystemExit
|
128
144
|
raise
|
129
145
|
ensure
|
130
|
-
if !silent_errors && interrupted
|
131
|
-
report_interrupt
|
132
|
-
end
|
146
|
+
report_interrupt if !silent_errors && interrupted
|
133
147
|
|
134
148
|
Autobuild::Reporting.remove(reporter) if reporter
|
135
149
|
end
|
data/lib/autoproj/test.rb
CHANGED
@@ -55,6 +55,14 @@ module SelfTest
|
|
55
55
|
attr_reader :ws
|
56
56
|
|
57
57
|
def setup
|
58
|
+
if ENV['AUTOPROJ_CURRENT_ROOT']
|
59
|
+
raise "cannot have a workspace's env.sh loaded while running the "\
|
60
|
+
"Autoproj test suite"
|
61
|
+
end
|
62
|
+
|
63
|
+
if defined?(Autoproj::CLI::Main)
|
64
|
+
Autoproj::CLI::Main.default_report_on_package_failures = :raise
|
65
|
+
end
|
58
66
|
FileUtils.rm_rf fixture_gem_home
|
59
67
|
@gem_server_pid = nil
|
60
68
|
@tmpdir = Array.new
|
@@ -75,11 +83,15 @@ def teardown
|
|
75
83
|
Autobuild::Package.clear
|
76
84
|
Autoproj.silent = false
|
77
85
|
|
78
|
-
if @gem_server_pid
|
79
|
-
stop_gem_server
|
80
|
-
end
|
86
|
+
stop_gem_server if @gem_server_pid
|
81
87
|
|
82
88
|
FileUtils.rm_rf fixture_gem_home
|
89
|
+
if defined?(Autoproj::CLI::Main)
|
90
|
+
Autoproj::CLI::Main.default_report_on_package_failures = nil
|
91
|
+
end
|
92
|
+
if ENV.delete('AUTOPROJ_CURRENT_ROOT')
|
93
|
+
raise "AUTOPROJ_CURRENT_ROOT has been set by this test !!!!"
|
94
|
+
end
|
83
95
|
end
|
84
96
|
|
85
97
|
def create_bootstrap
|
@@ -102,9 +114,7 @@ def scripts_dir
|
|
102
114
|
|
103
115
|
def find_gem_dir(gem_name)
|
104
116
|
Bundler.definition.specs.each do |spec|
|
105
|
-
if spec.name == gem_name
|
106
|
-
return spec
|
107
|
-
end
|
117
|
+
return spec if spec.name == gem_name
|
108
118
|
end
|
109
119
|
nil
|
110
120
|
end
|
@@ -119,22 +129,21 @@ def autoproj_gemfile_to_local_checkout
|
|
119
129
|
end
|
120
130
|
|
121
131
|
def invoke_test_script(name, *arguments,
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
132
|
+
dir: nil,
|
133
|
+
gemfile_source: nil,
|
134
|
+
use_autoproj_from_rubygems: (ENV['USE_AUTOPROJ_FROM_RUBYGEMS'] == '1'),
|
135
|
+
interactive: true,
|
136
|
+
seed_config: File.join(scripts_dir, 'seed-config.yml'),
|
137
|
+
env: Hash.new, display_output: false, copy_from: nil,
|
138
|
+
**system_options)
|
139
|
+
package_base_dir = File.expand_path(File.join('..', '..'), __dir__)
|
140
|
+
|
129
141
|
script = File.expand_path(name, scripts_dir)
|
130
|
-
|
142
|
+
unless File.file?(script)
|
131
143
|
raise ArgumentError, "no test script #{name} in #{scripts_dir}"
|
132
144
|
end
|
133
145
|
|
134
|
-
if seed_config
|
135
|
-
arguments << '--seed-config' << seed_config
|
136
|
-
end
|
137
|
-
|
146
|
+
arguments << '--seed-config' << seed_config if seed_config
|
138
147
|
dir ||= make_tmpdir
|
139
148
|
|
140
149
|
if gemfile_source || !use_autoproj_from_rubygems
|
@@ -145,6 +154,8 @@ def invoke_test_script(name, *arguments,
|
|
145
154
|
arguments << "--gemfile" << gemfile_path << "--gem-source" << "http://localhost:8808"
|
146
155
|
end
|
147
156
|
|
157
|
+
arguments << "--no-interactive" unless interactive
|
158
|
+
|
148
159
|
if copy_from
|
149
160
|
test_workspace = File.expand_path(copy_from, scripts_dir)
|
150
161
|
if File.directory?(test_workspace)
|
@@ -155,13 +166,13 @@ def invoke_test_script(name, *arguments,
|
|
155
166
|
result = nil
|
156
167
|
stdout, stderr = capture_subprocess_io do
|
157
168
|
default_env = Hash[
|
158
|
-
'TEST_COMMAND_NAME' =>
|
169
|
+
'TEST_COMMAND_NAME' => to_s.gsub(/[^\w]/, '_'),
|
159
170
|
'PACKAGE_BASE_DIR' => package_base_dir,
|
160
171
|
'RUBY' => Gem.ruby
|
161
172
|
]
|
162
173
|
result = Bundler.clean_system(
|
163
|
-
default_env.merge(env),
|
164
|
-
|
174
|
+
default_env.merge(env), script, *arguments,
|
175
|
+
in: :close, **Hash[chdir: dir].merge(system_options))
|
165
176
|
end
|
166
177
|
|
167
178
|
if !result
|
@@ -172,7 +183,7 @@ def invoke_test_script(name, *arguments,
|
|
172
183
|
puts stdout
|
173
184
|
puts stderr
|
174
185
|
end
|
175
|
-
|
186
|
+
[dir, stdout, stderr]
|
176
187
|
end
|
177
188
|
|
178
189
|
def fixture_gem_home
|
@@ -181,20 +192,29 @@ def fixture_gem_home
|
|
181
192
|
|
182
193
|
def prepare_fixture_gem_home
|
183
194
|
FileUtils.rm_rf fixture_gem_home
|
184
|
-
bundled_gems_path = File.expand_path(File.join("..", ".."),
|
195
|
+
bundled_gems_path = File.expand_path(File.join("..", ".."),
|
196
|
+
find_gem_dir('utilrb').full_gem_path)
|
185
197
|
FileUtils.cp_r bundled_gems_path, fixture_gem_home
|
186
198
|
|
187
199
|
vendor = File.join(__dir__, '..', '..', 'vendor')
|
188
|
-
|
189
|
-
|
200
|
+
bundler_filename = "bundler-#{Bundler::VERSION}.gem"
|
201
|
+
cached_bundler_gem = File.join(vendor, bundler_filename)
|
202
|
+
unless File.file?(cached_bundler_gem)
|
190
203
|
FileUtils.mkdir_p vendor
|
191
|
-
|
204
|
+
Bundler.clean_system(
|
205
|
+
Ops::Install.guess_gem_program, 'fetch', '-v',
|
206
|
+
Bundler::VERSION, 'bundler', chdir: vendor)
|
207
|
+
|
208
|
+
unless File.file?(bundler_filename)
|
192
209
|
raise "cannot download the bundler gem"
|
193
210
|
end
|
194
211
|
end
|
195
212
|
|
196
213
|
capture_subprocess_io do
|
197
|
-
Bundler.clean_system(
|
214
|
+
Bundler.clean_system(
|
215
|
+
Hash['GEM_HOME' => fixture_gem_home, 'GEM_PATH' => nil],
|
216
|
+
Ops::Install.guess_gem_program, 'install', '--no-document',
|
217
|
+
cached_bundler_gem)
|
198
218
|
end
|
199
219
|
end
|
200
220
|
|
@@ -202,13 +222,18 @@ def start_gem_server(path = fixture_gem_home)
|
|
202
222
|
require 'socket'
|
203
223
|
require 'rubygems/server'
|
204
224
|
if @gem_server_pid
|
205
|
-
raise ArgumentError, "#start_gem_server already called,
|
225
|
+
raise ArgumentError, "#start_gem_server already called, "\
|
226
|
+
"call stop_gem_server before calling start_gem_server again"
|
206
227
|
end
|
207
|
-
@gem_server_pid = spawn(
|
208
|
-
|
209
|
-
|
228
|
+
@gem_server_pid = spawn(
|
229
|
+
Hash['RUBYOPT' => nil],
|
230
|
+
Gem.ruby, Ops::Install.guess_gem_program, 'server',
|
231
|
+
'--quiet', '--dir', path, out: :close, err: :close)
|
232
|
+
loop do
|
233
|
+
begin
|
234
|
+
TCPSocket.new('127.0.0.1', 8808)
|
210
235
|
break
|
211
|
-
rescue Errno::ECONNREFUSED
|
236
|
+
rescue Errno::ECONNREFUSED # rubocop:disable Lint/HandleExceptions
|
212
237
|
end
|
213
238
|
end
|
214
239
|
end
|
@@ -219,7 +244,7 @@ def stop_gem_server
|
|
219
244
|
@gem_server_pid = nil
|
220
245
|
end
|
221
246
|
|
222
|
-
def capture_deprecation_message
|
247
|
+
def capture_deprecation_message
|
223
248
|
level = Autoproj.warn_deprecated_level
|
224
249
|
Autoproj.warn_deprecated_level = -1
|
225
250
|
capture_subprocess_io do
|
@@ -237,12 +262,12 @@ def find_bundled_gem_path(bundler, gem_name, gemfile)
|
|
237
262
|
chdir: File.dirname(gemfile))
|
238
263
|
out_w.close
|
239
264
|
output = out_r.read.chomp
|
240
|
-
assert result, "#{output}"
|
265
|
+
assert result, "bundler show #{gem_name} failed, output: '#{output}'"
|
241
266
|
output
|
242
267
|
end
|
243
268
|
|
244
269
|
def workspace_env(varname)
|
245
|
-
_, stdout,
|
270
|
+
_, stdout, = invoke_test_script 'display-env.sh', varname, dir: install_dir
|
246
271
|
stdout.chomp
|
247
272
|
end
|
248
273
|
|
@@ -260,7 +285,7 @@ def ws_define_package_manager(name, strict: false, call_while_empty: false)
|
|
260
285
|
define_method(:strict?) { strict }
|
261
286
|
define_method(:call_while_empty?) { call_while_empty }
|
262
287
|
end
|
263
|
-
manager = flexmock(manager)
|
288
|
+
manager = flexmock(manager)
|
264
289
|
ws_package_managers[name] = manager
|
265
290
|
end
|
266
291
|
|
@@ -271,22 +296,26 @@ def ws_create_os_package_resolver
|
|
271
296
|
os_package_manager: 'os')
|
272
297
|
end
|
273
298
|
|
274
|
-
def ws_create(dir = make_tmpdir)
|
299
|
+
def ws_create(dir = make_tmpdir, partial_config: false)
|
275
300
|
require 'autoproj/ops/main_config_switcher'
|
276
|
-
FileUtils.cp_r Ops::MainConfigSwitcher::MAIN_CONFIGURATION_TEMPLATE,
|
301
|
+
FileUtils.cp_r Ops::MainConfigSwitcher::MAIN_CONFIGURATION_TEMPLATE,
|
302
|
+
File.join(dir, 'autoproj')
|
277
303
|
FileUtils.mkdir_p File.join(dir, '.autoproj')
|
278
304
|
|
279
305
|
ws_create_os_package_resolver
|
280
306
|
@ws = Workspace.new(
|
281
307
|
dir, os_package_resolver: ws_os_package_resolver,
|
282
308
|
package_managers: ws_package_managers)
|
283
|
-
|
284
|
-
|
309
|
+
|
310
|
+
unless partial_config
|
311
|
+
ws.config.set 'osdeps_mode', 'all'
|
312
|
+
ws.config.set 'apt_dpkg_update', true
|
313
|
+
end
|
285
314
|
ws.config.set 'GITHUB', 'http,ssh', true
|
286
315
|
ws.config.set 'GITORIOUS', 'http,ssh', true
|
287
316
|
ws.config.set 'gems_install_path', File.join(dir, 'gems')
|
288
|
-
ws.config.save
|
289
317
|
ws.prefix_dir = make_tmpdir
|
318
|
+
ws.config.save
|
290
319
|
ws
|
291
320
|
end
|
292
321
|
|
@@ -294,7 +323,8 @@ def ws_clear_layout
|
|
294
323
|
ws.manifest.clear_layout
|
295
324
|
end
|
296
325
|
|
297
|
-
def ws_define_package_set(name, vcs = VCSDefinition.from_raw(type: 'none'),
|
326
|
+
def ws_define_package_set(name, vcs = VCSDefinition.from_raw(type: 'none'),
|
327
|
+
**options)
|
298
328
|
package_set = PackageSet.new(ws, vcs, name: name, **options)
|
299
329
|
ws.manifest.register_package_set(package_set)
|
300
330
|
package_set
|
@@ -311,7 +341,8 @@ def ws_create_local_package_set(name, path, source_data: Hash.new, **options)
|
|
311
341
|
package_set
|
312
342
|
end
|
313
343
|
|
314
|
-
def ws_add_package_set_to_layout(name, vcs = VCSDefinition.from_raw(type: 'none'),
|
344
|
+
def ws_add_package_set_to_layout(name, vcs = VCSDefinition.from_raw(type: 'none'),
|
345
|
+
**options)
|
315
346
|
package_set = ws_define_package_set(name, vcs, **options)
|
316
347
|
ws.manifest.add_package_set_to_layout(package_set)
|
317
348
|
package_set
|
@@ -334,12 +365,12 @@ def ws_add_osdep_entries_to_layout(entries)
|
|
334
365
|
end
|
335
366
|
end
|
336
367
|
|
337
|
-
def ws_define_package(package_type, package_name,
|
368
|
+
def ws_define_package(package_type, package_name,
|
369
|
+
package_set: ws.manifest.main_package_set,
|
370
|
+
create: true)
|
338
371
|
package = Autobuild.send(package_type, package_name)
|
339
372
|
package.srcdir = File.join(ws.root_dir, package_name.to_s)
|
340
|
-
if create
|
341
|
-
FileUtils.mkdir_p package.srcdir
|
342
|
-
end
|
373
|
+
FileUtils.mkdir_p package.srcdir if create
|
343
374
|
autoproj_package = ws.register_package(package, nil, package_set)
|
344
375
|
yield(package) if block_given?
|
345
376
|
autoproj_package
|
@@ -353,8 +384,10 @@ def ws_define_package_overrides(package, package_set, vcs_spec)
|
|
353
384
|
package_set.add_overrides_entry(package.name, vcs_spec)
|
354
385
|
end
|
355
386
|
|
356
|
-
def ws_add_package_to_layout(package_type, package_name,
|
357
|
-
|
387
|
+
def ws_add_package_to_layout(package_type, package_name,
|
388
|
+
package_set: ws.manifest.main_package_set, &block)
|
389
|
+
pkg = ws_define_package(package_type, package_name,
|
390
|
+
package_set: package_set, &block)
|
358
391
|
ws.manifest.add_package_to_layout(pkg)
|
359
392
|
pkg
|
360
393
|
end
|
@@ -374,25 +407,31 @@ def ws_setup_package_dirs(package, create_srcdir: true)
|
|
374
407
|
elsif File.directory?(srcdir)
|
375
408
|
FileUtils.rm_rf srcdir
|
376
409
|
end
|
377
|
-
package.autobuild.builddir = builddir =
|
378
|
-
|
379
|
-
|
410
|
+
package.autobuild.builddir = builddir =
|
411
|
+
File.join(ws.root_dir, 'build', package.name)
|
412
|
+
package.autobuild.prefix = prefix =
|
413
|
+
File.join(ws.root_dir, 'prefix', package.name)
|
414
|
+
[srcdir, builddir, prefix]
|
380
415
|
end
|
381
416
|
|
382
417
|
def ws_create_git_package_set(name, source_data = Hash.new)
|
383
418
|
dir = make_tmpdir
|
384
|
-
|
419
|
+
unless system('git', 'init', chdir: dir, out: :close)
|
385
420
|
raise "failed to run git init"
|
386
421
|
end
|
422
|
+
|
387
423
|
File.open(File.join(dir, 'source.yml'), 'w') do |io|
|
388
424
|
YAML.dump(Hash['name' => name].merge(source_data), io)
|
389
425
|
end
|
390
|
-
|
426
|
+
unless system('git', 'add', 'source.yml', chdir: dir, out: :close)
|
391
427
|
raise "failed to add the source.yml"
|
392
428
|
end
|
393
|
-
|
429
|
+
|
430
|
+
unless system('git', 'commit', '-m', 'add source.yml',
|
431
|
+
chdir: dir, out: :close)
|
394
432
|
raise "failed to commit the source.yml"
|
395
433
|
end
|
434
|
+
|
396
435
|
dir
|
397
436
|
end
|
398
437
|
|
@@ -413,9 +452,21 @@ def ws_create_package_file(pkg, name, content)
|
|
413
452
|
end
|
414
453
|
path
|
415
454
|
end
|
455
|
+
|
456
|
+
def gemfile_aruba
|
457
|
+
base_dir = File.expand_path('../../', __dir__)
|
458
|
+
gemfile_path = File.join(base_dir, 'tmp', 'Gemfile.local')
|
459
|
+
File.open(gemfile_path, 'w') do |io|
|
460
|
+
io.write <<~GEMFILE
|
461
|
+
source 'https://rubygems.org'
|
462
|
+
gem 'autoproj', path: '#{base_dir}'
|
463
|
+
GEMFILE
|
464
|
+
end
|
465
|
+
gemfile_path
|
466
|
+
end
|
416
467
|
end
|
417
468
|
end
|
418
469
|
|
419
|
-
class Minitest::Test
|
470
|
+
class Minitest::Test # rubocop:disable Style/ClassAndModuleChildren
|
420
471
|
include Autoproj::SelfTest
|
421
472
|
end
|