Skip to content

Commit

Permalink
Update NuGet packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz committed Jan 11, 2024
1 parent 7c5feee commit b305b60
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 70 deletions.
8 changes: 4 additions & 4 deletions CliWrap.Benchmarks/BufferingBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ public async Task<(string, string)> MedallionShell()
[Benchmark]
public async Task<(string, string)> ProcessX()
{
var (_, stdOutStream, stdErrStream) = Cysharp
.Diagnostics
.ProcessX
.GetDualAsyncEnumerable(FilePath, arguments: Args);
var (_, stdOutStream, stdErrStream) = Cysharp.Diagnostics.ProcessX.GetDualAsyncEnumerable(
FilePath,
arguments: Args
);

var stdOutTask = stdOutStream.ToTask();
var stdErrTask = stdErrStream.ToTask();
Expand Down
4 changes: 2 additions & 2 deletions CliWrap.Benchmarks/CliWrap.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.11" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.5" PrivateAssets="all" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.7" PrivateAssets="all" />
<PackageReference Include="ProcessX" Version="1.5.5" />
<PackageReference Include="RunProcessAsTask" Version="1.2.4" />
<PackageReference Include="MedallionShell" Version="1.6.2" />
Expand Down
8 changes: 4 additions & 4 deletions CliWrap.Benchmarks/PullEventStreamBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public async Task<int> ProcessX()
{
var counter = 0;

var (_, stdOutStream, stdErrStream) = Cysharp
.Diagnostics
.ProcessX
.GetDualAsyncEnumerable(FilePath, arguments: Args);
var (_, stdOutStream, stdErrStream) = Cysharp.Diagnostics.ProcessX.GetDualAsyncEnumerable(
FilePath,
arguments: Args
);

var consumeStdOutTask = Task.Run(async () =>
{
Expand Down
2 changes: 1 addition & 1 deletion CliWrap.Signaler/CliWrap.Signaler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CSharpier.MsBuild" Version="0.26.5" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.7" PrivateAssets="all" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions CliWrap.Tests.Dummy/CliWrap.Tests.Dummy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

<ItemGroup>
<PackageReference Include="CliFx" Version="2.3.5" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.5" PrivateAssets="all" />
<PackageReference Include="PolyShim" Version="1.8.0" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.7" PrivateAssets="all" />
<PackageReference Include="PolyShim" Version="1.10.0" PrivateAssets="all" />
<PackageReference Include="System.Memory" Version="4.5.5" />
</ItemGroup>

Expand Down
8 changes: 4 additions & 4 deletions CliWrap.Tests/CliWrap.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.5" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.7" PrivateAssets="all" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="PolyShim" Version="1.8.0" PrivateAssets="all" />
<PackageReference Include="PolyShim" Version="1.10.0" PrivateAssets="all" />
<PackageReference Include="System.Reactive" Version="6.0.0" />
<PackageReference Include="xunit" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5" PrivateAssets="all" />
<PackageReference Include="xunit" Version="2.6.5" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6" PrivateAssets="all" />
<PackageReference Include="Xunit.SkippableFact" Version="1.4.13" />
</ItemGroup>

Expand Down
15 changes: 5 additions & 10 deletions CliWrap.Tests/ConfigurationSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ public void I_can_configure_the_command_line_arguments_using_a_builder()
original.Should().BeEquivalentTo(modified, o => o.Excluding(c => c.Arguments));
original.Arguments.Should().NotBe(modified.Arguments);
modified
.Arguments
.Should()
.Arguments.Should()
.Be("-a \"foo bar\" \"\\\"foo\\\\bar\\\"\" 3.14 foo bar -5 89.13");
}

Expand Down Expand Up @@ -126,8 +125,7 @@ public void I_can_configure_the_user_credentials()
original.Should().BeEquivalentTo(modified, o => o.Excluding(c => c.Credentials));
original.Credentials.Should().NotBe(modified.Credentials);
modified
.Credentials
.Should()
.Credentials.Should()
.BeEquivalentTo(new Credentials("domain", "username", "password", true));
}

Expand All @@ -150,8 +148,7 @@ public void I_can_configure_the_user_credentials_using_a_builder()
original.Should().BeEquivalentTo(modified, o => o.Excluding(c => c.Credentials));
original.Credentials.Should().NotBe(modified.Credentials);
modified
.Credentials
.Should()
.Credentials.Should()
.BeEquivalentTo(new Credentials("domain", "username", "password", true));
}

Expand All @@ -170,8 +167,7 @@ public void I_can_configure_the_environment_variables()
original.Should().BeEquivalentTo(modified, o => o.Excluding(c => c.EnvironmentVariables));
original.EnvironmentVariables.Should().NotBeEquivalentTo(modified.EnvironmentVariables);
modified
.EnvironmentVariables
.Should()
.EnvironmentVariables.Should()
.BeEquivalentTo(
new Dictionary<string, string?> { ["name"] = "value", ["key"] = "door" }
);
Expand All @@ -195,8 +191,7 @@ public void I_can_configure_the_environment_variables_using_a_builder()
original.Should().BeEquivalentTo(modified, o => o.Excluding(c => c.EnvironmentVariables));
original.EnvironmentVariables.Should().NotBeEquivalentTo(modified.EnvironmentVariables);
modified
.EnvironmentVariables
.Should()
.EnvironmentVariables.Should()
.BeEquivalentTo(
new Dictionary<string, string?>
{
Expand Down
7 changes: 4 additions & 3 deletions CliWrap.Tests/PipingSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -608,9 +608,10 @@ public async Task I_can_execute_a_command_with_buffering_and_also_pipe_the_stdou
delegateLines
.Should()
.Equal(
result
.StandardOutput
.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries)
result.StandardOutput.Split(
Environment.NewLine,
StringSplitOptions.RemoveEmptyEntries
)
);
}

Expand Down
3 changes: 1 addition & 2 deletions CliWrap.Tests/Utils/Extensions/AssertionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ internal static class AssertionExtensions
IEnumerable<string> lines
) =>
assertions
.Subject
.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries)
.Subject.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries)
.Should()
.Equal(lines);

