forked from rock-core/tools-syskit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
76 lines (64 loc) · 1.97 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
require 'rake'
require './lib/syskit/version'
require 'utilrb/doc/rake'
begin
require 'hoe'
Hoe::RUBY_FLAGS.gsub! /-w/, ''
namespace 'dist' do
config = Hoe.spec('syskit') do |p|
self.readme_file = 'README.rd'
self.developer("Sylvain Joyeux", "[email protected]")
self.license 'LGPLv2+'
self.extra_deps <<
['utilrb', ">= 1.1"] <<
['rake', ">= 0.8"]
self.test_globs = ['test/suite.rb']
end
end
Rake.clear_tasks(/^default$/)
Rake.clear_tasks(/^doc$/)
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
task :default => ["setup:uic"]
task :test => 'dist:test'
namespace :setup do
UIFILES = %w{}
desc 'generate all Qt UI files using rbuic4'
task :uic do
rbuic = 'rbuic4'
if File.exists?('/usr/lib/kde4/bin/rbuic4')
rbuic = '/usr/lib/kde4/bin/rbuic4'
end
UIFILES.each do |file|
file = 'lib/syskit/gui/' + file
if !system(rbuic, '-o', file.gsub(/\.ui$/, '_ui.rb'), file)
STDERR.puts "Failed to generate #{file}"
end
end
end
end
task :setup => "setup:ext"
desc "remove by-products of setup"
task :clean
if Utilrb.doc?
namespace 'doc' do
Utilrb.doc 'api', :include => ['lib/**/*.rb'],
:exclude => [],
:target_dir => 'doc',
:title => 'Syskit',
:plugins => ['utilrb', 'roby'],
:files => ['Upgrading.md']
# desc 'generate all documentation'
# task 'all' => 'doc:api'
end
task 'redocs' => 'doc:reapi'
task 'doc' => 'doc:api'
else
STDERR.puts "WARN: cannot load yard or rdoc , documentation generation disabled"
end