Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
dotnet-version: '9.0.x'
dotnet-version: '10.0.x'
- name: Create packages
run: dotnet pack --configuration Release --output ./packages
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: NuGet packages
path: packages/*.*
Expand All @@ -40,12 +40,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
- uses: actions/download-artifact@v4
uses: actions/setup-dotnet@v5
- uses: actions/download-artifact@v6
with:
name: NuGet packages
path: packages
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v4
- uses: actions/setup-dotnet@v5
with:
dotnet-version: |
6.0.x
8.0.x
9.0.x
10.0.x

- name: Build & Test in Release Mode
run: dotnet test --configuration Release --logger "GitHubActions"
107 changes: 0 additions & 107 deletions CommonUtilities.sln

This file was deleted.

23 changes: 23 additions & 0 deletions CommonUtilities.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Solution>
<Folder Name="/CommonUtilities.DownloadManager/">
<Project Path="src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj" />
<Project Path="src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj" />
</Folder>
<Folder Name="/CommonUtilities.FileSystem/">
<Project Path="src/CommonUtilities.FileSystem/src/Commonutilities.FileSystem.csproj" />
<Project Path="src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj" />
</Folder>
<Folder Name="/CommonUtilities.Registry/">
<Project Path="src/CommonUtilities.Registry/src/CommonUtilities.Registry.csproj" />
<Project Path="src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj" />
</Folder>
<Folder Name="/CommonUtilities.SimplePipeline/">
<Project Path="src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj" />
<Project Path="src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj" />
</Folder>
<Folder Name="/CommonUtilities/">
<Project Path="src/CommonUtilities/src/CommonUtilities.csproj" />
<Project Path="src/CommonUtilities/test/CommonUtilities.Test.csproj" />
</Folder>
<Project Path="src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj" />
</Solution>
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</PackageReference>
<PackageReference Include="Nerdbank.GitVersioning" Condition="!Exists('packages.config')">
<PrivateAssets>all</PrivateAssets>
<Version>3.7.115</Version>
<Version>3.9.50</Version>
</PackageReference>
<None Include="$(MSBuildThisFileDirectory)README.md" Pack="true" PackagePath="" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.4" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.4" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.0" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
</ItemGroup>

Expand Down
10 changes: 5 additions & 5 deletions src/CommonUtilities.DownloadManager/src/DownloadManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public Task<DownloadResult> DownloadAsync(
if (!uri.IsAbsoluteUri)
throw new ArgumentException("Uri must be absolute.", nameof(uri));

_logger?.LogTrace($"Download requested: {uri.AbsoluteUri}");
_logger?.LogTrace("Download requested: {Uri}", uri.AbsoluteUri);

if (uri is { IsFile: false, IsUnc: false })
{
Expand Down Expand Up @@ -139,7 +139,7 @@ private async Task<DownloadResult> DownloadWithRetry(
var length = outputStream.Length;
try
{
_logger?.LogTrace($"Attempting download '{uri.AbsoluteUri}' using provider '{provider.Name}'");
_logger?.LogTrace("Attempting download '{Uri}' using provider '{ProviderName}'", uri.AbsoluteUri, provider.Name);
var summary = await provider.DownloadAsync(uri, outputStream,
status =>
{
Expand Down Expand Up @@ -193,7 +193,7 @@ private async Task<DownloadResult> DownloadWithRetry(
}
}

_logger?.LogInformation($"Download of '{uri.AbsoluteUri}' succeeded using provider '{provider.Name}'");
_logger?.LogInformation("Download of '{Uri}' succeeded using provider '{ProviderName}'", uri.AbsoluteUri, provider.Name);
_leastRecentlyUsedDownloadProviders.LastSuccessfulProvider = provider.Name;

summary.DownloadProvider = provider.Name;
Expand All @@ -207,7 +207,7 @@ private async Task<DownloadResult> DownloadWithRetry(
catch (Exception ex)
{
failureList.Add(new DownloadFailureInformation(ex, provider.Name));
_logger?.LogTrace($"Download failed using {provider.Name} provider. {ex}");
_logger?.LogTrace("Download failed using {Provider} provider. {Exception}", provider.Name, ex);

if (provider.Equals(providers.LastOrDefault()))
throw new DownloadFailedException(failureList);
Expand All @@ -222,7 +222,7 @@ private async Task<DownloadResult> DownloadWithRetry(
if (millisecondsTimeout <= 0)
continue;

_logger?.LogTrace($"Sleeping {millisecondsTimeout} before retrying download.");
_logger?.LogTrace("Sleeping {WaitTime} before retrying download.", millisecondsTimeout);

await Task.Delay(TimeSpan.FromMilliseconds(millisecondsTimeout), cancellationToken);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ private static HttpRequestMessage CreateRequest(Uri uri)
if (cancellationToken.IsCancellationRequested)
{
_logger?.LogTrace(
"HttpClient error with '" + uri.AbsoluteUri + "' - " + errorMessage);
"HttpClient error with '{Uri}' - {Message}", uri.AbsoluteUri, errorMessage);
cancellationToken.ThrowIfCancellationRequested();
}
_logger?.LogTrace("WebClient error - '" + uri.AbsoluteUri + "'.");
_logger?.LogTrace("WebClient error - '{Uri}'.", uri.AbsoluteUri);
throw;
}
catch (Exception ex)
{
_logger?.LogError(ex, "General exception error in HttpClient");
_logger?.LogError(ex, "General exception error in HttpClient: {Message}", ex.Message);
throw;
}
finally
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,12 @@ protected override async Task<DownloadResult> DownloadAsyncCore(
: "DownloadCore failed";
if (cancellationToken.IsCancellationRequested)
{
_logger?.LogTrace("WebClient error '" + ex.Status + "' with '" + uri.AbsoluteUri + "' - " +
message);
_logger?.LogTrace("WebClient error '{Status}' with '{Uri}' - {Message}", ex.Status, uri.AbsoluteUri, message);
cancellationToken.ThrowIfCancellationRequested();
}
else
{
_logger?.LogTrace("WebClient error '" + ex.Status + "' with '" + uri.AbsoluteUri + "'.");
_logger?.LogTrace("WebClient error '{Status}' with '{Uri}'.", ex.Status, uri.AbsoluteUri);
throw;
}
}
Expand Down Expand Up @@ -160,7 +159,7 @@ private static HttpWebRequest CreateRequest(Uri uri, DownloadOptions? downloadOp
success = true;
return httpWebResponse;
default:
_logger?.LogTrace($"WebResponse error for '{uri.AbsoluteUri}' ({httpWebResponse.StatusCode}).");
_logger?.LogTrace("WebResponse error for '{Uri}' ({Status}).", uri.AbsoluteUri, httpWebResponse.StatusCode);
break;
}
}
Expand All @@ -171,12 +170,11 @@ private static HttpWebRequest CreateRequest(Uri uri, DownloadOptions? downloadOp
: "GetWebResponse failed";
if (cancellationToken.IsCancellationRequested)
{
_logger?.LogTrace(
"WebClient error '" + ex.Status + "' with '" + uri.AbsoluteUri + "' - " + errorMessage);
_logger?.LogTrace("WebClient error '{Status}' with '{Uri}' - {Message}", ex.Status, uri.AbsoluteUri, errorMessage);
cancellationToken.ThrowIfCancellationRequested();
}

_logger?.LogTrace("WebClient error '" + ex.Status + "' - '" + uri.AbsoluteUri + "'.");
_logger?.LogTrace("WebClient error '{Status}' - '{Uri}'.", ex.Status, uri.AbsoluteUri);
throw;
}
catch (Exception ex)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using AnakinRaW.CommonUtilities.Hashing;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="!$([MSBuild]::IsOsUnixLike())">$(TargetFrameworks);net48</TargetFrameworks>
<TargetFrameworks>net10.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="!$([MSBuild]::IsOsUnixLike())">$(TargetFrameworks);net481</TargetFrameworks>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
Expand All @@ -17,16 +17,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MartinCostello.Logging.XUnit" Version="0.5.1" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1">
<PackageReference Include="MartinCostello.Logging.XUnit" Version="0.7.0" />
<PackageReference Include="GitHubActionsTestLogger" Version="3.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="Testably.Abstractions.Testing" Version="4.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="Testably.Abstractions.Testing" Version="5.0.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.2">
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Loading
Loading