mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Getting compile and build of jruby jar working
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@668 19e92222-5c0b-0410-8929-a290d50e31e9
This commit is contained in:
parent
26d35952d2
commit
0c1c2b072b
1 changed files with 21 additions and 4 deletions
25
Rakefile
25
Rakefile
|
@ -20,6 +20,8 @@ Echoe.new("mongrel") do |p|
|
|||
when /mswin/
|
||||
p.certificate_chain = ['~/gem_certificates/mongrel-public_cert.pem',
|
||||
'~/gem_certificates/luislavena-mongrel-public_cert.pem']
|
||||
when /java/
|
||||
p.clean_pattern += ["lib/http11.jar"]
|
||||
else
|
||||
p.certificate_chain = ['~/p/configuration/gem_certificates/mongrel/mongrel-public_cert.pem',
|
||||
'~/p/configuration/gem_certificates/evan_weaver-mongrel-public_cert.pem']
|
||||
|
@ -31,10 +33,10 @@ Echoe.new("mongrel") do |p|
|
|||
extensions.clear
|
||||
self.files += ['lib/http11.so']
|
||||
self.platform = Gem::Platform::WIN32
|
||||
when /jruby/
|
||||
when /java/
|
||||
extensions.clear
|
||||
self.files += ['lib/http11.jar']
|
||||
self.platform = 'jruby'
|
||||
self.platform = 'jruby'
|
||||
else
|
||||
add_dependency('daemons', '>= 1.0.3')
|
||||
add_dependency('fastthread', '>= 1.0.1')
|
||||
|
@ -61,13 +63,28 @@ when /mswin/
|
|||
end
|
||||
task :compile => [filename]
|
||||
|
||||
when /jruby/
|
||||
when /java/
|
||||
filename = "lib/http11.jar"
|
||||
def java_classpath_arg # myriad of ways to discover JRuby classpath
|
||||
begin
|
||||
require 'java' # already running in a JRuby JVM
|
||||
jruby_cpath = Java::java.lang.System.getProperty('java.class.path')
|
||||
rescue LoadError
|
||||
end
|
||||
unless jruby_cpath
|
||||
jruby_cpath = ENV['JRUBY_PARENT_CLASSPATH'] || ENV['JRUBY_HOME'] &&
|
||||
FileList["#{ENV['JRUBY_HOME']}/lib/*.jar"].join(File::PATH_SEPARATOR)
|
||||
end
|
||||
cpath_arg = jruby_cpath ? "-cp #{jruby_cpath}" : ""
|
||||
end
|
||||
file filename do
|
||||
Dir.chdir("ext/http11_java") { sh "ant jar" }
|
||||
mkdir_p "pkg/classes"
|
||||
sh "javac -target 1.4 -source 1.4 -d pkg/classes #{java_classpath_arg} #{FileList['ext/http11_java//**/*.java'].join(' ')}"
|
||||
sh "jar cf lib/http11.jar -C pkg/classes/ ."
|
||||
move_extensions
|
||||
end
|
||||
task :compile => [filename]
|
||||
|
||||
end
|
||||
|
||||
#### Project-wide install and uninstall tasks
|
||||
|
|
Loading…
Reference in a new issue