autoproj 2.6.1 → 2.7.0

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
  SHA1:
3
- metadata.gz: 68e9f51443df2835dca1ca6018c66c1ddddc191c
4
- data.tar.gz: 90ddec45d88fad399a89f27b5125e64ce776a692
3
+ metadata.gz: fe336a236c728540d3c9490eaa77e358429bf5f0
4
+ data.tar.gz: a3aee015246de3a37f7b1e689918f28f88ebacfd
5
5
  SHA512:
6
- metadata.gz: 8262c141ccda64777df11c91a3536bfe23feb48f9189fd16d04b7a891a1227ceb7c6a54bb5e5067ae7efce930a6cd965b47fcf38f951eb23c4ddc9c81bda0c20
7
- data.tar.gz: 5ee4a343b0fafda6f82be49c87a87d60e8242521b0a532d726bf896f4b384bee2c8b6e5b9abb1ba2a5062981ba0883de04397431d3edd6da31ee918598c72399
6
+ metadata.gz: 4460ab6fbe3bfbdf2acdf5915fe7441c6cca8c378ebcdccec3e1cca26c06a71159a1b0d51398bdff83194408dfe2b26b9fb8a74ec98cd0f4d2f493c1f4e0e9f9
7
+ data.tar.gz: e2bf36c2a3907755a6303af154fd0bc534d51a9a9b88a90e4aa46a5e94e5719df468297496a21a7d2fcea5f6a267ea872aca2248f2c589105a0f518860db300e
data/autoproj.gemspec CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
25
25
  s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
26
 
27
27
  s.add_runtime_dependency "bundler"
28
- s.add_runtime_dependency "autobuild", ">= 1.13.0"
28
+ s.add_runtime_dependency "autobuild", ">= 1.14.0"
29
29
  s.add_runtime_dependency "backports", '~> 3.0'
30
30
  s.add_runtime_dependency "utilrb", '~> 3.0.0', ">= 3.0.0"
31
31
  s.add_runtime_dependency "thor", '~> 0.20.0'
@@ -110,6 +110,9 @@ def self.package_handler_for(full_path)
110
110
  find_topmost_directory_containing(full_path, "lib/*.rb")
111
111
 
112
112
  return "ruby_package", dir
113
+ elsif (dir = find_topmost_directory_containing(full_path, 'setup.py')) ||
114
+ (dir = find_topmost_directory_containing(full_path, File.join(File.basename(full_path), "*.py")))
115
+ return 'python_package', dir
113
116
  end
114
117
  end
115
118
  end
@@ -156,6 +159,10 @@ def import_package(name, workspace: Autoproj.workspace, &block)
156
159
  package_common(:import, name, workspace: Autoproj.workspace, &block)
157
160
  end
158
161
 
162
+ def python_package(name, workspace: Autoproj.workspace, &block)
163
+ package_common(:python, name, workspace: Autoproj.workspace, &block)
164
+ end
165
+
159
166
  def common_make_based_package_setup(pkg)
160
167
  unless pkg.has_doc? && pkg.doc_dir
161
168
  pkg.with_doc do
@@ -197,6 +204,14 @@ def cmake_package(name, workspace: Autoproj.workspace)
197
204
  end
198
205
  end
199
206
 
207
+ # Define a package that was originall designed for Catkin
208
+ def catkin_package(name, workspace: Autoproj.workspace)
209
+ cmake_package(name, workspace: workspace) do |pkg|
210
+ pkg.use_package_xml = true
211
+ yield(pkg) if block_given?
212
+ end
213
+ end
214
+
200
215
  # Define an autotools package
201
216
  #
202
217
  # Example:
@@ -230,7 +245,7 @@ def env_add(name, value)
230
245
  # Defines a Ruby package
231
246
  #
232
247
  # Example:
233
- #
248
+ #
234
249
  # ruby_package 'package_name' do |pkg|
235
250
  # pkg.doc_target = 'doc'
236
251
  # end
@@ -23,8 +23,20 @@ def initialize(spec = Hash.new)
23
23
  @added_tags = Set.new
24
24
  @optional_dependencies = Set.new
25
25
  @description = PackageManifest.new(self, null: true)
26
+ @use_package_xml = false
26
27
  end
27
28
 
29
+ # Whether we should use a package.xml file present in this package
30
+ # (parsed as ROS' catkin would) instead of Autoproj's manifest.xml
31
+ #
32
+ # @see use_package_xml=
33
+ def use_package_xml?
34
+ @use_package_xml
35
+ end
36
+
37
+ # Set {#use_package_xml?}
38
+ attr_writer :use_package_xml
39
+
28
40
  # The set of tags for this package. This is an union of the tags
