From e2b48e0840d0225e3a3555d698cc7b1eaebe0268 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Fri, 17 Jan 2025 01:16:35 -0800 Subject: [PATCH] Remove package dependency on System.Commandline (#15424) Co-authored-by: Viktor Hofer --- .../Microsoft.DotNet.MacOsPkg.csproj | 2 +- src/Microsoft.DotNet.MacOsPkg/Program.cs | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.DotNet.MacOsPkg/Microsoft.DotNet.MacOsPkg.csproj b/src/Microsoft.DotNet.MacOsPkg/Microsoft.DotNet.MacOsPkg.csproj index 831297d7606..09e39b08370 100644 --- a/src/Microsoft.DotNet.MacOsPkg/Microsoft.DotNet.MacOsPkg.csproj +++ b/src/Microsoft.DotNet.MacOsPkg/Microsoft.DotNet.MacOsPkg.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/Microsoft.DotNet.MacOsPkg/Program.cs b/src/Microsoft.DotNet.MacOsPkg/Program.cs index 80adca4b96f..90f13e41abb 100644 --- a/src/Microsoft.DotNet.MacOsPkg/Program.cs +++ b/src/Microsoft.DotNet.MacOsPkg/Program.cs @@ -2,10 +2,19 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; + +#if !NET + +// This code is unreachable. Here to keep the compiler happy. +throw new PlatformNotSupportedException("This tool is only supported on .NET Core."); + +#else + +using System.Runtime.InteropServices; using System.CommandLine; using System.IO; -using System.Runtime.InteropServices; -using Microsoft.DotNet.MacOsPkg; + +namespace Microsoft.DotNet.MacOsPkg; public class Program { @@ -162,3 +171,4 @@ private static int UnpackCommand(ParseResult result, CliArgument unpackS return 0; } } +#endif