-
Notifications
You must be signed in to change notification settings - Fork 0
/
rakefile
35 lines (28 loc) · 808 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
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new do |c|
options = ['--color']
options += ["--format", "documentation"]
c.rspec_opts = options
end
desc "Generate Lexer"
task :lexer do
`rex src/analyzers/lex.rex -o build/analyzers/lexerino.rb`
end
desc "Generate Parser"
task :parser do
`racc -v src/analyzers/parser.y.rb -o build/analyzers/parserino.rb`
end
desc "Generate Lexer and Parser"
task :generate => [:build_setup, :lexer, :parser]
desc "Build setup"
task :build_setup do
`mkdir -p build/analyzers && rsync -a --exclude='analyzers/' src/* build`
end
desc "Cleeeean"
task :clean do
`rm -rf build`
end
desc "Running test"
task :test, [:file_name, :debug] => :generate do |t, args|
exec "ruby", "-I", "./build", "test/test.rb", "#{args[:file_name]}", "#{args[:debug]}"
end