Skip to content

Commit

Permalink
Remove package dependency on System.Commandline (#15424)
Browse files Browse the repository at this point in the history
Co-authored-by: Viktor Hofer <[email protected]>
  • Loading branch information
mmitche and ViktorHofer authored Jan 17, 2025
1 parent ad4d632 commit e2b48e0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.CommandLine" />
<PackageReference Include="System.CommandLine" Condition="'$(TargetFramework)' == '$(NetToolCurrent)'"/>
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)' == '$(NetToolCurrent)'">
Expand Down
14 changes: 12 additions & 2 deletions src/Microsoft.DotNet.MacOsPkg/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -162,3 +171,4 @@ private static int UnpackCommand(ParseResult result, CliArgument<string> unpackS
return 0;
}
}
#endif

0 comments on commit e2b48e0

Please sign in to comment.