diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 73d604f..4bcc202 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,11 +21,11 @@ jobs: # don't check format on CI builds due to common breaking changes in the .NET SDK checkFormat: false - release_ci: - name: Release Treasure.Utils to NuGet.org - needs: build_ci - if: ${{ contains(github.event.head_commit.message, 'do release') }} - uses: ./.github/workflows/workflow_release.yml - secrets: inherit - with: - package-version: ${{ needs.build_ci.outputs.package_version }} + # release_ci: + # name: Release Treasure.Utils to NuGet.org + # needs: build_ci + # if: ${{ contains(github.event.head_commit.message, 'do release') }} + # uses: ./.github/workflows/workflow_release.yml + # secrets: inherit + # with: + # package-version: ${{ needs.build_ci.outputs.package_version }} diff --git a/.github/workflows/workflow_build.yml b/.github/workflows/workflow_build.yml index f1934be..72c5f74 100644 --- a/.github/workflows/workflow_build.yml +++ b/.github/workflows/workflow_build.yml @@ -38,36 +38,36 @@ jobs: id: version uses: ./.github/actions/version-vars - - name: Restore - run: dotnet restore + # - name: Restore + # run: dotnet restore - - name: Format validation - if: ${{ inputs.checkFormat }} - run: dotnet format --no-restore --verify-no-changes + # - name: Format validation + # if: ${{ inputs.checkFormat }} + # run: dotnet format --no-restore --verify-no-changes - - name: Build - run: dotnet build --configuration Release --no-restore + # - name: Build + # run: dotnet build --configuration Release --no-restore - - name: Test - run: dotnet test --configuration Release --no-build --verbosity normal /p:CollectCoverage=true + # - name: Test + # run: dotnet test --configuration Release --no-build --verbosity normal /p:CollectCoverage=true - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 - with: - name: codecov - directory: __test-results - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - verbose: true + # - name: Upload coverage to Codecov + # uses: codecov/codecov-action@v5 + # with: + # name: codecov + # directory: __test-results + # token: ${{ secrets.CODECOV_TOKEN }} + # fail_ci_if_error: true + # verbose: true - - name: Upload output artifact - uses: actions/upload-artifact@v4 - with: - name: output_${{ inputs.platform }} - path: __output + # - name: Upload output artifact + # uses: actions/upload-artifact@v4 + # with: + # name: output_${{ inputs.platform }} + # path: __output - - name: Upload package artifact - uses: actions/upload-artifact@v4 - with: - name: packages_${{ inputs.platform }} - path: __packages + # - name: Upload package artifact + # uses: actions/upload-artifact@v4 + # with: + # name: packages_${{ inputs.platform }} + # path: __packages diff --git a/Directory.Packages.props b/Directory.Packages.props index 5b09067..e514ad3 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -25,12 +25,7 @@ - - - - - diff --git a/README.md b/README.md index cb325d5..4fe119b 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,10 @@ This repository contains some of my common utilities. ## Treasure.Utils.Argument +> **Important** +> +> This package is now deprecated as it isn't necessary in .NET 8+. + [![NuGet](https://img.shields.io/nuget/v/Treasure.Utils.Argument)](https://www.nuget.org/packages/Treasure.Utils.Argument/) [![NuGet](https://img.shields.io/nuget/dt/Treasure.Utils.Argument)](https://www.nuget.org/packages/Treasure.Utils.Argument/) diff --git a/Treasure.Utils.sln b/Treasure.Utils.sln index 5b53e04..d8a33fe 100644 --- a/Treasure.Utils.sln +++ b/Treasure.Utils.sln @@ -3,12 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.2.32526.322 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Treasure.Utils.Argument", "src\Treasure.Utils.Argument\Treasure.Utils.Argument.csproj", "{5F893AFE-E9C3-47AF-A872-95D1A9CD75FC}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{B012001D-4B86-460D-A3E1-FC3EEC840D13}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Treasure.Utils.Argument.Tests", "test\Treasure.Utils.Argument.Tests\Treasure.Utils.Argument.Tests.csproj", "{EF141707-718F-49EC-99B9-8D7B59CBCCEF}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A18B8F8E-8296-4968-A569-16F3F4FE045E}" ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig @@ -40,20 +34,11 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5F893AFE-E9C3-47AF-A872-95D1A9CD75FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5F893AFE-E9C3-47AF-A872-95D1A9CD75FC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5F893AFE-E9C3-47AF-A872-95D1A9CD75FC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5F893AFE-E9C3-47AF-A872-95D1A9CD75FC}.Release|Any CPU.Build.0 = Release|Any CPU - {EF141707-718F-49EC-99B9-8D7B59CBCCEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EF141707-718F-49EC-99B9-8D7B59CBCCEF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EF141707-718F-49EC-99B9-8D7B59CBCCEF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EF141707-718F-49EC-99B9-8D7B59CBCCEF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {EF141707-718F-49EC-99B9-8D7B59CBCCEF} = {B012001D-4B86-460D-A3E1-FC3EEC840D13} {7C628D75-6B6A-4D42-A4D9-45C6ACA51FB5} = {A18B8F8E-8296-4968-A569-16F3F4FE045E} {61D20241-7C98-4A60-AA8D-C7614B7D6768} = {A18B8F8E-8296-4968-A569-16F3F4FE045E} EndGlobalSection diff --git a/src/Treasure.Utils.Argument/CallerArgumentExpressionAttribute.cs b/src/Treasure.Utils.Argument/CallerArgumentExpressionAttribute.cs deleted file mode 100644 index 9729f4f..0000000 --- a/src/Treasure.Utils.Argument/CallerArgumentExpressionAttribute.cs +++ /dev/null @@ -1,26 +0,0 @@ -#if !NET5_0_OR_GREATER -#pragma warning disable IDE0130 // Namespace does not match folder structure -namespace System.Runtime.CompilerServices; -#pragma warning restore IDE0130 // Namespace does not match folder structure - -/// -/// Allows capturing of the expressions passed to a method. -/// -[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] -internal sealed class CallerArgumentExpressionAttribute : Attribute -{ - /// - /// Gets the target parameter name of the CallerArgumentExpression. - /// - /// - /// The name of the targeted parameter of the CallerArgumentExpression. - /// - public string ParameterName { get; } - - /// - /// Initializes a new instance of the class. - /// - /// The name of the targeted parameter. - public CallerArgumentExpressionAttribute(string parameterName) => this.ParameterName = parameterName; -} -#endif diff --git a/src/Treasure.Utils.Argument/README.md b/src/Treasure.Utils.Argument/README.md index f9d794a..8de00ef 100644 --- a/src/Treasure.Utils.Argument/README.md +++ b/src/Treasure.Utils.Argument/README.md @@ -1,5 +1,10 @@ # Treasure.Utils.Argument +> **Important** +> +> This package is now deprecated as it isn't necessary in .NET 8+. +> The source code remains here for reference if necessary. + [![NuGet](https://img.shields.io/nuget/v/Treasure.Utils.Argument)](https://www.nuget.org/packages/Treasure.Utils.Argument/) [![NuGet](https://img.shields.io/nuget/dt/Treasure.Utils.Argument)](https://www.nuget.org/packages/Treasure.Utils.Argument/) diff --git a/src/Treasure.Utils.Argument/Treasure.Utils.Argument.csproj b/src/Treasure.Utils.Argument/Treasure.Utils.Argument.csproj deleted file mode 100644 index ec746d3..0000000 --- a/src/Treasure.Utils.Argument/Treasure.Utils.Argument.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - net9.0;net8.0;netstandard2.1 - Treasure.Utils - - true - README.md - A utility library for dealing with arguments. - arguments utility treasure - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers - - - - diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 607c595..4f241a5 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -17,12 +17,6 @@ cobertura - - - -windows - net8.0$(PlatformTFMSuffix) - - diff --git a/test/Treasure.Utils.Argument.Tests/ArgumentTests.cs b/test/Treasure.Utils.Argument.Tests/ArgumentTests.cs deleted file mode 100644 index b4dfbad..0000000 --- a/test/Treasure.Utils.Argument.Tests/ArgumentTests.cs +++ /dev/null @@ -1,87 +0,0 @@ -namespace Treasure.Utils.Tests; - -public class ArgumentTests -{ - [Fact] - public void MarkUsed() - { - // Arrange - static void Method(string? useMe) - { - Argument.MarkUsed(useMe); - } - const string? value = null; - - // Act - Method(value); - } - - [Fact] - public void NotNull() - { - // Arrange - int[] objectValue = []; - - // Act and assert - Argument.NotNull(objectValue); - } - - [Theory] - [InlineData(" ")] - [InlineData("foo")] - public void NotNullOrEmpty(string objectValue) - { - // Act and assert - Argument.NotNullOrEmpty(objectValue); - } - - [Theory] - [InlineData(null)] - [InlineData("")] - public void NotNullOrEmptyThrows(string? objectValue) - { - // Act and assert - if (objectValue is null) - { - Assert.Throws(nameof(objectValue), () => Argument.NotNullOrEmpty(objectValue)); - } - else - { - Assert.Throws(nameof(objectValue), () => Argument.NotNullOrEmpty(objectValue)); - } - } - - [Fact] - public void NotNullOrWhiteSpace() - { - // Act and assert - Argument.NotNullOrWhiteSpace("foo"); - } - - [Theory] - [InlineData(null)] - [InlineData("")] - [InlineData(" ")] - public void NotNullOrWhiteSpaceThrows(string? objectValue) - { - // Act and assert - if (objectValue is null) - { - Assert.Throws(nameof(objectValue), () => Argument.NotNullOrWhiteSpace(objectValue)); - } - else - { - Assert.Throws(nameof(objectValue), () => Argument.NotNullOrWhiteSpace(objectValue)); - } - } - - [Fact] - public void NotNullThrows() - { - // Arrange - object? objectValue = null; - - // Act and assert - Assert.Throws(nameof(objectValue), () => Argument.NotNull(objectValue)); - } -} diff --git a/test/Treasure.Utils.Argument.Tests/Treasure.Utils.Argument.Tests.csproj b/test/Treasure.Utils.Argument.Tests/Treasure.Utils.Argument.Tests.csproj deleted file mode 100644 index e73f15f..0000000 --- a/test/Treasure.Utils.Argument.Tests/Treasure.Utils.Argument.Tests.csproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - net9.0;net8.0 - $(TargetFrameworks);$(DefaultNetStandardTestTFM) - Treasure.Utils.Tests - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - -