Skip to content

Commit

Permalink
[build] fix JRuby install
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Dec 23, 2023
1 parent c7f65f8 commit 619bc64
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions third_party/jruby/update.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'fileutils'
require "open-uri"
require "rake"

Expand All @@ -12,7 +13,7 @@

puts "Downloading #{jar_name} from #{url}..."
File.open(jar_name, "wb") do |write_file|
open(url, "rb") do |read_file|
URI.open(url, "rb") do |read_file|
write_file.write(read_file.read)
end
end
Expand All @@ -21,15 +22,17 @@
gems.each do |gem_name, gem_version|
sh "java", "-jar", jar_name, "-S", "gem", "install", "-i", "./#{gem_name}", gem_name, "-v", gem_version
sh "jar", "uf", jar_name, "-C", gem_name, "."
rm_rf gem_name
FileUtils.rm_rf gem_name
end

puts "Bumping VERSION..."
jruby_version = `java -jar #{jar_name} -version`.split("\n").first
File.write("VERSION", "#{jruby_version}\n")

cp jar_name, File.realpath("third_party/jruby/jruby-complete.jar")
cp "VERSION", File.realpath("third_party/jruby/VERSION")
destination = File.realpath("third_party/jruby/")
FileUtils.rm_f("#{destination}jruby-complete.jar") if File.exist?("#{destination}jruby-complete.jar")
FileUtils.cp(jar_name, "#{destination}jruby-complete.jar")
FileUtils.cp("VERSION", "#{destination}VERSION")

puts `ls -l third_party/jruby/`

Expand Down

0 comments on commit 619bc64

Please sign in to comment.