diff --git a/UnoCheck/Checkups/VisualStudioMacCheckup.cs b/UnoCheck/Checkups/VisualStudioMacCheckup.cs deleted file mode 100644 index 255f27c2..00000000 --- a/UnoCheck/Checkups/VisualStudioMacCheckup.cs +++ /dev/null @@ -1,122 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Claunia.PropertyList; -using DotNetCheck.Models; -using NuGet.Versioning; - -namespace DotNetCheck.Checkups -{ - public class VisualStudioMacCheckup : Checkup - { - public override bool IsPlatformSupported(Platform platform) - => platform == Platform.OSX; - - public NuGetVersion MinimumVersion - => Extensions.ParseVersion(Manifest?.Check?.VSMac?.MinimumVersion, new NuGetVersion("8.9.0")); - - public NuGetVersion ExactVersion - => Extensions.ParseVersion(Manifest?.Check?.VSMac?.ExactVersion); - - public bool Optional - => Manifest?.Check?.VSMac?.Optional ?? false; - - public override string Id => "vsmac"; - - public override string Title => $"Visual Studio {MinimumVersion.ThisOrExact(ExactVersion)}"; - - public override bool ShouldExamine(SharedState history) - => Manifest?.Check?.VSMac != null; - - public override async Task Examine(SharedState history) - { - var vsinfo = await GetMacInfo(); - - var ok = false; - - foreach (var vs in vsinfo) - { - if (vs.Version.IsCompatible(MinimumVersion, ExactVersion)) - { - ok = true; - ReportStatus($"Visual Studio for Mac ({vs.Version})", Status.Ok); - } - else - { - ReportStatus($"Visual Studio for Mac ({vs.Version})", null); - } - } - - - // Check VSCode sentinel files, ie: - // ~/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.15/omnisharp/.msbuild/Current/Bin - - var vscodeExtPath = Path.Combine( - Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), - ".vscode", - "extensions"); - - var sentinelFiles = new List(); - var vscodeExtDir = new DirectoryInfo(vscodeExtPath); - - if (vscodeExtDir.Exists) - { - var sdkResolverDirs = Directory.EnumerateDirectories(vscodeExtPath, "*Microsoft.DotNet.MSBuildSdkResolver", SearchOption.AllDirectories); - - if (sdkResolverDirs?.Any() ?? false) - { - foreach (var r in sdkResolverDirs) - { - if (!Directory.Exists(r)) - continue; - - var sentinelFile = Path.Combine(r, "EnableWorkloadResolver.sentinel"); - - sentinelFiles.Add(sentinelFile); - } - } - } - - if (sentinelFiles.Any()) - history.ContributeState(this, "sentinel_files", sentinelFiles.ToArray()); - - if (ok || Optional) - return DiagnosticResult.Ok(this); - - return new DiagnosticResult(Status.Error, this); - } - - Task> GetMacInfo() - { - var items = new List(); - - var likelyPaths = new List { - "/Applications/Visual Studio.app/" - }; - - - foreach (var likelyPath in likelyPaths) - { - var path = Path.Combine(likelyPath, "Contents", "Info.plist"); - - if (File.Exists(path)) - { - var plist = (NSDictionary)Claunia.PropertyList.PropertyListParser.Parse(path); - - var bvs = plist["CFBundleVersion"].ToString(); - - if (!string.IsNullOrEmpty(bvs) && NuGetVersion.TryParse(bvs, out var ver)) - items.Add(new VisualStudioInfo - { - Path = likelyPath, - Version = ver - }); - } - } - - return Task.FromResult>(items); - } - } -} diff --git a/UnoCheck/Manifest/Check.cs b/UnoCheck/Manifest/Check.cs index 447f0fba..4b7f1a92 100644 --- a/UnoCheck/Manifest/Check.cs +++ b/UnoCheck/Manifest/Check.cs @@ -28,9 +28,6 @@ public partial class Check [JsonProperty("vswin")] public MinExactVersion VSWin { get; set; } - [JsonProperty("vsmac")] - public MinExactVersion VSMac { get; set; } - [JsonProperty("android")] public Android Android { get; set; } diff --git a/UnoCheck/Program.cs b/UnoCheck/Program.cs index c56042f6..581762f0 100644 --- a/UnoCheck/Program.cs +++ b/UnoCheck/Program.cs @@ -23,7 +23,6 @@ static Task Main(string[] args) CheckupManager.RegisterCheckups( new OpenJdkCheckup(), new AndroidEmulatorCheckup(), - new VisualStudioMacCheckup(), new VisualStudioWindowsCheckup(), new VSWinWorkloadsCheckup(), new AndroidSdkPackagesCheckup(), diff --git a/manifests/uno.ui-preview-major.manifest.json b/manifests/uno.ui-preview-major.manifest.json index 13b54e72..cbaef8d2 100644 --- a/manifests/uno.ui-preview-major.manifest.json +++ b/manifests/uno.ui-preview-major.manifest.json @@ -28,10 +28,6 @@ "vswin": { "minimumVersion": "17.8.0-pre.1" }, - "vsmac": { - "minimumVersion": "8.10.0", - "optional": "true" - }, "android": { "packages": [ { diff --git a/manifests/uno.ui-preview.manifest.json b/manifests/uno.ui-preview.manifest.json index 13b54e72..cbaef8d2 100644 --- a/manifests/uno.ui-preview.manifest.json +++ b/manifests/uno.ui-preview.manifest.json @@ -28,10 +28,6 @@ "vswin": { "minimumVersion": "17.8.0-pre.1" }, - "vsmac": { - "minimumVersion": "8.10.0", - "optional": "true" - }, "android": { "packages": [ { diff --git a/manifests/uno.ui.manifest.json b/manifests/uno.ui.manifest.json index cb86f913..3d5db203 100644 --- a/manifests/uno.ui.manifest.json +++ b/manifests/uno.ui.manifest.json @@ -30,10 +30,6 @@ "vswin": { "minimumVersion": "17.8.0" }, - "vsmac": { - "minimumVersion": "8.10.0", - "optional": "true" - }, "android": { "packages": [ {