forked from OTL/rosruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
88 lines (77 loc) · 2.47 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
80
81
82
83
84
85
86
87
88
$:.push("#{File.dirname(__FILE__)}/lib")
task :default => :msg_local
message_dir = "#{ENV['HOME']}/.ros/rosruby"
desc "generate all messages in local dir"
task :msg_local => message_dir
require 'rake/clean'
CLEAN << 'doc'
CLEAN << message_dir
require 'rubygems'
require 'yard'
YARD::Rake::YardocTask.new do |t|
t.files = ['lib/**/*.rb']
t.options = ['--readme', 'README.md']
end
require 'rubygems/package_task'
rosruby_spec = Gem::Specification.new do |s|
s.name = "rosruby"
s.summary = "ROS ruby client"
s.requirements << 'none'
s.version = '0.0.1'
s.author = "Takashi Ogura"
s.email = "[email protected]"
s.homepage = "http://github.com/OTL/rosruby"
s.platform = Gem::Platform::RUBY
s.files = Dir['lib/**/**', 'samples/**', 'scripts/**/**']
s.executables = ['rubyroscore']
s.add_development_dependency('rake')
s.test_files = Dir["test/test*.rb"]
s.description = File.read("README.md")
end
Gem::PackageTask.new(rosruby_spec).define
desc "Generate precompiled msg gem"
task :msg_gem do
target_msg_packages = "actionlib_msgs pr2_controllers_msgs std_msgs visualization_msgs actionlib_tutorials roscpp stereo_msgs geometry_msgs rosgraph_msgs tf nav_msgs sensor_msgs trajectory_msgs std_srvs"
system("scripts/rosruby_genmsg.py #{target_msg_packages} -d /tmp/rosruby/")
mkdir_p('msg_gem/lib')
cp_r(Dir.glob("/tmp/rosruby/msg/*"), "msg_gem/lib/")
cp_r(Dir.glob("/tmp/rosruby/srv/*"), "msg_gem/lib/")
chdir('msg_gem') do
namespace :msg do
msg_spec = Gem::Specification.new do |s|
s.name = "rosruby_msgs"
s.summary = "rosruby's basic msg/srv"
s.requirements << 'none'
s.version = '0.0.4'
s.author = "Takashi Ogura"
s.email = "[email protected]"
s.homepage = "http://github.com/OTL/rosruby"
s.platform = Gem::Platform::RUBY
s.has_rdoc = false
s.files = Dir['lib/**/**']
s.description = "precompiled msg files for rosruby."
end
Gem::PackageTask.new(msg_spec).define
end
Rake::Task["msg:package"].invoke
end
end
desc "generate all messages in local dir."
file message_dir do |file|
sh('scripts/rosruby_genmsg.py')
end
require 'rake/testtask'
Rake::TestTask.new(:test_without_master) do |t|
t.test_files = FileList['test/test*.rb']
t.verbose = true
end
desc "test with roscore"
task :test do
require "ros/roscore"
thread = Thread.new do
ROS::start_roscore
end
ROS::wait_roscore
Rake::Task["test_without_master"].invoke
Thread.kill(thread)
end