Skip to content

Commit

Permalink
Fixed compile errors. Drop .NET 6 and 7 support for .NET 8+ only for …
Browse files Browse the repository at this point in the history
…now.
  • Loading branch information
AraHaan committed Dec 26, 2023
1 parent 55409be commit 8e0aa28
Show file tree
Hide file tree
Showing 166 changed files with 1,236 additions and 1,046 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codacy-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Install latest .NET SDK
uses: Elskom/setup-latest-dotnet@main
with:
SDK_VERSION: '7.0.302'
SDK_VERSION: '8.0.100'
RUNTIME_VERSIONS: ''

- name: Restore and Build
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/dotnetcore-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install latest .NET SDK
uses: Elskom/setup-latest-dotnet@main
with:
SDK_VERSION: '7.0.302'
SDK_VERSION: '8.0.100'
RUNTIME_VERSIONS: ''

- name: Restore, Build, and pack
Expand All @@ -42,7 +42,7 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@main
with:
name: Shipping
name: Shipping-${{ runner.os }}
path: artifacts/packages/Release/Shipping/*

- name: Upload binlog on failure.
Expand All @@ -63,8 +63,9 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@main
with:
name: Shipping
pattern: Shipping-*
path: artifacts/packages/Release/Shipping/
merge-multiple: true

- name: Push nuget Packages to nuget.org.
run: dotnet nuget push **/*.nupkg -s nuget.org -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/dotnetcore-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install latest .NET SDK
uses: Elskom/setup-latest-dotnet@main
with:
SDK_VERSION: '7.0.302'
SDK_VERSION: '8.0.100'
RUNTIME_VERSIONS: ''

- name: Restore, Build, and pack
Expand All @@ -46,7 +46,7 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@main
with:
name: Shipping
name: Shipping-${{ runner.os }}
path: artifacts/packages/Release/Shipping/*

- name: Upload binlog on failure.
Expand All @@ -65,8 +65,9 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@main
with:
name: Shipping
pattern: Shipping-*
path: artifacts/packages/Release/Shipping/
merge-multiple: true

- name: Push nuget Packages to nuget.org.
run: dotnet nuget push **/*.nupkg -s nuget.org -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install latest .NET SDK
uses: Elskom/setup-latest-dotnet@main
with:
SDK_VERSION: '7.0.302'
SDK_VERSION: '8.0.100'
RUNTIME_VERSIONS: ''

- name: Restore, Build, and pack
Expand All @@ -38,7 +38,7 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@main
with:
name: Shipping
name: Shipping-${{ runner.os }}
path: artifacts/packages/Release/Shipping/*

- name: Upload binlog on failure.
Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<!-- We need to mark the sfxproj files as packaging projects to avoid changing their output directories. -->
<IsPackageProject Condition="'$(MSBuildProjectExtension)' == '.sfxproj' OR '$(MSBuildProjectExtension)' == '.bundleproj' OR '$(MSBuildProjectName)' == 'installers.csproj'">true</IsPackageProject>
<IsPackageProject Condition="'$(MSBuildProjectExtension)' != '.sfxproj' AND '$(MSBuildProjectExtension)' != '.bundleproj'">false</IsPackageProject>
Expand All @@ -27,7 +27,7 @@
<PackageProjectUrl>https://github.com/Elskom/runtime/</PackageProjectUrl>
<RepositoryUrl>https://github.com/Elskom/runtime/</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<CopyrightElskom>Copyright (c) 2018-2021</CopyrightElskom>
<CopyrightElskom>Copyright (c) 2018-2023</CopyrightElskom>
<Copyright Condition="'$(IsPackageProject)' == 'false'">$(CopyrightElskom)</Copyright>
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true' AND '$(IsPackageProject)' == 'false'">true</ContinuousIntegrationBuild>
<IsTagBuild Condition="$(GITHUB_REF.StartsWith('refs/tags/'))">true</IsTagBuild>
Expand Down
8 changes: 4 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
</PropertyGroup>

<ItemGroup>
<PackageVersion Include="ZlibSharp" Version="1.2.13.2" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageVersion Include="ZlibSharp" Version="1.2.13.3" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="IDisposableGenerator" Version="1.1.1" />
<PackageVersion Include="Microsoft.DotNet.Build.Tasks.Installers" Version="7.0.0-beta.23316.4" />
<PackageVersion Include="Microsoft.DotNet.Build.Tasks.Archives" Version="7.0.0-beta.23316.4" />
<PackageVersion Include="Microsoft.DotNet.Build.Tasks.Installers" Version="8.0.0-beta.23620.2" />
<PackageVersion Include="Microsoft.DotNet.Build.Tasks.Archives" Version="8.0.0-beta.23620.2" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<!-- Required to restore the projects for now. -->
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
<add key="dotnet6-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6-transport/nuget/v3/index.json" />
<add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
<add key="dotnet8-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8-transport/nuget/v3/index.json" />
</packageSources>
</configuration>
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<!-- This repo version -->
<MajorVersion>6</MajorVersion>
<MajorVersion>8</MajorVersion>
<MinorVersion>0</MinorVersion>
<PatchVersion>0</PatchVersion>
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
Expand Down
6 changes: 3 additions & 3 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"rollForward": "latestFeature"
},
"msbuild-sdks": {
"Elskom.Sdk": "6.0.4",
"Elskom.Sdk": "8.0.0",
"Microsoft.Build.NoTargets": "3.7.0",
"Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.23316.4",
"Microsoft.DotNet.SharedFramework.Sdk": "7.0.0-beta.23316.4"
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.23620.2",
"Microsoft.DotNet.SharedFramework.Sdk": "8.0.0-beta.23620.2"
}
}
3 changes: 3 additions & 0 deletions ref/BlowFish/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,6 @@ csharp_preserve_single_line_statements = true

# S3903: Move '%s' into a named namespace.
dotnet_diagnostic.S3903.severity = none

# S1133: Deprecated code should be removed
dotnet_diagnostic.S1133.severity = suggestion
70 changes: 22 additions & 48 deletions ref/BlowFish/BlowFish/BlowFish.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Elskom.Generic.Libs;
/// <summary>
/// Blowfish encryption class.
/// </summary>
[SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Ref assembly which must match ABI of runtime.")]
public sealed class BlowFish : IDisposable
{
/// <summary>
Expand Down Expand Up @@ -65,70 +66,43 @@ public static void XorBlock(Stream block, byte[] iv)
=> throw null!;

/// <summary>
/// Encrypts a string in CBC mode.
/// Encrypts a string.
/// </summary>
/// <param name="pt">Plaintext data to encrypt.</param>
/// <returns>Ciphertext with IV appended to front.</returns>
public string EncryptCBC(string pt)
=> throw null!;

/// <summary>
/// Encrypts a byte array in CBC mode.
/// IV must be created and saved manually.
/// </summary>
/// <param name="pt">Plaintext data to encrypt.</param>
/// <returns>Ciphertext.</returns>
public byte[] EncryptCBC(byte[] pt)
=> throw null!;

/// <summary>
/// Decrypts a string in CBC mode.
/// </summary>
/// <param name="ct">Ciphertext with IV appended to front.</param>
/// <returns>Plaintext.</returns>
public string DecryptCBC(string ct)
=> throw null!;

/// <summary>
/// Decrypts a byte array in CBC mode.
/// IV must be created and saved manually.
/// </summary>
/// <param name="ct">Ciphertext data to decrypt.</param>
/// <returns>Plaintext.</returns>
public byte[] DecryptCBC(byte[] ct)
=> throw null!;

/// <summary>
/// Encrypt a string in ECB mode.
/// </summary>
/// <param name="pt">Plaintext to encrypt as ascii string.</param>
/// <returns>hex value of encrypted data.</returns>
public string EncryptECB(string pt)
/// <param name="ct">Ciphertext with IV appended to front if <see cref="CipherMode.CBC"/> mode, or hex string if <see cref="CipherMode.ECB"/> mode.</param>
/// <param name="mode">Cipher mode.</param>
/// <returns>Ciphertext with or without the IV appended to front or <see langword="null"/> if mode is not <see cref="CipherMode.ECB"/> or <see cref="CipherMode.CBC"/>.</returns>
[Obsolete("Using CipherMode.ECB in this method is deprecated.")]
public string? Encrypt(string ct, CipherMode mode)
=> throw null!;

/// <summary>
/// Encrypts a byte array in ECB mode.
/// Encrypts a byte array.
/// </summary>
/// <param name="pt">Plaintext data.</param>
/// <returns>Ciphertext bytes.</returns>
public byte[] EncryptECB(byte[] pt)
/// <param name="cipherText">Ciphertext byte array.</param>
/// <param name="mode">Cipher mode.</param>
/// <returns>Plaintext or <see langword="null"/> if mode is not <see cref="CipherMode.ECB"/> or <see cref="CipherMode.CBC"/>.</returns>
[Obsolete("Using CipherMode.ECB in this method is deprecated.")]
public byte[]? Encrypt(byte[] cipherText, CipherMode mode)
=> throw null!;

/// <summary>
/// Decrypts a string (ECB).
/// Decrypts a string.
/// </summary>
/// <param name="ct">hHex string of the ciphertext.</param>
/// <returns>Plaintext ascii string.</returns>
public string DecryptECB(string ct)
/// <param name="ct">Ciphertext with IV appended to front if <see cref="CipherMode.CBC"/> mode, or hex string if <see cref="CipherMode.ECB"/> mode.</param>
/// <param name="mode">Cipher mode.</param>
/// <returns>Plaintext or <see langword="null"/> if mode is not <see cref="CipherMode.ECB"/> or <see cref="CipherMode.CBC"/>.</returns>
[Obsolete("Using CipherMode.ECB in this method is deprecated.")]
public string? Decrypt(string ct, CipherMode mode)
=> throw null!;

/// <summary>
/// Decrypts a byte array.
/// </summary>
/// <param name="cipherText">Ciphertext byte array.</param>
/// <param name="mode">Cipher mode.</param>
/// <returns>Plaintext or <see langword="null"/> if mode is not <see cref="CipherMode.ECB"/>.</returns>
public byte[] Decrypt(byte[] cipherText, CipherMode mode)
/// <returns>Plaintext or <see langword="null"/> if mode is not <see cref="CipherMode.ECB"/> or <see cref="CipherMode.CBC"/>.</returns>
[Obsolete("Using CipherMode.ECB in this method is deprecated.")]
public byte[]? Decrypt(byte[] cipherText, CipherMode mode)
=> throw null!;

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions ref/BlowFish/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<AdditionalFiles Include="../../stylecop.json">
<Link>stylecop.json</Link>
</AdditionalFiles>
<Using Include="System.Diagnostics.CodeAnalysis" />
<Using Include="System.Globalization" />
<Using Include="System.Security.Cryptography" />
<Using Include="System.Text" />
Expand Down
1 change: 1 addition & 0 deletions ref/Common/Common/MessageEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Elskom.Generic.Libs;
/// <summary>
/// Event that holds the message text and the caption.
/// </summary>
[SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Ref assembly.")]
public class MessageEventArgs : EventArgs
{
/// <summary>
Expand Down
17 changes: 0 additions & 17 deletions ref/Common/Common/MessageEventHandler.cs

This file was deleted.

3 changes: 2 additions & 1 deletion ref/Common/Common/NotificationEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ namespace Elskom.Generic.Libs;
/// <summary>
/// Event that holds that data to call the apis for notifications.
/// </summary>
public class NotificationEventArgs
[SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Ref assembly.")]
public class NotificationEventArgs : EventArgs
{
/// <summary>
/// Initializes a new instance of the <see cref="NotificationEventArgs"/> class.
Expand Down
17 changes: 0 additions & 17 deletions ref/Common/Common/NotificationEventHandler.cs

This file was deleted.

1 change: 1 addition & 0 deletions ref/Common/Common/ProcessStartOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Elskom.Generic.Libs;
/// <summary>
/// Creates a Process with additional options.
/// </summary>
[SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Ref assembly.")]
public sealed class ProcessStartOptions
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions ref/Common/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<Link>stylecop.json</Link>
</AdditionalFiles>
<Using Include="System.Diagnostics" />
<Using Include="System.Diagnostics.CodeAnalysis" />
<Using Include="System.Text" />
</ItemGroup>

Expand Down
1 change: 1 addition & 0 deletions ref/GenericPluginLoader/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<Using Include="System" />
<Using Include="System.Collections.Generic" />
<Using Include="System.Diagnostics" />
<Using Include="System.Diagnostics.CodeAnalysis" />
<Using Include="System.IO.Compression" />
<Using Include="System.Reflection" />
<Using Include="System.Text" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ namespace Elskom.Generic.Libs;
/// <summary>
/// A generic loader for plugins.
/// </summary>
[SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Ref assembly which must match ABI of runtime.")]
public sealed class GenericPluginLoader
{
/// <summary>
/// Triggers when the Plugin Loader has a message to send to the application.
/// </summary>
public static event MessageEventHandler? PluginLoaderMessage
public static event EventHandler<MessageEventArgs>? PluginLoaderMessage
{
add => throw null!;
remove => throw null!;
Expand Down
1 change: 1 addition & 0 deletions ref/GitInformation/GitInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Elskom.Generic.Libs;
/// <summary>
/// Obtain the git repository information for the assembly.
/// </summary>
[SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Ref assembly which must match ABI of runtime.")]
public class GitInformation
{
/// <summary>
Expand Down
3 changes: 2 additions & 1 deletion ref/GitInformation/GitInformationAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Elskom.Generic.Libs;
/// Attribute that creates and registers an instance of the <see cref="GitInformation" /> class for the assembly.
/// </summary>
[AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
public class GitInformationAttribute : Attribute
public sealed class GitInformationAttribute : Attribute
{
/// <summary>
/// Initializes a new instance of the <see cref="GitInformationAttribute"/> class.
Expand All @@ -31,6 +31,7 @@ public class GitInformationAttribute : Attribute
/// <exception cref="ArgumentNullException">
/// Thrown when <paramref name="assemblyType"/> is <see langword="null"/>.
/// </exception>
[SuppressMessage("Design", "CA1019:Define accessors for attribute arguments", Justification = "Do not want the values of the mandatory arguments to be retrievable.")]
public GitInformationAttribute(string headdesc, string commit, string branchname, Type assemblyType)
=> throw null!;
}
2 changes: 1 addition & 1 deletion ref/MessageManager/MessageManager/MessageManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static class MessageManager
/// <summary>
/// Occurs when the ShowError(), ShowInfo(), or ShowWarning() methods is told to use Notifications.
/// </summary>
public static event NotificationEventHandler? Notification
public static event EventHandler<NotificationEventArgs>? Notification
{
add => throw null!;
remove => throw null!;
Expand Down
Loading

0 comments on commit 8e0aa28

Please sign in to comment.