autoproj 2.9.0 → 2.10.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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +113 -0
  3. data/.travis.yml +0 -2
  4. data/Gemfile +1 -0
  5. data/README.md +59 -14
  6. data/bin/autoproj_bootstrap +21 -12
  7. data/bin/autoproj_bootstrap.in +2 -2
  8. data/bin/autoproj_install +21 -12
  9. data/bin/autoproj_install.in +2 -2
  10. data/lib/autoproj/aruba_minitest.rb +4 -4
  11. data/lib/autoproj/autobuild_extensions/dsl.rb +91 -70
  12. data/lib/autoproj/autobuild_extensions/package.rb +20 -1
  13. data/lib/autoproj/build_option.rb +24 -7
  14. data/lib/autoproj/cli/base.rb +12 -1
  15. data/lib/autoproj/cli/bootstrap.rb +9 -3
  16. data/lib/autoproj/cli/build.rb +17 -13
  17. data/lib/autoproj/cli/envsh.rb +1 -1
  18. data/lib/autoproj/cli/exec.rb +5 -7
  19. data/lib/autoproj/cli/main.rb +44 -9
  20. data/lib/autoproj/cli/main_test.rb +2 -0
  21. data/lib/autoproj/cli/test.rb +29 -6
  22. data/lib/autoproj/cli/version.rb +52 -0
  23. data/lib/autoproj/cli/versions.rb +4 -1
  24. data/lib/autoproj/cli/watch.rb +2 -1
  25. data/lib/autoproj/configuration.rb +49 -11
  26. data/lib/autoproj/default.osdeps +9 -0
  27. data/lib/autoproj/manifest.rb +6 -6
  28. data/lib/autoproj/ops/build.rb +5 -15
  29. data/lib/autoproj/ops/import.rb +22 -3
  30. data/lib/autoproj/ops/install.rb +19 -10
  31. data/lib/autoproj/ops/main_config_switcher.rb +12 -6
  32. data/lib/autoproj/ops/snapshot.rb +5 -1
  33. data/lib/autoproj/os_package_resolver.rb +245 -209
  34. data/lib/autoproj/package_selection.rb +18 -0
  35. data/lib/autoproj/reporter.rb +45 -31
  36. data/lib/autoproj/test.rb +107 -56
  37. data/lib/autoproj/version.rb +1 -1
  38. data/lib/autoproj/workspace.rb +90 -72
  39. data/shell/completion/amake_bash +1 -0
  40. data/shell/completion/amake_zsh +1 -0
  41. data/shell/completion/autoproj_bash +2 -0
  42. data/shell/completion/autoproj_zsh +2 -0
  43. metadata +5 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a79f0dc8faf8c992dedb96e65c997ab35f41d62107845dd9dd20bc260630f0a2
4
- data.tar.gz: 2e3db38917f2cefa9defa70fa248ced0c05ad909817003b135d9b7f6179ca8bc
3
+ metadata.gz: c58d48dd3fb77e9691f4ac7497e66ed4aa365c840d0bb89eee68c2c918f96363
4
+ data.tar.gz: 700769852945f7cde110a489ef41cbad3249a88e244659f69e650e4794145f3d
5
5
  SHA512:
