Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,37 +1,33 @@
<Project>

Comment thread
zbalkan marked this conversation as resolved.
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
<!-- Using multiple feeds isn't supported by Maestro: https://github.com/dotnet/arcade/issues/14155. -->
<NoWarn>$(NoWarn);NU1507</NoWarn>
</PropertyGroup>

<ItemGroup>
<!-- Roslyn dependencies -->
<PackageVersion Include="Microsoft.CodeAnalysis" Version="4.0.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.0.1" />
<!-- Runtime dependencies -->
<PackageVersion Include="Microsoft.Extensions.Configuration.CommandLine" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.CommandLine" Version="9.0.5" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.5" />
Comment thread
zbalkan marked this conversation as resolved.
Outdated
<!-- external dependencies -->
<PackageVersion Include="ApprovalTests" Version="7.0.0-beta.3" />
<PackageVersion Include="BenchmarkDotNet" Version="0.13.1" />
<PackageVersion Include="AwesomeAssertions" Version="8.0.2" />
<PackageVersion Include="AwesomeAssertions" Version="8.1.0" />
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.DotNet.PlatformAbstractions" Version="3.1.6" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.2" />
<PackageVersion Include="System.Memory" Version="4.5.4" />
<PackageVersion Include="system.reactive.core" Version="5.0.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="System.Memory" Version="4.6.3" />
<PackageVersion Include="system.reactive.core" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(DisableArcade)' == '1'">
<!-- The xunit version should be kept in sync with the one that Arcade promotes -->
<PackageVersion Include="xunit" Version="2.4.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.3" />
</ItemGroup>

</Project>
</Project>
8 changes: 4 additions & 4 deletions src/System.CommandLine.Tests/CompletionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -784,12 +784,12 @@ public void When_parsing_from_text_if_the_proximate_option_is_completed_then_com
{
var command = new RootCommand
{
CreateOptionWithAcceptOnlyFromAmong(name: "--framework", "net7.0"),
CreateOptionWithAcceptOnlyFromAmong(name: "--framework", "net8.0"),
CreateOptionWithAcceptOnlyFromAmong(name: "--language", "C#"),
new Option<string>("--langVersion")
};
var configuration = new CommandLineConfiguration(command);
var completions = command.Parse("--framework net7.0 --l", configuration).GetCompletions();
var completions = command.Parse("--framework net8.0 --l", configuration).GetCompletions();

completions.Select(item => item.Label)
.Should()
Expand All @@ -801,12 +801,12 @@ public void When_parsing_from_array_if_the_proximate_option_is_completed_then_co
{
var command = new RootCommand
{
CreateOptionWithAcceptOnlyFromAmong(name: "--framework", "net7.0"),
CreateOptionWithAcceptOnlyFromAmong(name: "--framework", "net8.0"),
CreateOptionWithAcceptOnlyFromAmong(name: "--language", "C#"),
new Option<string>("--langVersion")
};
var configuration = new CommandLineConfiguration(command);
var completions = command.Parse(new[]{"--framework","net7.0","--l"}, configuration).GetCompletions();
var completions = command.Parse(new[]{"--framework","net8.0","--l"}, configuration).GetCompletions();

completions.Select(item => item.Label)
.Should()
Expand Down
2 changes: 1 addition & 1 deletion src/System.CommandLine/ArgumentValidation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private static void FileOrDirectoryExists<T>(ArgumentResult result)

if (checkFile && checkDirectory)
{
#if NET7_0_OR_GREATER
#if NET8_0_OR_GREATER
Comment thread
zbalkan marked this conversation as resolved.
Outdated
if (!Path.Exists(token.Value))
#else
if (!Directory.Exists(token.Value) && !File.Exists(token.Value))
Expand Down
2 changes: 1 addition & 1 deletion src/System.CommandLine/Argument{T}.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public Argument(string name) : base(name)
{
if (default(T) is null && typeof(T) != typeof(string))
{
#if NET7_0_OR_GREATER
#if NET8_0_OR_GREATER
if (typeof(T).IsSZArray)
#else
if (typeof(T).IsArray && typeof(T).GetArrayRank() == 1)
Expand Down
2 changes: 1 addition & 1 deletion src/System.CommandLine/Binding/ArgumentConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private static ArgumentConversionResult ConvertToken(

if (type.IsEnum)
{
#if NET7_0_OR_GREATER
#if NET8_0_OR_GREATER
if (Enum.TryParse(type, value, ignoreCase: true, out var converted))
{
return Success(argumentResult, converted);
Expand Down
2 changes: 1 addition & 1 deletion src/System.CommandLine/ConsoleHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ internal static class ConsoleHelpers
private static readonly bool ColorsAreSupported = GetColorsAreSupported();

private static bool GetColorsAreSupported()
#if NET7_0_OR_GREATER
#if NET8_0_OR_GREATER
=> !(OperatingSystem.IsBrowser() || OperatingSystem.IsAndroid() || OperatingSystem.IsIOS() || OperatingSystem.IsTvOS())
#else
=> !(RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal sealed class ProcessTerminationHandler : IDisposable
private readonly CancellationTokenSource _handlerCancellationTokenSource;
private readonly Task<int> _startedHandler;
private readonly TimeSpan _processTerminationTimeout;
#if NET7_0_OR_GREATER
#if NET8_0_OR_GREATER
private readonly IDisposable? _sigIntRegistration, _sigTermRegistration;
#endif

Expand All @@ -30,7 +30,7 @@ internal ProcessTerminationHandler(
_startedHandler = startedHandler;
_processTerminationTimeout = processTerminationTimeout;

#if NET7_0_OR_GREATER // we prefer the new API as they allow for cancelling SIGTERM
#if NET8_0_OR_GREATER // we prefer the new API as they allow for cancelling SIGTERM
if (!OperatingSystem.IsAndroid()
&& !OperatingSystem.IsIOS()
&& !OperatingSystem.IsTvOS()
Expand All @@ -48,7 +48,7 @@ internal ProcessTerminationHandler(

public void Dispose()
{
#if NET7_0_OR_GREATER
#if NET8_0_OR_GREATER
if (_sigIntRegistration is not null)
{
_sigIntRegistration.Dispose();
Expand All @@ -61,7 +61,7 @@ public void Dispose()
AppDomain.CurrentDomain.ProcessExit -= OnProcessExit;
}

#if NET7_0_OR_GREATER
#if NET8_0_OR_GREATER
void OnPosixSignal(PosixSignalContext context)
{
context.Cancel = true;
Expand Down