Expand Down
4 changes: 2 additions & 2 deletions CliWrap/CliWrap.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CSharpier.MsBuild" Version="0.26.5" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.7" PrivateAssets="all" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="all" />
<PackageReference Include="PolyShim" Version="1.8.0" PrivateAssets="all" />
<PackageReference Include="PolyShim" Version="1.10.0" PrivateAssets="all" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'net462'" />
<PackageReference Include="System.Management" Version="8.0.0" Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1'" />
<PackageReference Include="System.Memory" Version="4.5.5" Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'net462'" />
Expand Down
2 changes: 1 addition & 1 deletion CliWrap/Command.Execution.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ await StandardErrorPipe
// and won't need it anymore.
// If the pipe has already been exhausted (most likely), this won't do anything.
// If the pipe is still trying to transfer data, this will cause it to abort.
stdInCts.Cancel();
await stdInCts.CancelAsync();

// Wait until piping is done and propagate exceptions
await pipingTask.ConfigureAwait(false);
Expand Down
20 changes: 9 additions & 11 deletions CliWrap/EventStream/PullEventStreamCommandExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,15 @@ await channel
yield return new StartedCommandEvent(commandTask.ProcessId);

// Close the channel once the command completes, so that ReceiveAsync() can finish
_ = commandTask
.Task
.ContinueWith(
async _ =>
// ReSharper disable once AccessToDisposedClosure
await channel
.ReportCompletionAsync(forcefulCancellationToken)
.ConfigureAwait(false),
// Run the continuation even if the parent task failed
TaskContinuationOptions.None
);
_ = commandTask.Task.ContinueWith(
async _ =>
// ReSharper disable once AccessToDisposedClosure
await channel
.ReportCompletionAsync(forcefulCancellationToken)
.ConfigureAwait(false),
// Run the continuation even if the parent task failed
TaskContinuationOptions.None
);

await foreach (
var cmdEvent in channel.ReceiveAsync(forcefulCancellationToken).ConfigureAwait(false)
Expand Down
40 changes: 19 additions & 21 deletions CliWrap/EventStream/PushEventStreamCommandExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,28 +59,26 @@ CancellationToken gracefulCancellationToken
// Don't pass cancellation token to the continuation because we need it to
// trigger regardless of how the task completed.
_ = commandTask
.Task
.ContinueWith(
t =>
_ = commandTask.Task.ContinueWith(
t =>
{
// Canceled tasks don't have exceptions
if (t.IsCanceled)
{
// Canceled tasks don't have exceptions
if (t.IsCanceled)
{
observer.OnError(new TaskCanceledException(t));
}
else if (t.Exception is not null)
{
observer.OnError(t.Exception.TryGetSingle() ?? t.Exception);
}
else
{
observer.OnNext(new ExitedCommandEvent(t.Result.ExitCode));
observer.OnCompleted();
}
},
TaskContinuationOptions.None
);
observer.OnError(new TaskCanceledException(t));
}
else if (t.Exception is not null)
{
observer.OnError(t.Exception.TryGetSingle() ?? t.Exception);
}
else
{
observer.OnNext(new ExitedCommandEvent(t.Result.ExitCode));
observer.OnCompleted();
}
},
TaskContinuationOptions.None
);
return Disposable.Null;
});
Expand Down
2 changes: 1 addition & 1 deletion CliWrap/PipeTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private class AggregatePipeTarget(IReadOnlyList<PipeTarget> targets) : PipeTarge
{
// Abort the operation if any of the targets fail
// ReSharper disable once AccessToDisposedClosure
cts.Cancel();
await cts.CancelAsync();
throw;
}
Expand Down
3 changes: 1 addition & 2 deletions CliWrap/Utils/SimplexStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ CancellationToken cancellationToken
var length = Math.Min(count, _sharedBufferBytes - _sharedBufferBytesRead);

_sharedBuffer
.Memory
.Slice(_sharedBufferBytesRead, length)
.Memory.Slice(_sharedBufferBytesRead, length)
.CopyTo(buffer.AsMemory(offset, length));

_sharedBufferBytesRead += length;
Expand Down

0 comments on commit b305b60

Please sign in to comment.