forked from ruby-debug/debase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
52 lines (47 loc) · 1.26 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
require 'bundler/gem_tasks'
require 'rake/testtask'
BASE_TEST_FILE_LIST = Dir['test/**/test_*.rb']
desc "Remove built files"
task :clean do
cd "ext" do
if File.exists?("Makefile")
sh "make clean"
rm "Makefile"
end
derived_files = Dir.glob(".o") + Dir.glob("*.so") + Dir.glob("*.bundle")
rm derived_files unless derived_files.empty?
end
cd "ext/attach" do
if File.exists?("Makefile")
sh "make clean"
rm "Makefile"
end
derived_files = Dir.glob(".o") + Dir.glob("*.so") + Dir.glob("*.bundle")
rm derived_files unless derived_files.empty?
end
if File.exists?('pkg')
cd 'pkg' do
derived_files = Dir.glob('*.gem')
rm derived_files unless derived_files.empty?
end
end
end
desc "Create the core debase shared library extension"
task :lib => :clean do
Dir.chdir("ext") do
system("#{Gem.ruby} extconf.rb && make")
exit $?.exitstatus if $?.exitstatus != 0
end
Dir.chdir("ext/attach") do
system("#{Gem.ruby} extconf.rb && make")
exit $?.exitstatus if $?.exitstatus != 0
end
end
desc "Test debase."
Rake::TestTask.new(:test) do |t|
t.libs += ['./ext', './lib']
t.test_files = FileList[BASE_TEST_FILE_LIST]
t.verbose = true
end
task :test => :lib
task :default => :test