autobuild 1.5.6 → 1.5.7

Sign up to get free protection for your applications and to get access to all the features.
data/Changes.txt CHANGED
@@ -1,3 +1,9 @@
1
+ == Version 1.5.7
2
+ * the "importer" package will now rebuild if the main prefix is deleted. It was
3
+ previously not, which was leading to partial builds if the actual installation
4
+ was done by a post_install block
5
+ * fix the documentation mode
6
+
1
7
  == Version 1.5.6
2
8
  * fix the directory in error message when a git importer detects a non-git
3
9
  repository
data/lib/autobuild.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Autobuild
2
- VERSION = "1.5.6" unless defined? Autobuild::VERSION
2
+ VERSION = "1.5.7" unless defined? Autobuild::VERSION
3
3
  end
4
4
 
5
5
  require 'autobuild/config'
@@ -241,7 +241,9 @@ module Autobuild
241
241
  targets = if packages.empty?
242
242
  phase
243
243
  else
244
- packages.map { |pkg| "#{pkg}-#{phase}" }
244
+ packages.
245
+ find_all { |pkg| Rake.application.lookup("#{pkg}-#{phase}") }.
246
+ map { |pkg| "#{pkg}-#{phase}" }
245
247
  end
246
248
 
247
249
  task "#{buildname}-#{phase}" => targets
@@ -206,12 +206,28 @@ module Autobuild
206
206
  # is package-specific. The default implementation interpret them
207
207
  # as relative to the source directory, but packages like CMake will
208
208
  # interpret them as relative to their build directories.
209
- attr_accessor :doc_dir
209
+ attr_writer :doc_dir
210
+
211
+ # Absolute path to where documentation is generated. Returns nil if the
212
+ # doc_dir attribute is not set.
213
+ def doc_dir
214
+ if @doc_dir
215
+ File.expand_path(@doc_dir, srcdir)
216
+ end
217
+ end
210
218
 
211
219
  # Directory in which the documentation target should install the
212
220
  # documentation. If it is relative, it is interpreted as relative to
213
- # the prefix directory.
214
- attr_accessor :doc_target_dir
221
+ # the documentation prefix directory (Autobuild.doc_prefix)
222
+ attr_writer :doc_target_dir
223
+
224
+ # Absolute path to where documentation has to be installed. Returns nil
225
+ # if the doc_target_dir attribute is not set.
226
+ def doc_target_dir
227
+ if @doc_target_dir
228
+ File.expand_path(@doc_target_dir, File.expand_path(Autobuild.doc_prefix || '.', prefix))
229
+ end
230
+ end
215
231
 
216
232
  # Defines a documentation generation task. The documentation is first
217
233
  # generated by the given block, and then installed. The local attribute
@@ -252,10 +268,9 @@ module Autobuild
252
268
  task :doc => "#{name}-doc"
253
269
  end
254
270
 
255
- def install_doc(relative_to = srcdir)
256
- full_doc_prefix = File.expand_path(Autobuild.doc_prefix, Autobuild.prefix)
257
- doc_target_dir = File.expand_path(self.doc_target_dir, full_doc_prefix)
258
- doc_dir = File.expand_path(self.doc_dir, relative_to)
271
+ def install_doc
272
+ doc_target_dir = self.doc_target_dir
273
+ doc_dir = self.doc_dir
259
274
  FileUtils.rm_rf doc_target_dir
260
275
  FileUtils.mkdir_p File.dirname(doc_target_dir)
261
276
  FileUtils.cp_r doc_dir, doc_target_dir
@@ -56,8 +56,10 @@ module Autobuild
56
56
  @defines[name] = value
57
57
  end
58
58
 
59
- def install_doc
60
- super(builddir)
59
+ def doc_dir
60
+ if @doc_dir
61
+ File.expand_path(@doc_dir, builddir)
62
+ end
61
63
  end
62
64
 
63
65
  # Declare that the given target can be used to generate documentation
@@ -7,10 +7,6 @@ module Autobuild
7
7
  end
8
8
 
9
9
  class ImporterPackage < Package
10
- def installstamp
11
- "#{srcdir}/#{STAMPFILE}"
12
- end
13
-
14
10
  attr_reader :exclude
15
11
 
16
12
  def initialize(*args)
@@ -172,6 +172,13 @@ module Autobuild
172
172
  end
173
173
  end
174
174
 
175
+ def self.map_dependencies_with(&block)
176
+ @dependency_mapper = block
177
+ end
178
+ def self.dependency_mapper
179
+ @dependency_mapper
180
+ end
181
+
175
182
  attr_writer :orocos_target
176
183
  def orocos_target
177
184
  if @orocos_target.nil?
@@ -228,6 +235,8 @@ module Autobuild
228
235
  target = "pkgconfig/#{pkg_name}"
229
236
  if Autobuild::Package[target]
230
237
  depends_on target
238
+ elsif self.class.dependency_mapper && target = self.class.dependency_mapper[pkg_name]
239
+ depends_on target
231
240
  end
232
241
  end
233
242
 
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.5.6
4
+ version: 1.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Joyeux
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-03-03 00:00:00 +01:00
12
+ date: 2010-03-26 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency