Skip to content

Commit

Permalink
Merge pull request #172375 from Homebrew/temurin@21
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanazamfirei authored Apr 28, 2024
2 parents 9abaaa5 + 9ad0898 commit 461652a
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Casks/t/temurin@21.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
cask "temurin@21" do
arch arm: "aarch64", intel: "x64"

version "21.0.3,9"
sha256 arm: "f0a8cfcc9612caba26f6362ec63c5c67936d9b0a1be973a6e3b629fee9507214",
intel: "91f0ce47ac9189901d4dd5c6e9fb59d4aeaa365ab72c8cedbe6b5d4e9f1d6f49"

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 21"
desc "JDK from the Eclipse Foundation (Adoptium)"
homepage "https://adoptium.net/"

livecheck do
url "https://api.adoptium.net/v3/assets/feature_releases/#{version.major}/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"
regex(/^jdk-(\d+(?:\.\d+)*?)\+(\d+(?:\.\d+)*)(?:-LTS)?$/i)
strategy :json do |json, regex|
json.map do |release|
match = release["release_name"]&.match(regex)
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

0 comments on commit 461652a

Please sign in to comment.