phinze/homebrew-cask

View on GitHub
Casks/e/eclipse-platform.rb

Summary

Maintainability
A
0 mins
Test Coverage
cask "eclipse-platform" do
  arch arm: "aarch64", intel: "x86_64"

  version "4.32,202406010610"
  sha256 arm:   "d90e082f7c869fa7be50d78d733cbb93db0879a3c5dce2b0eb075ceff1ac231f",
         intel: "4f6bc73ee45a12bca626d9d7dc085735e8369bb43e74a5b9aca5e7074ee2802e"

  url "https://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops#{version.major}/R-#{version.csv.first}-#{version.csv.second}/eclipse-SDK-#{version.csv.first}-macosx-cocoa-#{arch}.dmg&r=1"
  name "Eclipse SDK"
  desc "SDK for the Eclipse IDE"
  homepage "https://eclipse.org/"

  livecheck do
    url "https://download.eclipse.org/eclipse/downloads/"
    regex(%r{href=.*/R-(\d+(?:\.\d+)*)-(\d+)/}i)
    strategy :page_match do |page, regex|
      page.scan(regex).map { |match| "#{match[0]},#{match[1]}" }
    end
  end

  # Renamed to avoid conflict with other Eclipse.
  app "Eclipse.app", target: "Eclipse Platform.app"

  zap trash: [
    "~/.eclipse",
    "~/eclipse-workspace",
    "~/Library/Preferences/org.eclipse.sdk.ide.plist",
  ]
end