cask "temurin@17" do arch arm: "aarch64", intel: "x64" version "17.0.13,11" sha256 arm: "b7fed1a41a14ab48fed8610f3ac5fafc14ff1d351869def400ca4daea4fe66eb", intel: "567f356729f81e97ddbdf39ce43a6410460a4af7b2da7929ea01954addcb6da2" 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/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+)*)$/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