-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
37 lines (27 loc) · 1.06 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require "bundler/gem_tasks"
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = ["-Ijar", "-Ilib", "-c", "-f progress"] # '--format specdoc'
t.pattern = 'spec/**/*_spec.rb'
end
task :compile do
require 'rubygems'
jarname = FileList['norikra-udf-*.gemspec'].first.gsub(/\.gemspec$/, '.jar')
jarfiles = FileList['jar/**/*.jar'].select{|f| not f.end_with?('/' + jarname)}
jarfiles << Gem.find_latest_files('esper-*.jar').first
java_classpath = "-classpath src:java:#{jarfiles.join(':')}"
FileList['src/**/*.java'].each do |fn|
sh "env LC_ALL=C javac -J-Duser.language=en #{java_classpath} -d java #{fn}"
end
jruby_classpath = "--classpath java:#{jarfiles.join(':')}"
FileList['lib/esper_plugin/**/*.rb'].each do |fn|
sh "env LC_ALL=C jrubyc --javac --target java #{jruby_classpath} #{fn}"
end
sh "env LC_ALL=C jar -J-Duser.language=en -cf jar/#{jarname} -C java ."
end
task :clean do
sh "rm -rf java/*"
end
task :test => [:compile, :spec]
task :default => :test
task :all => [:clean, :compile, :spec, :build]