29
41
  # contained in +description+ and the ones explicitely added with
30
42
  # #add_tag
@@ -207,7 +207,11 @@ def build(*packages)
207
207
  tool_failure_mode: :report_silent)
208
208
  if !failures.empty?
209
209
  Autobuild.silent = false
210
- packages_failed = failures.
210
+ package_failures, config_failures = failures.partition do |e|
211
+ e.respond_to?(:target) && e.target.respond_to?(:name)
212
+ end
213
+
214
+ packages_failed = package_failures.
211
215
  map do |e|
212
216
  if e.respond_to?(:target) && e.target.respond_to?(:name)
213
217
  e.target.name
@@ -216,6 +220,9 @@ def build(*packages)
216
220
  if !packages_failed.empty?
217
221
  Autobuild.error "#{packages_failed.size} packages failed: #{packages_failed.sort.join(", ")}"
218
222
  end
223
+ config_failures.each do |e|
224
+ Autobuild.error(e)
225
+ end
219
226
  exit 1
220
227
  end
221
228
  end
@@ -85,12 +85,20 @@ def status_of_package(package_description, only_local: false, snapshot: false)
85
85
  elsif !File.directory?(pkg.srcdir)
86
86
  package_status.msg << Autoproj.color(" is not imported yet", :magenta)
87
87
  else
88
- if importer.respond_to?(:snapshot)
88
+ begin status = importer.status(pkg, only_local)
89
+ rescue StandardError => e
90
+ package_status.msg << Autoproj.color(" failed to fetch status information (#{e})", :red)
91
+ return package_status
92
+ end
93
+
94
+ snapshot_useful = [Autobuild::Importer::Status::ADVANCED, Autobuild::Importer::Status::NEEDS_MERGE].
95
+ include?(status.status)
96
+ if snapshot && snapshot_useful && importer.respond_to?(:snapshot)
89
97
  snapshot_version =
90
98
  begin importer.snapshot(pkg, nil, exact_state: false, only_local: only_local)
91
99
  rescue Autobuild::PackageException
92
100
  Hash.new
93
- rescue Exception => e
101
+ rescue StandardError => e
94
102
  package_status.msg << Autoproj.color(" failed to fetch snapshotting information (#{e})", :red)
95
103
  return package_status
96
104
  end
@@ -104,14 +112,6 @@ def status_of_package(package_description, only_local: false, snapshot: false)
104
112
  end
105
113
  end
106
114
 
107
- begin status = importer.status(pkg, only_local)
108
- rescue Interrupt
109
- raise
110
- rescue Exception => e
111
- package_status.msg << Autoproj.color(" failed to fetch status information (#{e})", :red)
112
- return package_status
113
- end
114
-
115
115
  status.unexpected_working_copy_state.each do |msg|
116
116
  package_status.msg << Autoproj.color(" #{msg}", :red, :bold)
117
117
  end
@@ -87,7 +87,10 @@ ruby23:
87
87
  default: ignore # we assume that if the user has a ruby 2.3 runtime, it is usable
88
88
 
89
89
  ruby24:
90
- default: ignore # we assume that if the user has a ruby 2.3 runtime, it is usable
90
+ default: ignore # we assume that if the user has a ruby 2.4 runtime, it is usable
91
+
92
+ ruby25:
93
+ default: ignore # we assume that if the user has a ruby 2.5 runtime, it is usable
91
94
 
92
95
  build-essential:
93
96
  debian,ubuntu: build-essential
@@ -978,6 +978,8 @@ def whereis(package_name)
978
978
  '/'
979
979
  end
980
980
 
981
+ class NoPackageXML < ConfigError; end
982
+
981
983
  # Loads the package's manifest.xml file for the current package
982
984
  #
983
985
  # Right now, the absence of a manifest makes autoproj only issue a
@@ -994,23 +996,32 @@ def load_package_manifest(pkg)
994
996
 
995
997
  # Look for the package's manifest.xml, but fallback to a manifest in
996
998
  # the package set if present
