Sha256: 1192ed01f4b3027853b77a3fc682d8b43f22a2060fd75a1e7083a31a60fde912
Contents?: true
Size: 1004 Bytes
Versions: 14
Compression:
Stored size: 1004 Bytes
Contents
def java_classpath_arg # myriad of ways to discover JRuby classpath begin cpath = Java::java.lang.System.getProperty('java.class.path').split(File::PATH_SEPARATOR) cpath += Java::java.lang.System.getProperty('sun.boot.class.path').split(File::PATH_SEPARATOR) jruby_cpath = cpath.compact.join(File::PATH_SEPARATOR) rescue => e end unless jruby_cpath jruby_cpath = ENV['JRUBY_PARENT_CLASSPATH'] || ENV['JRUBY_HOME'] && FileList["#{ENV['JRUBY_HOME']}/lib/*.jar"].join(File::PATH_SEPARATOR) end jruby_cpath ? "-cp \"#{jruby_cpath}\"" : "" end jar_name = File.join(*%w(lib arjdbc jdbc adapter_java.jar)) desc "Compile the native Java code." task :java_compile do debug = ENV['DEBUG'] ? '-g' : '' pkg_classes = File.join(*%w(pkg classes)) mkdir_p pkg_classes sh "javac -target 1.5 -source 1.5 #{debug} -d pkg/classes #{java_classpath_arg} #{FileList['src/java/**/*.java'].join(' ')}" sh "jar cf #{jar_name} -C #{pkg_classes} ." end file jar_name => :java_compile
Version data entries
14 entries across 14 versions & 4 rubygems