autoproj 2.3.1 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +4 -3
- data/.vscode/launch.json +25 -0
- data/Gemfile +10 -3
- data/autoproj.gemspec +1 -1
- data/bin/autoproj_bootstrap +5 -3
- data/bin/autoproj_bootstrap.in +5 -3
- data/bin/autoproj_install +2 -2
- data/bin/autoproj_install.in +2 -2
- data/lib/autoproj.rb +3 -1
- data/lib/autoproj/build_option.rb +4 -4
- data/lib/autoproj/cli.rb +10 -1
- data/lib/autoproj/cli/base.rb +14 -4
- data/lib/autoproj/cli/bootstrap.rb +2 -2
- data/lib/autoproj/cli/cache.rb +4 -10
- data/lib/autoproj/cli/clean.rb +1 -1
- data/lib/autoproj/cli/commit.rb +1 -1
- data/lib/autoproj/cli/exec.rb +11 -5
- data/lib/autoproj/cli/locate.rb +12 -12
- data/lib/autoproj/cli/log.rb +1 -2
- data/lib/autoproj/cli/main.rb +23 -4
- data/lib/autoproj/cli/main_plugin.rb +2 -2
- data/lib/autoproj/cli/manifest.rb +6 -3
- data/lib/autoproj/cli/query.rb +71 -10
- data/lib/autoproj/cli/reset.rb +4 -4
- data/lib/autoproj/cli/switch_config.rb +2 -2
- data/lib/autoproj/cli/tag.rb +2 -2
- data/lib/autoproj/cli/update.rb +2 -0
- data/lib/autoproj/cli/which.rb +17 -0
- data/lib/autoproj/exceptions.rb +9 -4
- data/lib/autoproj/git_server_configuration.rb +80 -53
- data/lib/autoproj/manifest.rb +1 -1
- data/lib/autoproj/ops/cache.rb +21 -10
- data/lib/autoproj/ops/main_config_switcher.rb +6 -9
- data/lib/autoproj/os_package_query.rb +99 -0
- data/lib/autoproj/package_managers/bundler_manager.rb +8 -1
- data/lib/autoproj/package_managers/yum_manager.rb +2 -2
- data/lib/autoproj/package_managers/zypper_manager.rb +2 -2
- data/lib/autoproj/query_base.rb +128 -0
- data/lib/autoproj/reporter.rb +12 -0
- data/lib/autoproj/{query.rb → source_package_query.rb} +15 -81
- data/lib/autoproj/version.rb +1 -1
- data/lib/autoproj/workspace.rb +38 -0
- metadata +8 -5
- data/lib/autoproj/cli/snapshot.rb +0 -66
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99c12d40c6ed5bf39360d3f3e39b3a602841f5f8
|
4
|
+
data.tar.gz: c2f379b779b1f5ba68ec9a3b00add4e90142fdfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db6011b85a68c112ce7fa950c8c33dbf3a7229d3538d23fdf0093d72b3d74fe593cbe4d68c434a7231d937e21852a7ceb985f3dbacaa451db55c89e87a4c58fe
|
7
|
+
data.tar.gz: 3197a556775041572721f3a9bb4e6c84bf058deee78b5bc0f8a031e32d8ab5b87dc723a30991779cb85e41cea9bc404460367ea8062ffa39d077563fdc5f7055
|
data/.travis.yml
CHANGED
data/.vscode/launch.json
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
3
|
+
// Hover to view descriptions of existing attributes.
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
5
|
+
"version": "0.2.0",
|
6
|
+
"configurations": [
|
7
|
+
{
|
8
|
+
"name": "Minitest - all",
|
9
|
+
"type": "Ruby",
|
10
|
+
"request": "launch",
|
11
|
+
"useBundler": true,
|
12
|
+
"cwd": "${workspaceRoot}",
|
13
|
+
"program": "/usr/bin/rake",
|
14
|
+
"args": ["test"]
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"name": "Minitest - active tasks only",
|
18
|
+
"type": "Ruby",
|
19
|
+
"request": "launch",
|
20
|
+
"useBundler": true,
|
21
|
+
"cwd": "${workspaceRoot}",
|
22
|
+
"program": "${file}"
|
23
|
+
}
|
24
|
+
]
|
25
|
+
}
|
data/Gemfile
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
gem '
|
4
|
-
|
5
|
-
|
3
|
+
gem 'autobuild', git: 'https://github.com/rock-core/autobuild', branch: 'master'
|
4
|
+
|
5
|
+
group :vscode do
|
6
|
+
gem 'pry'
|
7
|
+
gem 'pry-byebug'
|
8
|
+
gem 'rubocop', '>= 0.6.0'
|
9
|
+
gem 'ruby-debug-ide', '>= 0.6.0'
|
10
|
+
gem 'debase', '>= 0.2.2.beta10'
|
11
|
+
gem 'solargraph'
|
12
|
+
end
|
6
13
|
gemspec
|
data/autoproj.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.homepage = "http://rock-robotics.org"
|
16
16
|
s.licenses = ["BSD"]
|
17
17
|
|
18
|
-
s.required_ruby_version =
|
18
|
+
s.required_ruby_version = '>= 2.1.0'
|
19
19
|
s.bindir = 'bin'
|
20
20
|
s.executables = ['autoproj', 'aup', 'amake', 'alocate', 'alog']
|
21
21
|
s.require_paths = ["lib"]
|
data/bin/autoproj_bootstrap
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#! /usr/bin/ruby
|
2
2
|
|
3
|
-
if RUBY_VERSION < "2.
|
4
|
-
STDERR.puts "autoproj requires Ruby >= 2.
|
3
|
+
if RUBY_VERSION < "2.1.0"
|
4
|
+
STDERR.puts "autoproj requires Ruby >= 2.1.0"
|
5
5
|
exit 1
|
6
6
|
elsif ENV['AUTOPROJ_CURRENT_ROOT'] && (ENV['AUTOPROJ_CURRENT_ROOT'] != Dir.pwd)
|
7
7
|
STDERR.puts "it seems that you've already loaded an env.sh script in this console, open a new console and try again"
|
@@ -609,5 +609,7 @@ ops.stage1
|
|
609
609
|
if !ops.skip_stage2?
|
610
610
|
ops.call_stage2
|
611
611
|
end
|
612
|
-
ops.run_autoproj 'bootstrap', *bootstrap_options
|
612
|
+
if !ops.run_autoproj 'bootstrap', *bootstrap_options
|
613
|
+
exit 1
|
614
|
+
end
|
613
615
|
|
data/bin/autoproj_bootstrap.in
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#! /usr/bin/ruby
|
2
2
|
|
3
|
-
if RUBY_VERSION < "2.
|
4
|
-
STDERR.puts "autoproj requires Ruby >= 2.
|
3
|
+
if RUBY_VERSION < "2.1.0"
|
4
|
+
STDERR.puts "autoproj requires Ruby >= 2.1.0"
|
5
5
|
exit 1
|
6
6
|
elsif ENV['AUTOPROJ_CURRENT_ROOT'] && (ENV['AUTOPROJ_CURRENT_ROOT'] != Dir.pwd)
|
7
7
|
STDERR.puts "it seems that you've already loaded an env.sh script in this console, open a new console and try again"
|
@@ -18,5 +18,7 @@ ops.stage1
|
|
18
18
|
if !ops.skip_stage2?
|
19
19
|
ops.call_stage2
|
20
20
|
end
|
21
|
-
ops.run_autoproj 'bootstrap', *bootstrap_options
|
21
|
+
if !ops.run_autoproj 'bootstrap', *bootstrap_options
|
22
|
+
exit 1
|
23
|
+
end
|
22
24
|
|
data/bin/autoproj_install
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#! /usr/bin/ruby
|
2
2
|
|
3
|
-
if RUBY_VERSION < "2.
|
4
|
-
STDERR.puts "autoproj requires Ruby >= 2.
|
3
|
+
if RUBY_VERSION < "2.1.0"
|
4
|
+
STDERR.puts "autoproj requires Ruby >= 2.1.0"
|
5
5
|
exit 1
|
6
6
|
elsif ENV['AUTOPROJ_CURRENT_ROOT'] && (ENV['AUTOPROJ_CURRENT_ROOT'] != Dir.pwd)
|
7
7
|
STDERR.puts "it seems that you've already loaded an env.sh script in this console, open a new console and try again"
|
data/bin/autoproj_install.in
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#! /usr/bin/ruby
|
2
2
|
|
3
|
-
if RUBY_VERSION < "2.
|
4
|
-
STDERR.puts "autoproj requires Ruby >= 2.
|
3
|
+
if RUBY_VERSION < "2.1.0"
|
4
|
+
STDERR.puts "autoproj requires Ruby >= 2.1.0"
|
5
5
|
exit 1
|
6
6
|
elsif ENV['AUTOPROJ_CURRENT_ROOT'] && (ENV['AUTOPROJ_CURRENT_ROOT'] != Dir.pwd)
|
7
7
|
STDERR.puts "it seems that you've already loaded an env.sh script in this console, open a new console and try again"
|
data/lib/autoproj.rb
CHANGED
@@ -31,7 +31,9 @@
|
|
31
31
|
require 'autoproj/ops/import'
|
32
32
|
# Required for auto-saving in import_packages
|
33
33
|
require 'autoproj/ops/snapshot'
|
34
|
-
require 'autoproj/
|
34
|
+
require 'autoproj/query_base'
|
35
|
+
require 'autoproj/source_package_query'
|
36
|
+
require 'autoproj/os_package_query'
|
35
37
|
|
36
38
|
require 'autoproj/ops/tools'
|
37
39
|
require 'autoproj/ops/loader'
|
@@ -47,10 +47,10 @@ def doc
|
|
47
47
|
|
48
48
|
def ask(current_value, doc = nil)
|
49
49
|
default_value =
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
if !current_value.nil? then current_value.to_s
|
51
|
+
elsif options[:default] then options[:default].to_str
|
52
|
+
else ''
|
53
|
+
end
|
54
54
|
|
55
55
|
STDOUT.print " #{doc || self.doc} [#{default_value}] "
|
56
56
|
STDOUT.flush
|
data/lib/autoproj/cli.rb
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
module Autoproj
|
2
2
|
module CLI
|
3
|
-
class
|
3
|
+
class CLIException < RuntimeError
|
4
|
+
def fatal?
|
5
|
+
true
|
6
|
+
end
|
7
|
+
end
|
8
|
+
class CLIInvalidArguments < CLIException
|
9
|
+
end
|
10
|
+
class CLIAmbiguousArguments < CLIException
|
11
|
+
end
|
12
|
+
class CLIInvalidSelection < CLIException
|
4
13
|
end
|
5
14
|
|
6
15
|
def self.load_plugins
|
data/lib/autoproj/cli/base.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'tty/color'
|
2
2
|
require 'autoproj'
|
3
3
|
require 'autoproj/autobuild'
|
4
|
+
require 'autoproj/cli'
|
4
5
|
|
5
6
|
module Autoproj
|
6
7
|
module CLI
|
@@ -57,7 +58,11 @@ def normalize_command_line_package_selection(selection)
|
|
57
58
|
# resolved
|
58
59
|
def resolve_user_selection(selected_packages, **options)
|
59
60
|
if selected_packages.empty?
|
60
|
-
selection =
|
61
|
+
selection =
|
62
|
+
begin ws.manifest.default_packages
|
63
|
+
rescue ExcludedSelection => e
|
64
|
+
raise CLIInvalidSelection, e.message, e.backtrace
|
65
|
+
end
|
61
66
|
if Autoproj.verbose
|
62
67
|
Autoproj.message "selected packages: #{selection.each_package_name.to_a.sort.join(", ")}"
|
63
68
|
end
|
@@ -65,8 +70,11 @@ def resolve_user_selection(selected_packages, **options)
|
|
65
70
|
end
|
66
71
|
selected_packages = selected_packages.to_set
|
67
72
|
|
68
|
-
selected_packages, nonresolved =
|
69
|
-
expand_package_selection(selected_packages, **options)
|
73
|
+
selected_packages, nonresolved =
|
74
|
+
begin ws.manifest.expand_package_selection(selected_packages, **options)
|
75
|
+
rescue ExcludedSelection => e
|
76
|
+
raise CLIInvalidSelection, e.message, e.backtrace
|
77
|
+
end
|
70
78
|
|
71
79
|
# Try to auto-add stuff if nonresolved
|
72
80
|
nonresolved.delete_if do |sel|
|
@@ -144,6 +152,8 @@ def resolve_selection(user_selection, checkout_only: true, only_local: false, re
|
|
144
152
|
auto_exclude: auto_exclude)
|
145
153
|
|
146
154
|
return source_packages, osdep_packages, resolved_selection
|
155
|
+
rescue ExcludedSelection => e
|
156
|
+
raise CLIInvalidSelection, e.message, e.backtrace
|
147
157
|
end
|
148
158
|
|
149
159
|
def validate_user_selection(user_selection, resolved_selection)
|
@@ -151,7 +161,7 @@ def validate_user_selection(user_selection, resolved_selection)
|
|
151
161
|
!resolved_selection.has_match_for?(pkg_name)
|
152
162
|
end
|
153
163
|
if !not_matched.empty?
|
154
|
-
raise
|
164
|
+
raise CLIInvalidArguments, "autoproj: wrong package selection on command line, cannot find a match for #{not_matched.to_a.sort.join(", ")}"
|
155
165
|
end
|
156
166
|
end
|
157
167
|
|
@@ -12,7 +12,7 @@ class Bootstrap
|
|
12
12
|
|
13
13
|
def initialize(root_dir = Dir.pwd)
|
14
14
|
if File.exist?(File.join(root_dir, 'autoproj', "manifest"))
|
15
|
-
raise
|
15
|
+
raise CLIException, "this installation is already bootstrapped. Remove the autoproj directory if it is not the case"
|
16
16
|
end
|
17
17
|
@root_dir = root_dir
|
18
18
|
end
|
@@ -26,7 +26,7 @@ def validate_options(args, options)
|
|
26
26
|
|
27
27
|
path = File.expand_path(path)
|
28
28
|
if !File.directory?(path) || !File.directory?(File.join(path, 'autoproj'))
|
29
|
-
raise
|
29
|
+
raise CLIInvalidArguments, "#{path} does not look like an autoproj installation"
|
30
30
|
end
|
31
31
|
options[:reuse] = [path]
|
32
32
|
end
|
data/lib/autoproj/cli/cache.rb
CHANGED
@@ -10,27 +10,21 @@ def validate_options(argv, options = Hash.new)
|
|
10
10
|
if argv.empty?
|
11
11
|
default_cache_dirs = Autobuild::Importer.default_cache_dirs
|
12
12
|
if !default_cache_dirs || default_cache_dirs.empty?
|
13
|
-
raise
|
13
|
+
raise CLIInvalidArguments, "no cache directory defined with e.g. the AUTOBUILD_CACHE_DIR environment variable, expected one cache directory as argument"
|
14
14
|
end
|
15
15
|
Autoproj.warn "using cache directory #{default_cache_dirs.first} from the autoproj configuration"
|
16
16
|
argv << default_cache_dirs.first
|
17
|
-
elsif argv.size > 1
|
18
|
-
raise ArgumentError, "expected only one cache directory as argument"
|
19
17
|
end
|
20
18
|
|
21
|
-
return File.expand_path(argv.first, ws.root_dir), options
|
19
|
+
return File.expand_path(argv.first, ws.root_dir), *argv[1..-1], options
|
22
20
|
end
|
23
21
|
|
24
|
-
def run(cache_dir,
|
25
|
-
options = Kernel.validate_options options,
|
26
|
-
keep_going: false,
|
27
|
-
checkout_only: false
|
28
|
-
|
22
|
+
def run(cache_dir, *package_names, all: true, keep_going: false, checkout_only: false)
|
29
23
|
initialize_and_load
|
30
24
|
finalize_setup
|
31
25
|
|
32
26
|
cache_op = Autoproj::Ops::Cache.new(cache_dir, ws.manifest)
|
33
|
-
cache_op.create_or_update(
|
27
|
+
cache_op.create_or_update(*package_names, all: all, keep_going: keep_going, checkout_only: checkout_only)
|
34
28
|
end
|
35
29
|
end
|
36
30
|
end
|
data/lib/autoproj/cli/clean.rb
CHANGED
@@ -29,7 +29,7 @@ def run(selection, options = Hash.new)
|
|
29
29
|
packages,
|
30
30
|
recursive: deps)
|
31
31
|
if source_packages.empty?
|
32
|
-
raise
|
32
|
+
raise CLIInvalidArguments, "no packages or OS packages match #{selection.join(" ")}"
|
33
33
|
end
|
34
34
|
|
35
35
|
source_packages.each do |pkg_name|
|
data/lib/autoproj/cli/commit.rb
CHANGED
@@ -9,7 +9,7 @@ def run(*user_selection, options = Hash.new)
|
|
9
9
|
pkg = manifest.main_package_set.create_autobuild_package
|
10
10
|
importer = pkg.importer
|
11
11
|
if !importer || !importer.kind_of?(Autobuild::Git)
|
12
|
-
raise
|
12
|
+
raise CLIInvalidArguments, "cannot use autoproj tag if the main configuration is not managed by git"
|
13
13
|
end
|
14
14
|
|
15
15
|
versions_file = File.join(
|
data/lib/autoproj/cli/exec.rb
CHANGED
@@ -6,12 +6,18 @@ def run(cmd, *args)
|
|
6
6
|
initialize_and_load
|
7
7
|
finalize_setup(Array.new)
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
program =
|
10
|
+
begin ws.which(cmd)
|
11
|
+
rescue ::Exception => e
|
12
|
+
raise CLIInvalidArguments, e.message, e.backtrace
|
13
|
+
end
|
14
|
+
env = ws.full_env.resolved_env
|
15
|
+
|
16
|
+
begin
|
17
|
+
::Process.exec(env, program, *args)
|
18
|
+
rescue ::Exception => e
|
19
|
+
raise CLIInvalidArguments, e.message, e.backtrace
|
13
20
|
end
|
14
|
-
exec(env.resolved_env, cmd, *args)
|
15
21
|
end
|
16
22
|
end
|
17
23
|
end
|
data/lib/autoproj/cli/locate.rb
CHANGED
@@ -9,11 +9,11 @@ module CLI
|
|
9
9
|
# list that information and thus avoid loading the Autoproj
|
10
10
|
# configuration (which takes fairly long).
|
11
11
|
class Locate < InspectionTool
|
12
|
-
class NotFound < RuntimeError; end
|
13
|
-
class AmbiguousSelection < RuntimeError; end
|
14
|
-
|
15
12
|
attr_reader :packages
|
16
13
|
attr_reader :package_sets
|
14
|
+
|
15
|
+
class NotFound < CLIException; end
|
16
|
+
class NoSuchDir < CLIException; end
|
17
17
|
|
18
18
|
# Create the locate CLI interface
|
19
19
|
#
|
@@ -167,7 +167,7 @@ def run(selections, cache: !!packages, mode: :source_dir, log: nil)
|
|
167
167
|
# Resolve the package that matches a given selection
|
168
168
|
#
|
169
169
|
# @return [PackageDefinition]
|
170
|
-
# @raise [
|
170
|
+
# @raise [CLIInvalidArguments] if nothing matches
|
171
171
|
# @raise [AmbiguousSelection] if the selection is ambiguous
|
172
172
|
def resolve_package(selection)
|
173
173
|
matching_packages = find_packages(selection)
|
@@ -185,9 +185,9 @@ def resolve_package(selection)
|
|
185
185
|
end
|
186
186
|
|
187
187
|
if matching_packages.empty?
|
188
|
-
raise
|
188
|
+
raise CLIInvalidArguments, "cannot find '#{selection}' in the current autoproj installation"
|
189
189
|
elsif matching_packages.size > 1
|
190
|
-
raise
|
190
|
+
raise CLIAmbiguousArguments, "multiple packages match '#{selection}' in the current autoproj installation: #{matching_packages.map(&:name).sort.join(", ")}"
|
191
191
|
else
|
192
192
|
return matching_packages.first
|
193
193
|
end
|
@@ -212,12 +212,12 @@ def source_dir_of(selection)
|
|
212
212
|
|
213
213
|
# Returns the prefix directory for a given selection
|
214
214
|
#
|
215
|
-
# @raise [
|
215
|
+
# @raise [NoSuchDir] if the selection points to a package set
|
216
216
|
def prefix_dir_of(selection)
|
217
217
|
if workspace_dir?(selection)
|
218
218
|
ws.prefix_dir
|
219
219
|
elsif find_package_set(selection)
|
220
|
-
raise
|
220
|
+
raise NoSuchDir, "#{selection} is a package set, and package sets do not have prefixes"
|
221
221
|
else
|
222
222
|
resolve_package(selection).prefix
|
223
223
|
end
|
@@ -225,19 +225,19 @@ def prefix_dir_of(selection)
|
|
225
225
|
|
226
226
|
# Returns the build directory for a given selection
|
227
227
|
#
|
228
|
-
# @raise [
|
228
|
+
# @raise [NoSuchDir] if the selection points to a package set,
|
229
229
|
# or to a package that has no build directory
|
230
230
|
def build_dir_of(selection)
|
231
231
|
if workspace_dir?(selection)
|
232
|
-
raise
|
232
|
+
raise NoSuchDir, "#{selection} points to the workspace itself, which has no build dir"
|
233
233
|
elsif find_package_set(selection)
|
234
|
-
raise
|
234
|
+
raise NoSuchDir, "#{selection} is a package set, and package sets do not have build directories"
|
235
235
|
else
|
236
236
|
pkg = resolve_package(selection)
|
237
237
|
if pkg.respond_to?(:builddir) && pkg.builddir
|
238
238
|
pkg.builddir
|
239
239
|
else
|
240
|
-
raise
|
240
|
+
raise NoSuchDir, "#{selection} resolves to the package #{pkg.name}, which does not have a build directory"
|
241
241
|
end
|
242
242
|
end
|
243
243
|
end
|
data/lib/autoproj/cli/log.rb
CHANGED
@@ -4,7 +4,6 @@ module Autoproj
|
|
4
4
|
module CLI
|
5
5
|
class Log < Base
|
6
6
|
def run(args, options = Hash.new)
|
7
|
-
ws = Workspace.from_environment
|
8
7
|
ws.load_config
|
9
8
|
|
10
9
|
if !ws.config.import_log_enabled?
|
@@ -34,7 +33,7 @@ def parse_log_entry(entry)
|
|
34
33
|
elsif entry =~ /^\d+$/
|
35
34
|
"autoproj@{#{entry}}"
|
36
35
|
else
|
37
|
-
raise
|
36
|
+
raise CLIInvalidArguments, "unexpected revision name '#{entry}', expected either autoproj@{ID} or ID ('ID' being a number). Run 'autoproj log' without arguments for a list of known entries"
|
38
37
|
end
|
39
38
|
end
|
40
39
|
end
|
data/lib/autoproj/cli/main.rb
CHANGED
@@ -22,7 +22,18 @@ class Main < Thor
|
|
22
22
|
class_option :progress, type: :boolean, default: TTY::Color.color?,
|
23
23
|
desc: 'enables or disables progress display (enabled by default if the terminal supports it)'
|
24
24
|
|
25
|
+
stop_on_unknown_option! :exec
|
26
|
+
check_unknown_options! except: :exec
|
27
|
+
|
25
28
|
no_commands do
|
29
|
+
def default_report_on_package_failures
|
30
|
+
if options[:debug]
|
31
|
+
:raise
|
32
|
+
else
|
33
|
+
:exit
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
26
37
|
def run_autoproj_cli(filename, classname, report_options, *args, **extra_options)
|
27
38
|
require "autoproj/cli/#{filename}"
|
28
39
|
if Autobuild::Subprocess.transparent_mode = options[:tool]
|
@@ -139,7 +150,7 @@ def doc(*packages)
|
|
139
150
|
option :auto_exclude, type: :boolean,
|
140
151
|
desc: 'if true, packages that fail to import will be excluded from the build'
|
141
152
|
def update(*packages)
|
142
|
-
report_options = Hash[silent: false, on_package_failures:
|
153
|
+
report_options = Hash[silent: false, on_package_failures: default_report_on_package_failures]
|
143
154
|
if options[:auto_exclude]
|
144
155
|
report_options[:on_package_failures] = :report
|
145
156
|
end
|
@@ -179,7 +190,7 @@ def update(*packages)
|
|
179
190
|
option :confirm, type: :boolean, default: nil,
|
180
191
|
desc: '--force and --rebuild will ask confirmation if applied to the whole workspace. Use --no-confirm to disable this confirmation'
|
181
192
|
def build(*packages)
|
182
|
-
report_options = Hash[silent: false, on_package_failures:
|
193
|
+
report_options = Hash[silent: false, on_package_failures: default_report_on_package_failures]
|
183
194
|
if options[:auto_exclude]
|
184
195
|
report_options[:on_package_failures] = :report
|
185
196
|
end
|
@@ -192,8 +203,10 @@ def build(*packages)
|
|
192
203
|
desc: 'do not stop on errors'
|
193
204
|
option :checkout_only, aliases: :c, type: :boolean, default: false,
|
194
205
|
desc: "only checkout packages, do not update already-cached ones"
|
195
|
-
|
196
|
-
|
206
|
+
option :all, type: :boolean, default: true,
|
207
|
+
desc: "cache all defined packages (the default) or only the selected ones"
|
208
|
+
def cache(*args)
|
209
|
+
run_autoproj_cli(:cache, :Cache, Hash[], *args)
|
197
210
|
end
|
198
211
|
|
199
212
|
desc 'clean [PACKAGES]', 'remove build byproducts for the given packages'
|
@@ -444,6 +457,12 @@ def exec(*args)
|
|
444
457
|
require 'autoproj/cli/exec'
|
445
458
|
CLI::Exec.new.run(*args)
|
446
459
|
end
|
460
|
+
|
461
|
+
desc 'which', "resolves the full path to a command within the Autoproj workspace"
|
462
|
+
def which(cmd)
|
463
|
+
require 'autoproj/cli/which'
|
464
|
+
CLI::Which.new.run(cmd)
|
465
|
+
end
|
447
466
|
end
|
448
467
|
end
|
449
468
|
end
|