997
- manifest_paths = [File.join(package.srcdir, "manifest.xml")]
998
- if package_set.local_dir
999
- manifest_paths << File.join(package_set.local_dir, "manifests", package.name + ".xml")
1000
- end
1001
- manifest_path = manifest_paths.find do |path|
1002
- File.file?(path)
999
+ if package.use_package_xml?
1000
+ manifest_path = File.join(package.srcdir, "package.xml")
1001
+ raise NoPackageXML.new(package.srcdir), "#{package.name} from "\
1002
+ "#{package_set.name} has use_package_xml set, but the package has "\
1003
+ "no package.xml file" unless File.file?(manifest_path)
1004
+
1005
+ manifest = PackageManifest.load(package, manifest_path,
1006
+ ros_manifest: true)
1007
+ else
1008
+ manifest_paths = [File.join(package.srcdir, "manifest.xml")]
1009
+ if package_set.local_dir
1010
+ manifest_paths << File.join(
1011
+ package_set.local_dir, "manifests", package.name + ".xml")
1012
+ end
1013
+ manifest_path = manifest_paths.find do |path|
1014
+ File.file?(path)
1015
+ end
1016
+ if manifest_path
1017
+ manifest = PackageManifest.load(package, manifest_path,
1018
+ ros_manifest: false)
1019
+ end
1003
1020
  end
1004
1021
 
1005
- # Alternatively, use a ROS manifest file
1006
- ros_manifest_path = File.join(package.srcdir, 'package.xml')
1007
- ros_manifest_path = nil unless File.file?(ros_manifest_path)
1008
-
1009
- if manifest_path
1010
- pkg.autobuild.description = PackageManifest.load(package, manifest_path)
1011
- elsif ros_manifest_path
1012
- pkg.autobuild.description = PackageManifest.load(package, ros_manifest_path, ros_manifest: true)
1013
- elsif pkg.autobuild.description.null?
1022
+ if manifest
1023
+ pkg.autobuild.description = manifest
1024
+ else
1014
1025
  Autoproj.warn "#{package.name} from #{package_set.name} does not have a manifest"
1015
1026
  end
1016
1027
 
@@ -1238,4 +1249,3 @@ def self.add_osdeps_overrides(*args, &block)
1238
1249
  manifest.add_osdeps_overrides(*args, &block)
1239
1250
  end
1240
1251
  end
1241
-
@@ -83,6 +83,12 @@ def self.report(root_dir: nil, silent: nil, debug: Autobuild.debug,
83
83
  reporter = Autoproj::Reporter.new
84
84
  Autobuild::Reporting << reporter
85
85
  interrupted = nil
86
+
87
+ if !silent.nil?
88
+ on_package_success = silent ? :silent : :report
89
+ end
90
+ silent_errors = [:report_silent, :exit_silent].include?(on_package_failures)
91
+
86
92
  package_failures = Autobuild::Reporting.report(on_package_failures: :report_silent) do
87
93
  begin
88
94
  reporter.reset_timer
@@ -92,10 +98,6 @@ def self.report(root_dir: nil, silent: nil, debug: Autobuild.debug,
92
98
  end
93
99
  end
94
100
 
95
- if !silent.nil?
96
- on_package_success = silent ? :silent : :report
97
- end
98
- silent_errors = [:report_silent, :exit_silent].include?(on_package_failures)
99
101
 
100
102
  if package_failures.empty?
101
103
  if interrupted
@@ -116,6 +118,7 @@ def self.report(root_dir: nil, silent: nil, debug: Autobuild.debug,
116
118
  raise e
117
119
  elsif on_package_failures == :report
118
120
  Autoproj.error e.message
121
+ [e]
119
122
  elsif on_package_failures == :exit
120
123
  Autoproj.error e.message
121
124
  exit 1
data/lib/autoproj/test.rb CHANGED
@@ -394,10 +394,27 @@ def ws_create_git_package_set(name, source_data = Hash.new)
394
394
  end
395
395
  dir
396
396
  end
397
+
398
+ def ws_create_package_set_file(pkg_set, name, content)
399
+ path = File.join(pkg_set.raw_local_dir, name)
400
+ FileUtils.mkdir_p File.dirname(path)
401
+ File.open(path, 'w') do |io|
402
+ io.write content
403
+ end
404
+ path
405
+ end
406
+
407
+ def ws_create_package_file(pkg, name, content)
408
+ path = File.join(pkg.autobuild.srcdir, name)
409
+ FileUtils.mkdir_p File.dirname(path)
410
+ File.open(path, 'w') do |io|
411
+ io.write content
412
+ end
413
+ path
414
+ end
397
415
  end
398
416
  end
399
417
 
400
418
  class Minitest::Test
401
419
  include Autoproj::SelfTest
402
420
  end
403
-
@@ -1,3 +1,3 @@
1
1
  module Autoproj
2
- VERSION = "2.6.1"
2
+ VERSION = "2.7.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoproj
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.1
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Joyeux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-25 00:00:00.000000000 Z
11
+ date: 2018-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.13.0
33
+ version: 1.14.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 1.13.0
40
+ version: 1.14.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: backports
43
43
  requirement: !ruby/object:Gem::Requirement