Skip to content

Commit 619bc64

Browse files
committed
[build] fix JRuby install
1 parent c7f65f8 commit 619bc64

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

third_party/jruby/update.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require 'fileutils'
12
require "open-uri"
23
require "rake"
34

@@ -12,7 +13,7 @@
1213

1314
puts "Downloading #{jar_name} from #{url}..."
1415
File.open(jar_name, "wb") do |write_file|
15-
open(url, "rb") do |read_file|
16+
URI.open(url, "rb") do |read_file|
1617
write_file.write(read_file.read)
1718
end
1819
end
@@ -21,15 +22,17 @@
2122
gems.each do |gem_name, gem_version|
2223
sh "java", "-jar", jar_name, "-S", "gem", "install", "-i", "./#{gem_name}", gem_name, "-v", gem_version
2324
sh "jar", "uf", jar_name, "-C", gem_name, "."
24-
rm_rf gem_name
25+
FileUtils.rm_rf gem_name
2526
end
2627

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

31-
cp jar_name, File.realpath("third_party/jruby/jruby-complete.jar")
32-
cp "VERSION", File.realpath("third_party/jruby/VERSION")
32+
destination = File.realpath("third_party/jruby/")
33+
FileUtils.rm_f("#{destination}jruby-complete.jar") if File.exist?("#{destination}jruby-complete.jar")
34+
FileUtils.cp(jar_name, "#{destination}jruby-complete.jar")
35+
FileUtils.cp("VERSION", "#{destination}VERSION")
3336

3437
puts `ls -l third_party/jruby/`
3538

0 commit comments

Comments
 (0)