forked from mvidner/ruby-dbus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
48 lines (42 loc) · 1018 Bytes
/
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
#! /usr/bin/env ruby
require 'rake'
require 'fileutils'
include FileUtils
require 'tmpdir'
require 'rake/testtask'
desc 'Default: run tests in the proper environment'
task :default => :test
def common_test_task(t)
t.libs << "lib"
t.test_files = FileList['test/*_test.rb', 'test/t[0-9]*.rb']
t.verbose = true
end
Rake::TestTask.new("bare:test") {|t| common_test_task t }
begin
require 'rcov/rcovtask'
Rcov::RcovTask.new("bare:rcov") {|t| common_test_task t }
rescue LoadError
# no rcov, never mind
end
%w(test rcov).each do |tname|
desc "Run bare:#{tname} in the proper environment"
task tname do |t|
cd "test" do
sh "./test_env rake bare:#{tname}"
end
end
end
desc "Build the gem file"
task :package do
sh "gem build ruby-dbus.gemspec"
end
desc "Build a package from a clone of the local Git repo"
task :package_git do |t|
Dir.mktmpdir do |temp|
sh "git clone . #{temp}"
cd temp do
sh "rake package"
end
cp Dir.glob("#{temp}/*.gem"), "."
end
end