forked from sparkapi/sparkql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
31 lines (24 loc) · 772 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
require "rubygems"
require 'rubygems/user_interaction'
require 'rake/testtask'
require 'ci/reporter/rake/test_unit'
require 'bundler/gem_tasks'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/**/*_test.rb'
test.verbose = true
end
rule '.rb' => '.y' do |t|
sh "racc -l -o #{t.name} #{t.source}"
end
desc "Compile the racc parser from the grammar"
task :compile => ["lib/sparkql/parser.rb", "grammar"]
desc "Generate grammar Documenation"
task :grammar do
puts "Generating grammar documentation..."
sh "ruby script/markdownify.rb > GRAMMAR.md"
end
Rake::Task[:test].prerequisites.unshift "lib/sparkql/parser.rb"
Rake::Task[:test].prerequisites.unshift "grammar"
desc 'Default: run unit tests.'
task :default => :test