-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
48 lines (40 loc) · 1015 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
desc "Build freshly"
task default: [:clean, :build, :test]
namespace :build do
desc "Build scanner"
task scanner: "build/scanner.rb"
desc "Build parser"
task parser: "build/parser.rb"
namespace :debug do
task :parser do
`racc -g -v -O build/parser.output -o build/parser.rb dagon/parser.y`
end
end
end
desc "Build scanner and parser"
task build: %w{build:scanner build:parser}
task debug: %w{build:scanner build:debug:parser}
desc "Remove generated files"
task :clean do
if File.exists?('build/')
`rm -r build`
end
end
desc "See todos"
task :todo do
system("grep -rInso 'TODO: \\(.\\+\\)' bin core dagon lib spec")
end
file "build/parser.rb" => "dagon/parser.y" do
puts "Building parser"
`mkdir -p build/`
`racc -g -o build/parser.rb dagon/parser.y`
end
file "build/scanner.rb" => "dagon/scanner.rl" do
puts "Building scanner"
`mkdir -p build/`
`ragel -R dagon/scanner.rl -o build/scanner.rb`
end
task :test do
puts "Running tests..."
system('dspec')
end