- Packaging as a jar seems to be working now.

This commit is contained in:
Jordan Sissel 2011-03-23 16:31:37 -07:00
parent c9ff4f5a39
commit 69527591e0

View file

@ -18,23 +18,22 @@ task :compile => "lib/logstash/config/grammar.rb" do |t|
# #
# org/jruby/util/JavaNameMangler.java:105:in `mangleFilenameForClasspath' # org/jruby/util/JavaNameMangler.java:105:in `mangleFilenameForClasspath'
# org/jruby/util/JavaNameMangler.java:32:in `mangleFilenameForClasspath' # org/jruby/util/JavaNameMangler.java:32:in `mangleFilenameForClasspath'
require 'jruby/jrubyc' #require 'jruby/jrubyc'
#args = [ "-p", "net.logstash" ] ##args = [ "-p", "net.logstash" ]
args = ["-d", "build"] #args = ["-d", "build"]
args += Dir.glob("**/*.rb") #args += Dir.glob("**/*.rb")
status = JRuby::Compiler::compile_argv(args) #status = JRuby::Compiler::compile_argv(args)
if (status != 0) #if (status != 0)
puts "Compilation FAILED: #{status} error(s) encountered" #puts "Compilation FAILED: #{status} error(s) encountered"
exit status #exit status
end
#mkdir_p "build"
#sh "rm -rf lib/net"
#Dir.chdir("lib") do
#args = Dir.glob("**/*.rb")
##sh "jrubyc", "-d", "../build" *args
#sh "jrubyc", *args
#end #end
mkdir_p "build"
sh "rm -rf lib/net"
Dir.chdir("lib") do
args = Dir.glob("**/*.rb")
sh "jrubyc", "-t", "../build", *args
end
end end
VERSIONS = { VERSIONS = {
@ -45,7 +44,7 @@ VERSIONS = {
namespace :vendor do namespace :vendor do
file "vendor/jar" do |t| file "vendor/jar" do |t|
mkdir_p mkdir(t.name) mkdir_p t.name
end end
# Download jruby.jar # Download jruby.jar
@ -119,10 +118,9 @@ namespace :package do
end end
end end
# We compile stuff to lib/net/logstash/... # We compile stuff to build/...
Dir.glob("lib/**/*.class").each do |file| Dir.glob("build/**/*.class").each do |file|
target = File.join("build-jar", file.gsub("lib/", "")) target = File.join("build-jar", file.gsub("build/", ""))
#target = File.join("build-jar", file)
mkdir_p File.dirname(target) mkdir_p File.dirname(target)
puts "=> Copying #{file} => #{target}" puts "=> Copying #{file} => #{target}"
File.copy(file, target) File.copy(file, target)