forked from Homebrew/homebrew-cask
-
Notifications
You must be signed in to change notification settings - Fork 0
/
adoptopenjdk.rb
30 lines (24 loc) · 1.06 KB
/
adoptopenjdk.rb
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
cask "adoptopenjdk" do
version "15.0.2,7"
sha256 "f3b867c04a12eec2526492f91a228fade480b1c592ea336eeb9fd66bef86e4c4"
url "https://github.com/AdoptOpenJDK/openjdk#{version.major}-binaries/releases/download/jdk-#{version.before_comma}%2B#{version.after_comma}/OpenJDK#{version.major}U-jdk_x64_mac_hotspot_#{version.before_comma}_#{version.after_comma.major}.pkg",
verified: "github.com/AdoptOpenJDK/"
name "AdoptOpenJDK Java Development Kit"
homepage "https://adoptopenjdk.net/"
livecheck do
url :url
strategy :git do |tags|
tags.map do |tag|
match = tag.match(/^jdk-(\d+(?:\.\d+)*)\+(\d+(?:\.\d+)*)$/i)
"#{match[1]},#{match[2]}" if match
end.compact
end
end
pkg "OpenJDK#{version.major}U-jdk_x64_mac_hotspot_#{version.before_comma}_#{version.after_comma.major}.pkg"
uninstall pkgutil: "net.adoptopenjdk.#{version.major}.jdk"
caveats <<~EOS
More versions are available in the AdoptOpenJDK tap:
#{Formatter.url("https://github.com/AdoptOpenJDK/homebrew-openjdk")}
brew tap adoptopenjdk/openjdk
EOS
end