forked from Homebrew/homebrew-cask
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdotnet-sdk.rb
45 lines (39 loc) · 1.55 KB
/
dotnet-sdk.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
cask "dotnet-sdk" do
version "5.0.203,0ec08464-4049-4184-b52d-ab8c90dc0199:5ebc7047c4461257c746dcf471097ea2"
sha256 "eb78e5a5ce1a32fb08462bf720941ea1688c9e9b0081828b93ced3323be9883c"
url "https://download.visualstudio.microsoft.com/download/pr/#{version.after_comma.before_colon}/#{version.after_colon}/dotnet-sdk-#{version.before_comma}-osx-x64.pkg"
name ".NET SDK"
desc "Developer platform"
homepage "https://www.microsoft.com/net/core#macos"
# This identifies releases with the same major/minor version as the current
# cask version. New major/minor releases occur annually in November and the
# check will automatically update its behavior when the cask is updated.
livecheck do
url "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/#{version.major_minor}/releases.json"
strategy :page_match do |page|
page.scan(%r{/download/pr/([^/]+)/([^/]+)/dotnet-sdk-v?(\d+(?:\.\d+)+)-osx-x64\.pkg}i).map do |match|
"#{match[2]},#{match[0]}:#{match[1]}"
end
end
end
conflicts_with cask: [
"dotnet",
"homebrew/cask-versions/dotnet-preview",
"homebrew/cask-versions/dotnet-sdk-preview",
]
depends_on macos: ">= :high_sierra"
pkg "dotnet-sdk-#{version.before_comma}-osx-x64.pkg"
binary "/usr/local/share/dotnet/dotnet"
uninstall pkgutil: [
"com.microsoft.dotnet.*",
"com.microsoft.netstandard.pack.targeting.*",
],
delete: [
"/etc/paths.d/dotnet",
"/etc/paths.d/dotnet-cli-tools",
]
zap trash: [
"~/.dotnet",
"~/.nuget",
]
end