-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
49 lines (39 loc) · 974 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
49
# frozen_string_literal: true
require "bundler/gem_tasks"
begin
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
rescue LoadError
warn "RSpec rake tasks was not loaded"
end
begin
require "rubocop/rake_task"
RuboCop::RakeTask.new
rescue LoadError
warn "Rubocop rake tasks was not loaded"
end
task default: %i[cmake:build]
BUILD_DIR = "build"
namespace :cmake do
desc "Remove build directory"
task :rmbuild do
sh "rm -rf #{BUILD_DIR}"
end
desc "Configure ext CMake project"
task :configure do
sh "mkdir #{BUILD_DIR} || true"
sh "cd #{BUILD_DIR} && cmake .."
end
desc "Build ext CMake project"
task build: %i[cmake:configure] do
sh "cmake --build #{BUILD_DIR}"
end
desc "Rebuild ext CMake project"
task rebuild: %i[cmake:configure] do
sh "cmake --build #{BUILD_DIR} --clean-first"
end
desc "Clean ext CMake project"
task :clean do
sh "cmake --build #{BUILD_DIR} --target clean"
end
end