autobuild 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -17,7 +17,7 @@ Hoe.spec 'autobuild' do
17
17
  end
18
18
 
19
19
  Rake.clear_tasks(/publish_docs/)
20
- task 'publish_docs' => 'doc' do
20
+ task 'publish_docs' => 'docs' do
21
21
  if !system('./update_github')
22
22
  raise "cannot update the gh-pages branch for GitHub"
23
23
  end
@@ -1,5 +1,5 @@
1
1
  module Autobuild
2
- VERSION = "1.4.0" unless defined? Autobuild::VERSION
2
+ VERSION = "1.4.1" unless defined? Autobuild::VERSION
3
3
  end
4
4
 
5
5
  require 'autobuild/config'
@@ -13,7 +13,7 @@ module Autobuild
13
13
  def self.env_add(name, *values)
14
14
  set = if environment.has_key?(name)
15
15
  environment[name]
16
- else
16
+ elsif ENV[name]
17
17
  ENV[name].split(':')
18
18
  end
19
19
 
@@ -255,7 +255,7 @@ module Autobuild
255
255
  # and installed.
256
256
  def depends_on(*packages)
257
257
  packages.each do |p|
258
- p = p.to_s
258
+ p = p.to_str
259
259
  next if p == name
260
260
  unless Package[p]
261
261
  raise ConfigException.new(name), "package #{p} not defined"
@@ -271,7 +271,7 @@ module Autobuild
271
271
  # listed in +packages+ are aliases for this package.
272
272
  def provides(*packages)
273
273
  packages.each do |p|
274
- p = p.to_s
274
+ p = p.to_str
275
275
  next if p == name
276
276
  @@provides[p] = self
277
277
  task p => name
@@ -49,23 +49,16 @@ module Autobuild
49
49
  end
50
50
  end
51
51
 
52
- def self.orocos_target
53
- user_target = ENV['OROCOS_TARGET']
54
- if @orocos_target
55
- @orocos_target.dup
56
- elsif user_target && !user_target.empty?
57
- user_target
58
- else
59
- 'gnulinux'
60
- end
61
- end
62
-
63
52
  attr_reader :project_name, :dependencies, :provides
64
- def self.load(file)
65
- FakeOrogenEnvironment.new.load(file)
53
+ def self.load(pkg, file)
54
+ FakeOrogenEnvironment.new(pkg).load(file)
66
55
  end
67
56
 
68
- def initialize
57
+ # The Autobuild::Orogen instance we are working for
58
+ attr_reader :pkg
59
+
60
+ def initialize(pkg)
61
+ @pkg = pkg
69
62
  @dependencies = Array.new
70
63
  @provides = Array.new
71
64
  end
@@ -84,12 +77,12 @@ module Autobuild
84
77
  nil
85
78
  end
86
79
  def using_toolkit(*names)
87
- names = names.map { |n| "#{n}-toolkit-#{FakeOrogenEnvironment.orocos_target}" }
80
+ names = names.map { |n| "#{n}-toolkit-#{pkg.orocos_target}" }
88
81
  @dependencies.concat(names)
89
82
  nil
90
83
  end
91
84
  def using_task_library(*names)
92
- names = names.map { |n| "#{n}-tasks-#{FakeOrogenEnvironment.orocos_target}" }
85
+ names = names.map { |n| "#{n}-tasks-#{pkg.orocos_target}" }
93
86
  @dependencies.concat(names)
94
87
  nil
95
88
  end
@@ -136,6 +129,27 @@ module Autobuild
136
129
  attr_accessor :corba
137
130
  end
138
131
 
132
+ @orocos_target = nil
133
+ def self.orocos_target
134
+ user_target = ENV['OROCOS_TARGET']
135
+ if @orocos_target
136
+ @orocos_target.dup
137
+ elsif user_target && !user_target.empty?
138
+ user_target
139
+ else
140
+ 'gnulinux'
141
+ end
142
+ end
143
+
144
+ attr_writer :orocos_target
145
+ def orocos_target
146
+ if @orocos_target.nil?
147
+ Orogen.orocos_target
148
+ else
149
+ @orocos_target
150
+ end
151
+ end
152
+
139
153
  attr_reader :orogen_spec
140
154
 
141
155
  attr_writer :corba
@@ -148,6 +162,7 @@ module Autobuild
148
162
  @corba = Orogen.corba
149
163
  super
150
164
 
165
+ @orocos_target = nil
151
166
  @orogen_file ||= "#{File.basename(name)}.orogen"
152
167
  end
153
168
 
@@ -162,9 +177,9 @@ module Autobuild
162
177
  def import
163
178
  super
164
179
 
165
- @orogen_spec = FakeOrogenEnvironment.load(File.join(srcdir, orogen_file))
166
- provides "pkgconfig/#{orogen_spec.project_name}-toolkit-#{FakeOrogenEnvironment.orocos_target}"
167
- provides "pkgconfig/#{orogen_spec.project_name}-tasks-#{FakeOrogenEnvironment.orocos_target}"
180
+ @orogen_spec = FakeOrogenEnvironment.load(self, File.join(srcdir, orogen_file))
181
+ provides "pkgconfig/#{orogen_spec.project_name}-toolkit-#{orocos_target}"
182
+ provides "pkgconfig/#{orogen_spec.project_name}-tasks-#{orocos_target}"
168
183
  orogen_spec.provides.each do |name|
169
184
  provides name
170
185
  end
@@ -173,6 +188,15 @@ module Autobuild
173
188
  def prepare
174
189
  super
175
190
 
191
+ # Check if someone provides the pkgconfig/orocos-rtt-TARGET package,
192
+ # and if so add it into our dependency list
193
+ if rtt = Autobuild::Package["pkgconfig/orocos-rtt-#{orocos_target}"]
194
+ if Autobuild.verbose
195
+ STDERR.puts "orogen: found #{rtt.name} which provides the RTT"
196
+ end
197
+ depends_on rtt.name
198
+ end
199
+
176
200
  # If required, load the component's specification and add
177
201
  # dependencies based on the orogen specification.
178
202
  orogen_spec.dependencies.each do |pkg_name|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autobuild
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Joyeux