about summary refs log tree commit homepage
path: root/Rakefile
diff options
context:
space:
mode:
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile13
1 files changed, 12 insertions, 1 deletions
diff --git a/Rakefile b/Rakefile
index 4b53bcc..f699c1b 100644
--- a/Rakefile
+++ b/Rakefile
@@ -165,7 +165,18 @@ task :gem_source => [:package_all] do
 end
 
 task :ragel do
-  sh "ragel ext/http11/http11_parser.rl | rlgen-cd -G2 -o ext/http11/http11_parser.c"
+  Dir.chdir "ext/http11" do
+    target = "http11_parser.c"
+    File.unlink target if File.exist? target
+    sh "ragel http11_parser.rl | rlgen-cd -G2 -o #{target}"
+    raise "Failed to build C source" unless File.exist? target
+  end
+  Dir.chdir "ext/http11_java" do
+    target = "org/jruby/mongrel/Http11Parser.java"
+    File.unlink target if File.exist? target
+    sh "ragel -J http11_parser.rl | rlgen-java -o #{target}"
+    raise "Failed to build Java source" unless File.exist? target
+  end
 end
 
 task :site_webgen do