-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathRakefile
More file actions
33 lines (27 loc) · 772 Bytes
/
Rakefile
File metadata and controls
33 lines (27 loc) · 772 Bytes
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
require 'rake/testtask'
require 'rake/clean'
NAME = 'rbpoly2tri'
file "lib/#{NAME}/#{NAME}.o" => Dir.glob("ext/#{NAME}/*{.rb,.c,.cc,.h}") do
Dir.chdir("ext/#{NAME}") do
ruby "extconf.rb"
sh "make"
end
cp "ext/#{NAME}/#{NAME}.o", "lib/#{NAME}"
end
# make the :test task depend on the shared
# object, so it will be built automatically
# before running the tests
task :test => "lib/#{NAME}/#{NAME}.o"
# use 'rake clean' and 'rake clobber' to
# easily delete generated files
CLEAN.include('ext/**/*{.o,.log,.so}')
CLEAN.include('ext/**/Makefile')
CLEAN.include('ext/**/*.bundle')
CLEAN.include("lib/#{NAME}")
CLOBBER.include('lib/**/*{.o,.so}')
# the same as before
Rake::TestTask.new do |t|
t.libs << 'test'
end
desc "Run tests"
task :default => :test