-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRakefile
More file actions
40 lines (29 loc) · 745 Bytes
/
Rakefile
File metadata and controls
40 lines (29 loc) · 745 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
34
35
36
37
38
39
40
# frozen_string_literal: true
require 'bundler/gem_tasks'
require 'minitest/test_task'
require 'bundler'
require 'antlr4-native'
require 'etc'
Minitest::TestTask.create
require 'rubocop/rake_task'
RuboCop::RakeTask.new
task default: %i[test rubocop]
def ruby_installer?
Object.const_defined?(:RubyInstaller)
end
Bundler::GemHelper.install_tasks
task :generate do
generator = Antlr4Native::Generator.new(
grammar_files: ['./Overpass.g4'],
output_dir: 'ext/',
parser_root_method: 'request'
)
generator.generate
end
task :compile do
Dir.chdir(File.join(%w[ext overpass_parser])) do
load 'extconf.rb'
RubyInstaller::Runtime.enable_msys_apps if ruby_installer?
exec "make -j #{Etc.nprocessors}"
end
end