forked from rock-core/gui-vizkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
81 lines (69 loc) · 2.7 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
require 'rake'
begin
require 'hoe'
Hoe::plugin :yard
hoe_spec = Hoe.spec('vizkit') do |p|
self.version = '0.1'
self.developer("Alexander Duda", "[email protected]")
self.summary = 'Provides a Qt ruby based framework for visualisation of rock data items'
self.readme_file = FileList['README*'].first
self.description = paragraphs_of(history_file, 3..5).join("\n\n")
self.urls = ["http://rock-robotics.org"]
self.extra_deps <<
['utilrb', ">= 1.1"] <<
['qtruby'] <<
['rake', ">= 0.8"] <<
["rake-compiler", "~> 0.8.0"] <<
["hoe-yard", ">= 0.1.2"]
end
# Making sure that native extension will be build with gem
require 'rubygems/package_task'
Gem::PackageTask.new(hoe_spec.spec) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end
# TODO move each target into a separate folder or merge targets
# At the moment both targets are build twice
# Leave in top level namespace to allow rake-compiler to build native gem: 'rake native gem'
require 'rake/extensiontask'
desc "builds Vizkit's Typelib - C extension"
vizkitypelib_task = Rake::ExtensionTask.new('vizkittypelib', hoe_spec.spec) do |ext|
# Same info as in ext/rocoros/extconf.rb where cmake
# is used to generate the Makefile
ext.name = "vizkittypelib"
ext.ext_dir = "ext/vizkittypelib"
ext.lib_dir = "lib/vizkit"
ext.gem_spec = hoe_spec.spec
ext.source_pattern = "*.{c,cpp,cc}"
if not Dir.exists?(ext.tmp_dir)
FileUtils.mkdir_p ext.tmp_dir
end
end
# TODO move each target into a separate folder or merge targets
# At the moment both targets are build twice
typelib_qt_adapter_task = Rake::ExtensionTask.new('typelib_qt_adapter', hoe_spec.spec) do |ext|
# Same info as in ext/rocoros/extconf.rb where cmake
# is used to generate the Makefile
ext.name = "TypelibQtAdapter"
ext.ext_dir = "ext/vizkittypelib"
ext.lib_dir = "lib/vizkit"
ext.gem_spec = hoe_spec.spec
ext.source_pattern = "*.{c,cpp,cc}"
if not Dir.exists?(ext.tmp_dir)
FileUtils.mkdir_p ext.tmp_dir
end
end
Rake.clear_tasks(/default/)
task :default => :compile
task :doc => :yard
task :docs => :yard
task :redoc => :yard
task :redocs => :yard
rescue LoadError
STDERR.puts "cannot load the Hoe gem. Distribution is disabled"
rescue Exception => e
if e.message !~ /\.rubyforge/
STDERR.puts "cannot load the Hoe gem, or Hoe fails. Distribution is disabled"
STDERR.puts "error message is: #{e.message}"
end
end