-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Expand file tree
/
Copy pathupdate.rb
More file actions
40 lines (32 loc) · 1.13 KB
/
update.rb
File metadata and controls
40 lines (32 loc) · 1.13 KB
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
38
39
40
require 'fileutils'
require "open-uri"
require "rake"
version = "9.4.12.0"
gems = {
"inifile" => "3.0.0",
"net-telnet" => "0.2.0",
"git" => "1.18.0",
}
jar_name = ARGV.first
url = "https://repo1.maven.org/maven2/org/jruby/jruby-complete/#{version}/jruby-complete-#{version}.jar"
puts "Downloading #{jar_name} from #{url}..."
File.open(jar_name, "wb") do |write_file|
URI.open(url, "rb") do |read_file|
write_file.write(read_file.read)
end
end
puts "Installing gems..."
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, "."
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")
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/`
puts "Done!"