6
- metadata.gz: 346bdce3bf52c42187143908ef04767a03e1e71b24738b0c333591bd73d113355a871ccdf67bec9b69018d30e3302e6a53946e007922a4a3e01fb82fa371eae8
7
- data.tar.gz: 470faaa51b2d58609f70e794173d07d41003feee472c3c9e3dd9bb8024e66746403a480becad1dc0222066084e76c0205104465e138afc714d8555fc32d60d55
6
+ metadata.gz: 2f8f4f28d4b41301c80e9a9305bcda37207e54ec9a640d471d0cb12aef9c3ccae343afc4cd3878b7b6ca9f046d6768098b04e6edadf4e6006548bdc7fcb83e9c
7
+ data.tar.gz: bee15c0034a14bddcc8e8be292194ef9178f222247c7ca4efd2238b9cf2da51f6bb6eb94c6526002f3b98a41658ecfb2aede32a2ac1c8c74877f6fd60bb5aa8b
@@ -0,0 +1,113 @@
1
+ inherit_gem:
2
+ rubocop-rock: defaults.yml
3
+
4
+ AllCops:
5
+ TargetRubyVersion: "2.3"
6
+ Exclude:
7
+ - lib/autobuild/packages/genom.rb
8
+ - vendor/**/*
9
+ - pkg/**/*
10
+
11
+ Style/ClassVars:
12
+ Enabled: false
13
+
14
+ Style/TrivialAccessors:
15
+ IgnoreClassMethods: true
16
+
17
+ Naming/PredicateName:
18
+ Enabled: false
19
+
20
+ Lint/SplatKeywordArguments:
21
+ Enabled: false
22
+
23
+ Style/FrozenStringLiteralComment:
24
+ Enabled: false
25
+
26
+ Style/AccessModifierDeclarations:
27
+ EnforcedStyle: inline
28
+
29
+ Naming/FileName:
30
+ Exclude:
31
+ - lib/autobuild/import/git-lfs.rb
32
+
33
+ Metrics/ParameterLists:
34
+ Enabled: false
35
+
36
+ Naming/UncommunicativeMethodParamName:
37
+ AllowedNames: [io, id, to, by, on, in, at, ip, db, ws]
38
+
39
+
40
+
41
+
42
+ Layout/AlignParameters:
43
+ Enabled: false
44
+
45
+ Layout/DotPosition:
46
+ Enabled: false
47
+
48
+ Layout/FirstParameterIndentation:
49
+ Enabled: false
50
+
51
+ Layout/IndentAssignment:
52
+ Enabled: false
53
+
54
+ Layout/IndentationWidth:
55
+ Enabled: false
56
+
57
+ Layout/MultilineMethodCallBraceLayout:
58
+ Enabled: false
59
+
60
+ Layout/MultilineMethodCallIndentation:
61
+ Enabled: false
62
+
63
+ Lint/RescueException:
64
+ Enabled: false
65
+
66
+ Metrics/AbcSize:
67
+ Enabled: false
68
+
69
+ Metrics/BlockLength:
70
+ Enabled: false
71
+
72
+ Metrics/ClassLength:
73
+ Enabled: false
74
+
75
+ Metrics/CyclomaticComplexity:
76
+ Enabled: false
77
+
78
+ Metrics/MethodLength:
79
+ Enabled: false
80
+
81
+ Metrics/PerceivedComplexity:
82
+ Enabled: false
83
+
84
+ Style/ClassCheck:
85
+ Enabled: false
86
+
87
+ Style/Documentation:
88
+ Enabled: false
89
+
90
+ Style/EmptyLiteral:
91
+ Enabled: false
92
+
93
+ Style/GuardClause:
94
+ Enabled: false
95
+
96
+ Style/HashSyntax:
97
+ Enabled: false
98
+
99
+ Style/PerlBackrefs:
100
+ Enabled: false
101
+
102
+ Style/StringLiterals:
103
+ Enabled: false
104
+
105
+ Layout/IndentHeredoc:
106
+ Enabled: false
107
+
108
+ Metrics/LineLength:
109
+ Max: 90
110
+ Exclude:
111
+ - test/**/*
112
+
113
+
@@ -1,8 +1,6 @@
1
1
  sudo: true
2
2
  language: ruby
3
3
  rvm:
4
- - 2.1.10
5
- - 2.2.5
6
4
  - 2.3.6
7
5
  - 2.4.3
8
6
  - 2.5.0
data/Gemfile CHANGED
@@ -6,6 +6,7 @@ group :vscode do
6
6
  gem 'pry'
7
7
  gem 'pry-byebug'
8
8
  gem 'rubocop', '>= 0.6.0'
