forked from Homebrew/homebrew-cask
-
Notifications
You must be signed in to change notification settings - Fork 0
/
adoptopenjdk.rb
24 lines (20 loc) · 939 Bytes
/
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
cask "adoptopenjdk" do
version "16.0.1,9"
sha256 "7308a15d054d07d504f616416b3622d153c3cc63906441a5730ca1f9d4a43854"
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"
desc "JDK from the Java User Group (JUG)"
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"
end