Changeset 836
- Timestamp:
- 10/29/07 16:25:19 (10 months ago)
- Files:
-
- tags/rel_1-0-4/Rakefile (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tags/rel_1-0-4/Rakefile
r828 r836 7 7 p.summary = "A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps." 8 8 p.author ="Zed A. Shaw" 9 p.clean_pattern = ['ext/http11/*.{bundle,so,o,obj,pdb,lib,def,exp}', 'ext/http11/Makefile', 'pkg', 'lib/*.bundle', '*.gem', 'site/output', '.config' ]10 p.rdoc_pattern = ['README', 'LICENSE', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc' , 'ext/http11/http11.c']9 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'] 10 p.rdoc_pattern = ['README', 'LICENSE', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc'] 11 11 p.ignore_pattern = /^(pkg|site|projects|doc|log)|CVS|\.log/ 12 12 p.ruby_version = '>= 1.8.4' … … 16 16 p.need_tgz = true 17 17 18 p.certificate_chain = ['~/p/configuration/gem_certificates/mongrel/mongrel-public_cert.pem', 18 case RUBY_PLATFORM 19 when /mswin/ 20 p.certificate_chain = ['~/gem_certificates/mongrel-public_cert.pem', 21 '~/gem_certificates/luislavena-mongrel-public_cert.pem'] 22 else 23 p.certificate_chain = ['~/p/configuration/gem_certificates/mongrel/mongrel-public_cert.pem', 19 24 '~/p/configuration/gem_certificates/evan_weaver-mongrel-public_cert.pem'] 25 end 20 26 21 27 p.eval = proc do … … 25 31 self.files += ['lib/http11.so'] 26 32 self.platform = Gem::Platform::WIN32 33 when /java/ 34 extensions.clear 35 self.files += ['lib/http11.jar'] 36 self.platform = 'jruby' 27 37 else 28 38 add_dependency('daemons', '>= 1.0.3') … … 43 53 raise "Failed to build C source" unless File.exist? target 44 54 end 55 Dir.chdir "ext/http11" do 56 target = "../../ext/http11_java/org/jruby/mongrel/Http11Parser.java" 57 File.unlink target if File.exist? target 58 sh "ragel -J http11_parser.java.rl | rlgen-java -o #{target}" 59 raise "Failed to build Java source" unless File.exist? target 60 end 61 end 62 63 #### XXX Hack around JRuby test/unit interaction problems 64 65 desc "Run each test suite in isolation on JRuby" 66 task :test_java do 67 e.test_pattern.each do |f| 68 sh "/opt/local/jruby/bin/jruby -w -Ilib:ext:bin:test -e 'require \"#{f}\"'" rescue nil 69 end 45 70 end 46 71 … … 49 74 def move_extensions 50 75 Dir["ext/**/*.#{Config::CONFIG['DLEXT']}"].each { |file| cp file, "lib/" } 76 end 77 78 def java_classpath_arg 79 # A myriad of ways to discover the JRuby classpath 80 classpath = begin 81 require 'java' 82 # Already running in a JRuby JVM 83 Java::java.lang.System.getProperty('java.class.path') 84 rescue LoadError 85 ENV['JRUBY_PARENT_CLASSPATH'] || ENV['JRUBY_HOME'] && FileList["#{ENV['JRUBY_HOME']}/lib/*.jar"].join(File::PATH_SEPARATOR) 86 end 87 classpath ? "-cp #{classpath}" : "" 51 88 end 52 89 … … 54 91 when /mswin/ 55 92 filename = "lib/http11.so" 56 file filename do 57 cp "#{filename}.win32", filename 93 file filename do 94 Dir.chdir("ext/http11") do 95 ruby "extconf.rb" 96 system(PLATFORM =~ /mswin/ ? 'nmake' : 'make') 97 end 98 move_extensions 58 99 end 59 100 task :compile => [filename] 101 102 when /java/ 103 filename = "lib/http11.jar" 104 file filename do 105 build_dir = "ext/http11_java/classes" 106 mkdir_p build_dir 107 sources = FileList['ext/http11_java/**/*.java'].join(' ') 108 sh "javac -target 1.4 -source 1.4 -d #{build_dir} #{java_classpath_arg} #{sources}" 109 sh "jar cf lib/http11.jar -C #{build_dir} ." 110 move_extensions 111 end 112 task :compile => [filename] 113 60 114 end 61 115 … … 80 134 sub_project("mongrel_cluster", :package) 81 135 sub_project("mongrel_service", :package) if RUBY_PLATFORM =~ /mswin/ 136 sh("rake java package") unless RUBY_PLATFORM =~ /java/ 137 # sh("rake mswin package") unless RUBY_PLATFORM =~ /mswin/ 82 138 end 83 139 … … 137 193 138 194 # XXX Hack, because only Luis can package for Win32 right now 139 sh "cp ~/Downloads/mongrel-#{e.version}-mswin32.gem pkg/gems/"140 sh "cp ~/Downloads/mongrel_service-0.3.3-mswin32.gem pkg/gems/"195 # sh "cp ~/Downloads/mongrel-#{e.version}-mswin32.gem pkg/gems/" 196 # sh "cp ~/Downloads/mongrel_service-0.3.3-mswin32.gem pkg/gems/" 141 197 sh "rm -rf pkg/mongrel*" 142 198 sh "gem generate_index -d pkg" … … 150 206 task :web do 151 207 # Requires the 'webgem' gem and the 'atom-tools' gem 152 sh "cd site; webgen; ruby atom.rb > output/feed.atom; rsync -azv --no-perms --no-times output/* rubyforge.org:/var/www/gforge-projects/mongrel/"208 sh "cd site; webgen; webgen; ruby atom.rb > output/feed.atom; rsync -azv --no-perms --no-times output/* rubyforge.org:/var/www/gforge-projects/mongrel/" 153 209 end 154 210 155 211 desc "Upload the rdocs" 156 task :rdoc => [: redoc] do157 sh "rsync -azv doc/* rubyforge.org:/var/www/gforge-projects/mongrel/rdoc/"158 sh "cd projects/gem_plugin; rake site "212 task :rdoc => [:doc] do 213 sh "rsync -azv --no-perms --no-times doc/* rubyforge.org:/var/www/gforge-projects/mongrel/rdoc/" 214 sh "cd projects/gem_plugin; rake site:rdoc" 159 215 end 160 216 161 217 desc "Upload the coverage report" 162 218 task :coverage => [:rcov] do 163 sh "rsync -azv test/coverage/* rubyforge.org:/var/www/gforge-projects/mongrel/coverage/"219 sh "rsync -azv --no-perms --no-times test/coverage/* rubyforge.org:/var/www/gforge-projects/mongrel/coverage/" rescue nil 164 220 end 165 221 166 222 desc "Upload the website, the rdocs, and the coverage report" 167 task :all => [: web, :rdoc, :coverage]168 169 end 223 task :all => [:clean, :web, :rdoc, :coverage] 224 225 end