9
+ gem 'rubocop-rock'
9
10
  gem 'ruby-debug-ide', '>= 0.6.0'
10
11
  gem 'debase', '>= 0.2.2.beta10'
11
12
  gem 'solargraph'
data/README.md CHANGED
@@ -43,8 +43,7 @@ Each package definition includes:
43
43
  * on what the package depends. This can be either another package built by
44
44
  autoproj, or an operating system package.
45
45
 
46
- See this
47
- page[http://www.rock-robotics.org/stable/documentation/autoproj/writing_manifest.html] for more information.
46
+ See [this page](https://www.rock-robotics.org/documentation/autoproj/writing_manifest.html) for more information.
48
47
 
49
48
  ## Software packages in Autoproj
50
49
 
@@ -60,7 +59,7 @@ using pkg-config for C/C++ packages.
60
59
 
61
60
  To describe the package, and more importantly to setup cross-package
62
61
  dependencies, an optional manifest file can be
63
- added[http://www.rock-robotics.org/stable/documentation/autoproj/advanced/manifest-xml.html].
62
+ added [link to documentation here](https://www.rock-robotics.org/documentation/autoproj/advanced/manifest-xml.html).
64
63
 
65
64
  # Migrating from v1 to v2
66
65
 
@@ -104,7 +103,7 @@ saved under a new .autoproj directory (as e.g. the config files and
104
103
  remotes). The upgrade process does not delete these to allow for
105
104
  "downgrading".
106
105
 
107
- In addition, autoproj now uses [bundler](bundler.io) to manage the gems. This means
106
+ In addition, autoproj now uses [bundler](http://bundler.io) to manage the gems. This means
108
107
  that, by default, the gems are shared between all autoproj installs,
109
108
  bundler making sure that upgrading a gem on one install does not
110
109
  affect another. This makes bootstrapping a lot faster (since already
@@ -119,10 +118,10 @@ anymore.
119
118
 
120
119
  To add a gem to the workspace, create or edit `autoproj/Gemfile` and add `gem`
121
120
  entries following [the bundler documentation](http://bundler.io/gemfile.html).
122
- Once the file is edited, run `autoproj osdeps` and reload the updated `env.sh`.
121
+ Once the file is edited, run `autoproj osdeps` and reload the updated `env.sh`.
123
122
 
124
123
  To remove gems, remove the corresponding line in `autoproj/Gemfile`, run
125
- `autoproj osdeps` and reload env.sh.
124
+ `autoproj osdeps` and reload `env.sh`
126
125
 
127
126
  Alternatively to the main `autoproj/Gemfile`, files with the `.gemfile`
128
127
  extension in `autoproj/overrides.d` are also considered
@@ -174,7 +173,7 @@ The option is also available to "autoproj show"
174
173
  The environment is not global anymore, but per-package. This means
175
174
  that builds that were missing dependencies could be previously passing
176
175
  and will fail. It also means that the environment of packages that
177
- have been used but are not anymore will not pollute env.sh.
176
+ have been used but are not anymore will not pollute `env.sh`
178
177
 
179
178
  ### Separate build directories
180
179
 
@@ -232,22 +231,68 @@ osdep can be excluded or ignored now.
232
231
  autoproj update learned --force-reset to reset to the expected commit,
233
232
  bypassing any check. Great for CI environments.
234
233
 
235
- # Developing autoproj 2.x
234
+ # Developing Autoproj
235
+
236
+ The best way to work on Autoproj's own codebase is to check it out from
237
+ git, setup a Bundler environment for it and develop as you would for a
238
+ normal Ruby gem: code, test, rince, repeat.
239
+
240
+ Once you're happy with your functionality and its unit tests, you can
241
+ work with it on an existing workspace.
242
+
243
+ ## Installing Autoproj dependencies and working on the tests
244
+
245
+ Run
246
+
247
+ ~~~
248
+ bundle install --path=vendor
249
+ ~~~
250
+
251
+ Note that Autoproj's own test suite assumes that Bundler is setup with
252
+ `--path=vendor`. Keep it that way
253
+
254
+ To run the test suite,
255
+
256
+ ~~~
257
+ bundle exec rake test
258
+ ~~~
259
+
260
+ Or, for a single file
261
+
262
+ ~~~
263
+ bundle exec ruby PATH_TO_FILE
264
+ ~~~
265
+
266
+ Minitest's `-n` option allows you to select tests based on a match to their
267
+ names:
268
+
269
+ ~~~
270
+ bundle exec rake test TESTOPTS="-n=/build/"
271
+ bundle exec ruby PATH_TO_FILE -n=/build/
272
+ ~~~
273
+
274
+ Note that the TESTOPTS method splits arguments on spaces. Use dots (`.`)
275
+ instead of spaces.
276
+
277
+ ## Using Autoproj git in workspaces
236
278
 
237
279
  The best way to use autoproj 2.x from git is to checkout autoproj and
238
280
  autobuild manually, and write a Gemfile.autoproj-2.0 containing
239
281
 
240
282
  ```
241
- source "https://rubygems.org"
242
- gem "autoproj", path: '/home/doudou/dev/gems/autoproj'
243
- gem "autobuild", path: '/home/doudou/dev/gems/autobuild'
244
- gem "utilrb", ">= 3.0.0.a"
283
+ source "https://rubygems.org"
284
+ gem "autoproj", path: '/home/doudou/dev/gems/autoproj'
285
+ gem "autobuild", path: '/home/doudou/dev/gems/autobuild'
245
286
  ```
246
287
  Then, pass this gemfile to the --gemfile argument to autoproj_install
247
288
  or autoproj_bootstrap. Note that one can re-run autoproj_install in an
248
289
  already bootstrapped autoproj workspace, e.g.
249
290
 
250
291
  ```
251
- wget https://raw.githubusercontent.com/rock-core/autoproj/master/bin/autoproj_install
252
- ruby autoproj_install --gemfile=../Gemfile.autoproj-2.0
292
+ wget https://raw.githubusercontent.com/rock-core/autoproj/master/bin/autoproj_install
293
+ ruby autoproj_install --gemfile=../Gemfile.autoproj-2.0
253
294
  ```
295
+
296
+ If you work `lib/autoproj/ops/install.rb`, you must re-generate and test the
297
+ `autoproj_install` and `autoproj_bootstrap` scripts which integrate the code
298
+ from `install.rb`.
@@ -1,7 +1,7 @@
1
1
  #! /usr/bin/ruby
2
2
 
3
- if RUBY_VERSION < "2.1.0"
4
- STDERR.puts "autoproj requires Ruby >= 2.1.0"
3
+ if RUBY_VERSION < "2.3.0"
4
+ STDERR.puts "autoproj requires Ruby >= 2.3.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"
@@ -239,6 +239,9 @@ module Autoproj
239
239
  opt.on '--skip-stage2', 'do not run the stage2 install' do
240
240
  @skip_stage2 = true
241
241
  end
242
+ opt.on '--debug', 'Run in debug mode' do
243
+ @autoproj_options << '--debug'
244
+ end
242
245
  opt.on '--gem-source=URL', String, "use this source for RubyGems "\
243
246
  "instead of rubygems.org" do |url|
244
247
  @gem_source = url
@@ -275,19 +278,25 @@ module Autoproj
275
278
  end
276
279
  opt.on '--[no-]color', 'do not use colored output (enabled by "\
277
280
  "default if the terminal supports it)' do |color|
278
- if color then autoproj_options << "--color"
279
- else autoproj_options << '--no-color'
281
+ if color then @autoproj_options << "--color"
282
+ else @autoproj_options << '--no-color'
280
283
  end
281
284
  end
282
285
  opt.on '--[no-]progress', 'do not use progress output (enabled by "\
283
- "default if the terminal supports it)' do |color|
284
- if color then autoproj_options << "--progress"
285
- else autoproj_options << '--no-progress'
286
+ "default if the terminal supports it)' do |progress|
287
+ if progress then @autoproj_options << "--progress"
288
+ else @autoproj_options << '--no-progress'
289
+ end
290
+ end
291
+ opt.on '--[no-]interactive', 'if non-interactive, use default "\
292
+ "answer for questions' do |flag|
293
+ if flag then @autoproj_options << "--interactive"
294
+ else @autoproj_options << "--no-interactive"
286
295
  end
287
296
  end
288
297
  end
289
298
  args = options.parse(ARGV)
290
- autoproj_options + args
299
+ @autoproj_options + args
291
300
  end
292
301
 
293
302
  def find_bundler(gem_program)
@@ -677,7 +686,7 @@ require 'bundler/setup'
677
686
 
678
687
  def run_autoproj(*args)
679
688
  system env_for_child.merge('BUNDLE_GEMFILE' => autoproj_gemfile_path),
680
- Gem.ruby, autoproj_path, *args, *autoproj_options
689
+ Gem.ruby, autoproj_path, *args, *@autoproj_options
681
690
  end
682
691
 
683
692
  def v1_workspace?
@@ -701,7 +710,7 @@ require 'bundler/setup'
701
710
  clean_env = env_for_child
702
711
  stage2_vars = clean_env.map { |k, v| "#{k}=#{v}" }
703
712
  puts "starting the newly installed autoproj for stage2 install"
704
- if !run_autoproj('install-stage2', root_dir, *stage2_vars)
713
+ if !run_autoproj('install-stage2', root_dir, *stage2_vars, *@autoproj_options)
705
714
  raise "failed to execute autoproj install-stage2"
706
715
  end
707
716
  end
@@ -711,7 +720,7 @@ require 'bundler/setup'
711
720
  puts "saving temporary env.sh and .autoproj/env.sh"
712
721
  save_env_sh(*vars)
713
722
  puts "running 'autoproj envsh' to generate a proper env.sh"
714
- if !system(Gem.ruby, autoproj_path, 'envsh', *autoproj_options)
723
+ if !system(Gem.ruby, autoproj_path, 'envsh', *@autoproj_options)
715
724
  STDERR.puts "failed to run autoproj envsh on the newly installed "\
716
725
  "autoproj (#{autoproj_path})"
717
726
  exit 1
@@ -719,7 +728,7 @@ require 'bundler/setup'
719
728
  # This is really needed on an existing install to install the
720
729
  # gems that were present in the v1 layout
721
730
  puts "running 'autoproj osdeps' to re-install missing gems"
722
- if !system(Gem.ruby, autoproj_path, 'osdeps')
731
+ if !system(Gem.ruby, autoproj_path, 'osdeps', *@autoproj_options)
723
732
  STDERR.puts "failed to run autoproj osdeps on the newly installed "\
724
733
  "autoproj (#{autoproj_path})"
725
734
  exit 1
@@ -1,7 +1,7 @@
1
1
  #! /usr/bin/ruby
2
2
 
3
- if RUBY_VERSION < "2.1.0"
4
- STDERR.puts "autoproj requires Ruby >= 2.1.0"
3
+ if RUBY_VERSION < "2.3.0"
4
+ STDERR.puts "autoproj requires Ruby >= 2.3.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"
@@ -1,7 +1,7 @@
1
1
  #! /usr/bin/ruby
2
2
 
3
- if RUBY_VERSION < "2.1.0"
4
- STDERR.puts "autoproj requires Ruby >= 2.1.0"
3
+ if RUBY_VERSION < "2.3.0"
4
+ STDERR.puts "autoproj requires Ruby >= 2.3.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"
@@ -239,6 +239,9 @@ module Autoproj
239
239
  opt.on '--skip-stage2', 'do not run the stage2 install' do
240
240
  @skip_stage2 = true
241
241
  end
242
+ opt.on '--debug', 'Run in debug mode' do
243
+ @autoproj_options << '--debug'
244
+ end
242
245
  opt.on '--gem-source=URL', String, "use this source for RubyGems "\
243
246
  "instead of rubygems.org" do |url|
244
247
  @gem_source = url
@@ -275,19 +278,25 @@ module Autoproj
275
278
  end
276
279
  opt.on '--[no-]color', 'do not use colored output (enabled by "\
277
280
  "default if the terminal supports it)' do |color|
278
- if color then autoproj_options << "--color"
279
- else autoproj_options << '--no-color'
281
+ if color then @autoproj_options << "--color"
282
+ else @autoproj_options << '--no-color'
280
283
  end
281
284
  end
282
285
  opt.on '--[no-]progress', 'do not use progress output (enabled by "\
283
- "default if the terminal supports it)' do |color|
284
- if color then autoproj_options << "--progress"
285
- else autoproj_options << '--no-progress'
286
+ "default if the terminal supports it)' do |progress|
287
+ if progress then @autoproj_options << "--progress"
288
+ else @autoproj_options << '--no-progress'
289
+ end
290
+ end
291
+ opt.on '--[no-]interactive', 'if non-interactive, use default "\
292
+ "answer for questions' do |flag|
293
+ if flag then @autoproj_options << "--interactive"
294
+ else @autoproj_options << "--no-interactive"
286
295
  end
287
296
  end
288
297
  end
289
298
  args = options.parse(ARGV)
290
- autoproj_options + args
299
+ @autoproj_options + args
291
300
  end
292
301
 
293
302
  def find_bundler(gem_program)
@@ -677,7 +686,7 @@ require 'bundler/setup'
677
686
 
678
687
  def run_autoproj(*args)
679
688
  system env_for_child.merge('BUNDLE_GEMFILE' => autoproj_gemfile_path),
680
- Gem.ruby, autoproj_path, *args, *autoproj_options
689
+ Gem.ruby, autoproj_path, *args, *@autoproj_options
681
690
  end
682
691
 
683
692
  def v1_workspace?
@@ -701,7 +710,7 @@ require 'bundler/setup'
701
710
  clean_env = env_for_child
702
711
  stage2_vars = clean_env.map { |k, v| "#{k}=#{v}" }
703
712
  puts "starting the newly installed autoproj for stage2 install"
704
- if !run_autoproj('install-stage2', root_dir, *stage2_vars)
713
+ if !run_autoproj('install-stage2', root_dir, *stage2_vars, *@autoproj_options)
705
714
  raise "failed to execute autoproj install-stage2"
706
715
  end
707
716
  end
@@ -711,7 +720,7 @@ require 'bundler/setup'
711
720
  puts "saving temporary env.sh and .autoproj/env.sh"
712
721
  save_env_sh(*vars)
713
722
  puts "running 'autoproj envsh' to generate a proper env.sh"
714
- if !system(Gem.ruby, autoproj_path, 'envsh', *autoproj_options)
723
+ if !system(Gem.ruby, autoproj_path, 'envsh', *@autoproj_options)
715
724
  STDERR.puts "failed to run autoproj envsh on the newly installed "\
716
725
  "autoproj (#{autoproj_path})"
717
726
  exit 1
@@ -719,7 +728,7 @@ require 'bundler/setup'
719
728
  # This is really needed on an existing install to install the
720
729
  # gems that were present in the v1 layout
721
730
  puts "running 'autoproj osdeps' to re-install missing gems"
722
- if !system(Gem.ruby, autoproj_path, 'osdeps')
731
+ if !system(Gem.ruby, autoproj_path, 'osdeps', *@autoproj_options)
723
732
  STDERR.puts "failed to run autoproj osdeps on the newly installed "\
724
733
  "autoproj (#{autoproj_path})"
725
734
  exit 1