Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

72 lines (60 sloc) 2.602 kB
require 'rake'
require 'rake/testtask'
MANIFEST = FileList["History.txt", "README.txt", "License.txt", "lib/jopenssl.jar", "lib/**/*", "test/**/*"]
BC_JARS = FileList["lib/bc*.jar"]
task :default => [:java_compile, :test]
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
bc_jars = BC_JARS.join(File::PATH_SEPARATOR)
jruby_cpath ? "-cp #{jruby_cpath}#{File::PATH_SEPARATOR}#{bc_jars}" : "-cp #{bc_jars}"
end
desc "Compile the native Java code."
task :java_compile do
mkdir_p "pkg/classes"
File.open("pkg/compile_options", "w") do |f|
f << "-target 1.5 -source 1.5 -Xlint:unchecked -Xlint:deprecation -d pkg/classes"
end
File.open("pkg/compile_classpath", "w") do |f|
f << java_classpath_arg
end
File.open("pkg/compile_sourcefiles", "w") do |f|
f << FileList['src/java/**/*.java'].join(' ')
end
sh "javac @pkg/compile_options @pkg/compile_classpath @pkg/compile_sourcefiles"
File.open("pkg/classes/manifest.mf", "w") {|f| f.puts "Class-Path: #{BC_JARS.map{|f| File.basename(f) }.join(' ')}"}
sh "jar cfm lib/jopenssl.jar pkg/classes/manifest.mf -C pkg/classes/ ."
end
file "lib/jopenssl.jar" => :java_compile
task :more_clean do
rm_f FileList['lib/jopenssl.jar']
end
task :clean => :more_clean
File.open("Manifest.txt", "w") {|f| MANIFEST.each {|n| f.puts n } }
require File.dirname(__FILE__) + "/lib/jopenssl/version"
begin
require 'hoe'
Hoe.new("jruby-openssl", Jopenssl::Version::VERSION) do |p|
p.rubyforge_name = "jruby-extras"
p.url = "http://jruby-extras.rubyforge.org/jruby-openssl"
p.author = "Ola Bini and JRuby contributors"
p.email = "ola.bini@gmail.com"
p.summary = "OpenSSL add-on for JRuby"
p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
p.rdoc_pattern = /^(lib\/.*rb)|txt$/
p.description = p.paragraphs_of('README.txt', 0...1).join("\n\n")
p.test_globs = ENV["TEST"] || ["test/test_*.rb"]
end.spec.dependencies.delete_if { |dep| dep.name == "hoe" }
rescue LoadError
puts "You really need Hoe installed to be able to package this gem"
rescue => e
puts "ignoring error while loading hoe: #{e.to_s}"
end
Jump to Line
Something went wrong with that request. Please try again.