Skip to content

Commit

Permalink
update rakefile to ensure things are built
Browse files Browse the repository at this point in the history
Before, the compile of mmeta wasn't hooked up as a dependency of TestParser so it was failing to build.
  • Loading branch information
baroquebobcat committed Jan 4, 2016
1 parent d97b86c commit 800d578
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,21 @@ file 'dist/mmeta.jar' => ['dist/mmeta-runtime.jar',
end

namespace :test do
task :compile => ['dist/mmeta.jar', 'build/test', 'build/test/MirahLexer.java']
file 'build/test/MirahLexer.java' => ['test/MirahLexer.java', 'test/Tokens.java'] do
task :compile => ['dist/mmeta.jar', 'build/test', 'build/test/MirahLexer.class']
file 'build/test/MirahLexer.class' => ['test/MirahLexer.java', 'test/Tokens.java'] do

cp "test/MirahLexer.java", "build/test/"
cp "test/Tokens.java", "build/test/"

ant.javac :srcDir => 'build/test',
:classpath => 'dist/mmeta-runtime.jar',
:debug => true
mirahc 'test',
:dir=>'build',
:dest=>'build',
:options=>[
:debug => true,
:destDir => 'build'

mirahc 'build/test',
:dir => 'build',
:dest => 'build',
:options => [
'--classpath', "dist/mmeta-runtime.jar:#{Dir.pwd}/build"
]
end
Expand All @@ -91,10 +95,11 @@ namespace :test do
t.libs << 'build/test'
t.test_files = FileList['test/test_parser.rb']
end
task :parser => ['test:compile']
end

def test_grammar(name, *options)
task('build/test/MirahLexer.java').enhance ["build/test/#{name}.mirah"]
task('build/test/MirahLexer.class').enhance ["build/test/#{name}.mirah"]
file "build/test/#{name}.mirah" => ["test/#{name}.mmeta", 'dist/mmeta.jar', 'build/test'] do
cp "test/#{name}.mmeta", "build/test/"
args = ['dist/mmeta.jar', *options]
Expand Down

0 comments on commit 800d578

Please sign in to comment.