forked from seanhandley/h3_ruby
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
27 lines (22 loc) · 755 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
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
desc "Build H3 C library"
task :build do
unless File.exist?("ext/h3/src/Makefile")
`git submodule update --init --recursive`
print "Building h3..."
`cd ext/h3; make > /dev/null 2>&1`
puts " done."
end
end
desc "Remove compiled H3 library"
task :clean do
File.delete("ext/h3/src/Makefile") if File.exist?("ext/h3/src/Makefile")
FileUtils.remove_dir("ext/h3/src/bin") if Dir.exist?("ext/h3/src/bin")
FileUtils.remove_dir("ext/h3/src/generated") if Dir.exist?("ext/h3/src/generated")
FileUtils.remove_dir("ext/h3/src/lib") if Dir.exist?("ext/h3/src/lib")
end
task spec: :build
desc "Recompile the H3 C library"
task rebuild: %i[clean build]
task default: :spec