<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -6,8 +6,8 @@ require 'echoe'
 e = Echoe.new(&quot;mongrel&quot;) do |p|
   p.summary = &quot;A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps.&quot;
   p.author =&quot;Zed A. Shaw&quot;
-  p.clean_pattern = ['ext/http11/*.{bundle,so,o,obj,pdb,lib,def,exp}', 'ext/http11/Makefile', 'pkg', 'lib/*.bundle', '*.gem', 'site/output', '.config']
-  p.rdoc_pattern = ['README', 'LICENSE', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc', 'ext/http11/http11.c']
+  p.clean_pattern = ['ext/http11/*.{bundle,so,o,obj,pdb,lib,def,exp}', 'ext/http11/Makefile', 'pkg', 'lib/*.bundle', '*.gem', 'site/output', '.config', 'lib/http11.jar', 'ext/http11_java/classes', 'coverage']
+  p.rdoc_pattern = ['README', 'LICENSE', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc']
   p.ignore_pattern = /^(pkg|site|projects|doc|log)|CVS|\.log/
   p.ruby_version = '&gt;= 1.8.4'
   p.dependencies = ['gem_plugin &gt;=0.2.3', 'cgi_multipart_eof_fix &gt;=2.4']
@@ -15,8 +15,14 @@ e = Echoe.new(&quot;mongrel&quot;) do |p|
   p.need_tar_gz = false
   p.need_tgz = true
 
-  p.certificate_chain = ['~/p/configuration/gem_certificates/mongrel/mongrel-public_cert.pem', 
+  case RUBY_PLATFORM 
+  when /mswin/
+    p.certificate_chain = ['~/gem_certificates/mongrel-public_cert.pem', 
+      '~/gem_certificates/luislavena-mongrel-public_cert.pem']
+  else
+    p.certificate_chain = ['~/p/configuration/gem_certificates/mongrel/mongrel-public_cert.pem', 
       '~/p/configuration/gem_certificates/evan_weaver-mongrel-public_cert.pem']
+  end
 
   p.eval = proc do  
     case RUBY_PLATFORM
@@ -24,6 +30,10 @@ e = Echoe.new(&quot;mongrel&quot;) do |p|
       extensions.clear
       self.files += ['lib/http11.so']
       self.platform = Gem::Platform::WIN32
+    when /java/
+      extensions.clear
+      self.files += ['lib/http11.jar']
+      self.platform = 'jruby'
     else
       add_dependency('daemons', '&gt;= 1.0.3')
       add_dependency('fastthread', '&gt;= 1.0.1')
@@ -42,6 +52,21 @@ task :ragel do
     sh &quot;ragel http11_parser.rl | rlgen-cd -G2 -o #{target}&quot;
     raise &quot;Failed to build C source&quot; unless File.exist? target
   end
+  Dir.chdir &quot;ext/http11&quot; do
+    target = &quot;../../ext/http11_java/org/jruby/mongrel/Http11Parser.java&quot;
+    File.unlink target if File.exist? target
+    sh &quot;ragel -J http11_parser.java.rl | rlgen-java -o #{target}&quot;
+    raise &quot;Failed to build Java source&quot; unless File.exist? target
+  end
+end
+
+#### XXX Hack around JRuby test/unit interaction problems
+
+desc &quot;Run each test suite in isolation on JRuby&quot;
+task :test_java do
+  e.test_pattern.each do |f|
+    sh &quot;/opt/local/jruby/bin/jruby -w -Ilib:ext:bin:test -e 'require \&quot;#{f}\&quot;'&quot; rescue nil
+  end
 end
 
 #### XXX Hack around RubyGems and Echoe for pre-compiled extensions.
@@ -50,13 +75,42 @@ def move_extensions
   Dir[&quot;ext/**/*.#{Config::CONFIG['DLEXT']}&quot;].each { |file| cp file, &quot;lib/&quot; }
 end
 
+def java_classpath_arg 
+  # A myriad of ways to discover the JRuby classpath
+  classpath = begin
+    require 'java' 
+    # Already running in a JRuby JVM
+    Java::java.lang.System.getProperty('java.class.path')
+  rescue LoadError
+    ENV['JRUBY_PARENT_CLASSPATH'] || ENV['JRUBY_HOME'] &amp;&amp; FileList[&quot;#{ENV['JRUBY_HOME']}/lib/*.jar&quot;].join(File::PATH_SEPARATOR)
+  end
+  classpath ? &quot;-cp #{classpath}&quot; : &quot;&quot;
+end
+
 case RUBY_PLATFORM
 when /mswin/
   filename = &quot;lib/http11.so&quot;
-  file filename do    
-    cp &quot;#{filename}.win32&quot;, filename
+  file filename do
+    Dir.chdir(&quot;ext/http11&quot;) do 
+      ruby &quot;extconf.rb&quot;
+      system(PLATFORM =~ /mswin/ ? 'nmake' : 'make')
+    end
+    move_extensions
   end 
   task :compile =&gt; [filename]
+
+when /java/
+  filename = &quot;lib/http11.jar&quot;
+  file filename do
+    build_dir = &quot;ext/http11_java/classes&quot;
+    mkdir_p build_dir
+    sources = FileList['ext/http11_java/**/*.java'].join(' ')
+    sh &quot;javac -target 1.4 -source 1.4 -d #{build_dir} #{java_classpath_arg} #{sources}&quot;
+    sh &quot;jar cf lib/http11.jar -C #{build_dir} .&quot;
+    move_extensions      
+  end      
+  task :compile =&gt; [filename]
+
 end
 
 #### Project-wide install and uninstall tasks
@@ -79,6 +133,8 @@ task :package_all =&gt; [:package] do
   sub_project(&quot;mongrel_console&quot;, :package)
   sub_project(&quot;mongrel_cluster&quot;, :package)
   sub_project(&quot;mongrel_service&quot;, :package) if RUBY_PLATFORM =~ /mswin/
+  sh(&quot;rake java package&quot;) unless RUBY_PLATFORM =~ /java/
+  # sh(&quot;rake mswin package&quot;) unless RUBY_PLATFORM =~ /mswin/
 end
 
 task :install_requirements do
@@ -136,8 +192,8 @@ namespace :site do
     FileList[&quot;**/*.tgz&quot;].each {|tgz| mv tgz, &quot;pkg/tars&quot; }
     
     # XXX Hack, because only Luis can package for Win32 right now
-    sh &quot;cp ~/Downloads/mongrel-#{e.version}-mswin32.gem pkg/gems/&quot;
-    sh &quot;cp ~/Downloads/mongrel_service-0.3.3-mswin32.gem pkg/gems/&quot;  
+    # sh &quot;cp ~/Downloads/mongrel-#{e.version}-mswin32.gem pkg/gems/&quot;
+    # sh &quot;cp ~/Downloads/mongrel_service-0.3.3-mswin32.gem pkg/gems/&quot;  
     sh &quot;rm -rf pkg/mongrel*&quot;
     sh &quot;gem generate_index -d pkg&quot;  
     sh &quot;scp -r CHANGELOG pkg/* rubyforge.org:/var/www/gforge-projects/mongrel/releases/&quot; 
@@ -149,21 +205,21 @@ namespace :site do
   desc &quot;Upload the website&quot;
   task :web do
     # Requires the 'webgem' gem and the 'atom-tools' gem
-    sh &quot;cd site; webgen; ruby atom.rb &gt; output/feed.atom; rsync -azv --no-perms --no-times output/* rubyforge.org:/var/www/gforge-projects/mongrel/&quot;
+    sh &quot;cd site; webgen; webgen; ruby atom.rb &gt; output/feed.atom; rsync -azv --no-perms --no-times output/* rubyforge.org:/var/www/gforge-projects/mongrel/&quot;
   end
   
   desc &quot;Upload the rdocs&quot;
-  task :rdoc =&gt; [:redoc] do
-    sh &quot;rsync -azv doc/* rubyforge.org:/var/www/gforge-projects/mongrel/rdoc/&quot;
-    sh &quot;cd projects/gem_plugin; rake site&quot;
+  task :rdoc =&gt; [:doc] do
+    sh &quot;rsync -azv --no-perms --no-times doc/* rubyforge.org:/var/www/gforge-projects/mongrel/rdoc/&quot;
+    sh &quot;cd projects/gem_plugin; rake site:rdoc&quot;
   end
   
   desc &quot;Upload the coverage report&quot;
   task :coverage =&gt; [:rcov] do
-    sh &quot;rsync -azv test/coverage/* rubyforge.org:/var/www/gforge-projects/mongrel/coverage/&quot;
+    sh &quot;rsync -azv --no-perms --no-times test/coverage/* rubyforge.org:/var/www/gforge-projects/mongrel/coverage/&quot; rescue nil
   end
   
   desc &quot;Upload the website, the rdocs, and the coverage report&quot;
-  task :all =&gt; [:web, :rdoc, :coverage]
+  task :all =&gt; [:clean, :web, :rdoc, :coverage]
   
 end</diff>
      <filename>Rakefile</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>afe984c708866fec0df731c0a93070879907a3e7</id>
    </parent>
  </parents>
  <author>
    <name>evanweaver</name>
    <email>evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9</email>
  </author>
  <url>http://github.com/pivotal/mongrel/commit/936af1c02591f51247563513f5e595b09396473e</url>
  <id>936af1c02591f51247563513f5e595b09396473e</id>
  <committed-date>2007-10-29T14:25:19-07:00</committed-date>
  <authored-date>2007-10-29T14:25:19-07:00</authored-date>
  <message>backport rakefile so luis can package for win32


git-svn-id: svn://rubyforge.org/var/svn/mongrel/tags/rel_1-0-4@836 19e92222-5c0b-0410-8929-a290d50e31e9</message>
  <tree>2313dda56501e869f8ac62f2a2433be96f5ec27c</tree>
  <committer>
    <name>evanweaver</name>
    <email>evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9</email>
  </committer>
</commit>
