-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
/
temurin.rb
31 lines (24 loc) · 1.32 KB
/
temurin.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
31
cask "temurin" do
arch arm: "aarch64", intel: "x64"
version "23,37"
sha256 arm: "44e2e161c8c0c6bd61ae8fc16ab5478616050135a5c5b78ee05ff17bcfdb27c3",
intel: "7e8c5710f08224d37d06bd383d4a3936b4abdccff0a06bc4aebc0f49702c698c"
url "https://github.com/adoptium/temurin#{version.major}-binaries/releases/download/jdk-#{version.csv.first}%2B#{version.csv.second}/OpenJDK#{version.major}U-jdk_#{arch}_mac_hotspot_#{version.csv.first}_#{version.csv.second.major}.pkg",
verified: "github.com/adoptium/"
name "Eclipse Temurin Java Development Kit"
desc "JDK from the Eclipse Foundation (Adoptium)"
homepage "https://adoptium.net/"
livecheck do
url "https://api.adoptium.net/v3/info/release_versions?release_type=ga&architecture=#{arch}&image_type=jdk&jvm_impl=hotspot&os=mac&page=0&page_size=1&project=jdk&sort_method=DEFAULT&sort_order=DESC&vendor=eclipse"
strategy :json do |json|
json["versions"].filter_map do |version|
match = version["openjdk_version"].match(/^(\d+(?:\.\d+)*)\+(\d+(?:\.\d+)*)(?:-LTS)?$/i)
next if match.blank?
"#{match[1]},#{match[2]}"
end
end
end
pkg "OpenJDK#{version.major}U-jdk_#{arch}_mac_hotspot_#{version.csv.first}_#{version.csv.second.major}.pkg"
uninstall pkgutil: "net.temurin.#{version.major}.jdk"
# No zap stanza required
end