Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
seleniumhq
GitHub Repository: seleniumhq/selenium
Path: blob/trunk/third_party/jruby/update.rb
2867 views
1
require 'fileutils'
2
require "open-uri"
3
require "rake"
4
5
version = "9.4.12.0"
6
gems = {
7
"inifile" => "3.0.0",
8
"net-telnet" => "0.2.0",
9
"git" => "1.18.0",
10
}
11
12
jar_name = ARGV.first
13
url = "https://repo1.maven.org/maven2/org/jruby/jruby-complete/#{version}/jruby-complete-#{version}.jar"
14
15
puts "Downloading #{jar_name} from #{url}..."
16
File.open(jar_name, "wb") do |write_file|
17
URI.open(url, "rb") do |read_file|
18
write_file.write(read_file.read)
19
end
20
end
21
22
puts "Installing gems..."
23
gems.each do |gem_name, gem_version|
24
sh "java", "-jar", jar_name, "-S", "gem", "install", "-i", "./#{gem_name}", gem_name, "-v", gem_version
25
sh "jar", "uf", jar_name, "-C", gem_name, "."
26
FileUtils.rm_rf gem_name
27
end
28
29
puts "Bumping VERSION..."
30
jruby_version = `java -jar #{jar_name} -version`.split("\n").first
31
File.write("VERSION", "#{jruby_version}\n")
32
33
destination = File.realpath("third_party/jruby")
34
FileUtils.rm_f("#{destination}/jruby-complete.jar") if File.exist?("#{destination}/jruby-complete.jar")
35
FileUtils.cp(jar_name, "#{destination}/jruby-complete.jar")
36
FileUtils.cp("VERSION", "#{destination}/VERSION")
37
38
puts `ls -l third_party/jruby/`
39
40
puts "Done!"
41
42