diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index f97e966..b5c9263 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "nuke.globaltool": { - "version": "7.0.2", + "version": "7.0.6", "commands": [ "nuke" ] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 990d026..fd16510 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 1 + - uses: actions/setup-dotnet@v3 - name: 'Cache: .nuke/temp, ~/.nuget/packages' uses: actions/cache@v3 with: @@ -48,6 +49,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 1 + - uses: actions/setup-dotnet@v3 - name: 'Cache: .nuke/temp, ~/.nuget/packages' uses: actions/cache@v3 with: @@ -64,6 +66,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 1 + - uses: actions/setup-dotnet@v3 - name: 'Cache: .nuke/temp, ~/.nuget/packages' uses: actions/cache@v3 with: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ef0b586..7d6ea26 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -29,6 +29,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 1 + - uses: actions/setup-dotnet@v3 - name: 'Cache: .nuke/temp, ~/.nuget/packages' uses: actions/cache@v3 with: diff --git a/.gitignore b/.gitignore index 5a64a0b..8a680b9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -398,8 +401,8 @@ FodyWeavers.xsd *.msp # JetBrains Rider -.idea/ *.sln.iml +.idea ## ## Visual studio for Mac @@ -477,6 +480,9 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk +# Vim temporary swap files +*.swp + # NUKE .nuke/temp/ .nuke/build.schema.json diff --git a/README.md b/README.md index 2ac731a..915c1f1 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ dotnet tool install --global FlashOWare.Tool --prerelease ## Compatibility - requires the [.NET 6.0](https://dotnet.microsoft.com/download/dotnet/6.0) SDK - supports the [.NET 7.0](https://dotnet.microsoft.com/download/dotnet/7.0) SDK +- supports the [.NET 8.0](https://dotnet.microsoft.com/download/dotnet/8.0) SDK ## Documentation [README.md](./docs/README.md) diff --git a/build.sh b/build.sh index 433c8ad..4f5a01c 100755 --- a/build.sh +++ b/build.sh @@ -58,7 +58,7 @@ fi echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)" -if [[ ! -z ${NUKE_ENTERPRISE_TOKEN+x} && "NUKE_ENTERPRISE_TOKEN" != "" ]]; then +if [[ ! -z ${NUKE_ENTERPRISE_TOKEN+x} && "$NUKE_ENTERPRISE_TOKEN" != "" ]]; then "$DOTNET_EXE" nuget remove source "nuke-enterprise" &>/dev/null || true "$DOTNET_EXE" nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password "$NUKE_ENTERPRISE_TOKEN" --store-password-in-clear-text &>/dev/null || true fi diff --git a/docs/CHANGELOG-Prerelease.md b/docs/CHANGELOG-Prerelease.md index 8e455f6..2a29791 100644 --- a/docs/CHANGELOG-Prerelease.md +++ b/docs/CHANGELOG-Prerelease.md @@ -4,6 +4,8 @@ Prerelease Changelog [goto Release_Changelog;](./CHANGELOG.md) ## [vNext] +### Package +- **Added** _.NET 8.0_ tool target. ## [1.0.0-prerelease1] - 2023-11-12 ### Tool diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 5727414..32e0d62 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -27,6 +27,6 @@ Release Changelog - with `-?|-h|--help` option to get help and usage information ### Package -- **Added** .NET tool targeting _.NET 6.0_ and _.NET 7.0_. +- **Added** .NET tool targeting _.NET 6.0_ and _.NET 7.0_ and _.NET 8.0_. [vnext]: https://github.com/FlashOWare/FlashOWare.Tool/commits/main diff --git a/docs/README.md b/docs/README.md index e0a9d15..08e1a44 100644 --- a/docs/README.md +++ b/docs/README.md @@ -14,3 +14,4 @@ Documentation ## Compatibility - requires the [.NET 6.0](https://dotnet.microsoft.com/download/dotnet/6.0) SDK - supports the [.NET 7.0](https://dotnet.microsoft.com/download/dotnet/7.0) SDK +- supports the [.NET 8.0](https://dotnet.microsoft.com/download/dotnet/8.0) SDK diff --git a/global.json b/global.json index b887553..3f809cb 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100", + "version": "8.0.100", "rollForward": "feature" } } diff --git a/src/build/FlashOWare.Tool.Build/Build.cs b/src/build/FlashOWare.Tool.Build/Build.cs index b87e342..b74527c 100644 --- a/src/build/FlashOWare.Tool.Build/Build.cs +++ b/src/build/FlashOWare.Tool.Build/Build.cs @@ -1,12 +1,17 @@ using System; using System.Linq; using Nuke.Common; +using Nuke.Common.CI; using Nuke.Common.CI.GitHubActions; +using Nuke.Common.Execution; using Nuke.Common.Git; using Nuke.Common.IO; using Nuke.Common.ProjectModel; using Nuke.Common.Tooling; using Nuke.Common.Tools.DotNet; +using Nuke.Common.Utilities.Collections; +using static Nuke.Common.EnvironmentInfo; +using static Nuke.Common.IO.FileSystemTasks; using static Nuke.Common.IO.PathConstruction; using static Nuke.Common.Tools.DotNet.DotNetTasks; @@ -15,6 +20,7 @@ GitHubActionsImage.MacOs12, GitHubActionsImage.Ubuntu2204, GitHubActionsImage.WindowsServer2022, + AutoGenerate = false, OnPushBranches = new[] { "main" }, OnPullRequestBranches = new[] { "main" }, FetchDepth = 1, @@ -22,6 +28,7 @@ [GitHubActions( "publish", GitHubActionsImage.Ubuntu2204, + AutoGenerate = false, OnPushBranches = new[] { "publish" }, FetchDepth = 1, InvokedTargets = new[] { nameof(Publish) }, @@ -30,10 +37,24 @@ class Build : NukeBuild { public static int Main() => Execute(x => x.Compile); + [GitRepository] readonly GitRepository GitRepository; + + [Solution] readonly Solution Solution; + [Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")] readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release; - [GitRepository] readonly GitRepository GitRepository; + [Parameter] readonly string VersionPrefix; + [Parameter] readonly string VersionSuffix; + + [Parameter] readonly string NuGetSource; + + [Parameter][Secret] readonly string NuGetApiKey; + + AbsolutePath ArtifactsDirectory => RootDirectory / "artifacts"; + AbsolutePath TestResultsDirectory => ArtifactsDirectory / "test-results"; + AbsolutePath PackageDirectory => ArtifactsDirectory / "package"; + AbsolutePath NuGetConfigFile => RootDirectory / "nuget.config"; Target Clean => _ => _ .Before(Restore) @@ -47,20 +68,13 @@ class Build : NukeBuild ArtifactsDirectory.DeleteDirectory(); }); - [Solution] readonly Solution Solution; - - [Parameter] readonly string VersionPrefix; - [Parameter] readonly string VersionSuffix; - - [Parameter] readonly string NuGetSource; - - [Parameter][Secret] readonly string NuGetApiKey; - Target Restore => _ => _ .Executes(() => { DotNetRestore(_ => _ - .SetProjectFile(Solution)); + .SetProjectFile(Solution) + .SetConfigFile(NuGetConfigFile) + .SetNoCache(IsServerBuild)); }); Target Compile => _ => _ @@ -70,13 +84,10 @@ class Build : NukeBuild DotNetBuild(_ => _ .SetProjectFile(Solution) .SetConfiguration(Configuration) - .SetNoRestore(FinishedTargets.Contains(Restore))); + .SetNoRestore(FinishedTargets.Contains(Restore)) + .EnableNoLogo()); }); - AbsolutePath ArtifactsDirectory => RootDirectory / "artifacts"; - AbsolutePath TestResultsDirectory => ArtifactsDirectory / "test-results"; - AbsolutePath PackageDirectory => ArtifactsDirectory / "package"; - Target Test => _ => _ .DependsOn(Compile) .Executes(() => @@ -85,6 +96,7 @@ class Build : NukeBuild .SetProjectFile(Solution) .SetConfiguration(Configuration) .SetNoBuild(FinishedTargets.Contains(Compile)) + .EnableNoLogo() .SetResultsDirectory(TestResultsDirectory)); }); diff --git a/src/build/FlashOWare.Tool.Build/FlashOWare.Tool.Build.csproj b/src/build/FlashOWare.Tool.Build/FlashOWare.Tool.Build.csproj index 263da4c..19e3bdf 100644 --- a/src/build/FlashOWare.Tool.Build/FlashOWare.Tool.Build.csproj +++ b/src/build/FlashOWare.Tool.Build/FlashOWare.Tool.Build.csproj @@ -2,16 +2,21 @@ Exe - net6.0 + net8.0 - CS0649;CS0169 + CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006 ..\..\.. ..\..\.. 1 + false + + + + true - + diff --git a/src/libraries/FlashOWare.Tool.Cli/FlashOWare.Tool.Cli.csproj b/src/libraries/FlashOWare.Tool.Cli/FlashOWare.Tool.Cli.csproj index d781b6c..f1d96c0 100644 --- a/src/libraries/FlashOWare.Tool.Cli/FlashOWare.Tool.Cli.csproj +++ b/src/libraries/FlashOWare.Tool.Cli/FlashOWare.Tool.Cli.csproj @@ -2,7 +2,7 @@ Library - net6.0;net7.0 + net8.0;net7.0;net6.0 11.0 enable enable @@ -13,7 +13,7 @@ - + diff --git a/src/libraries/FlashOWare.Tool.Core/FlashOWare.Tool.Core.csproj b/src/libraries/FlashOWare.Tool.Core/FlashOWare.Tool.Core.csproj index 2cbb7c1..0105896 100644 --- a/src/libraries/FlashOWare.Tool.Core/FlashOWare.Tool.Core.csproj +++ b/src/libraries/FlashOWare.Tool.Core/FlashOWare.Tool.Core.csproj @@ -2,7 +2,7 @@ Library - net6.0;net7.0 + net8.0;net7.0;net6.0 11.0 enable enable diff --git a/src/tests/FlashOWare.Tool.Cli.Tests/CodeAnalysis/LanguageVersionExtensions.cs b/src/tests/FlashOWare.Tool.Cli.Tests/CodeAnalysis/LanguageVersionExtensions.cs index 4b75bae..a287718 100644 --- a/src/tests/FlashOWare.Tool.Cli.Tests/CodeAnalysis/LanguageVersionExtensions.cs +++ b/src/tests/FlashOWare.Tool.Cli.Tests/CodeAnalysis/LanguageVersionExtensions.cs @@ -19,6 +19,7 @@ public static LanguageVersion DefaultIfNull(this LanguageVersion? langVersion, T TargetFramework.NetStandard20 => LanguageVersion.CSharp7_3, TargetFramework.Net60 => LanguageVersion.CSharp10, TargetFramework.Net70 => LanguageVersion.CSharp11, + TargetFramework.Net80 => (LanguageVersion)1200, TargetFramework.Latest => LanguageVersion.Latest, _ => throw new InvalidEnumArgumentException(nameof(tfm), (int)tfm, typeof(TargetFramework)), }; diff --git a/src/tests/FlashOWare.Tool.Cli.Tests/FlashOWare.Tool.Cli.Tests.csproj b/src/tests/FlashOWare.Tool.Cli.Tests/FlashOWare.Tool.Cli.Tests.csproj index ed885de..bf6da14 100644 --- a/src/tests/FlashOWare.Tool.Cli.Tests/FlashOWare.Tool.Cli.Tests.csproj +++ b/src/tests/FlashOWare.Tool.Cli.Tests/FlashOWare.Tool.Cli.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0 + net8.0;net7.0;net6.0 11.0 enable enable @@ -13,10 +13,10 @@ - - - - + + + + diff --git a/src/tests/FlashOWare.Tool.Cli.Tests/Testing/Build.cs b/src/tests/FlashOWare.Tool.Cli.Tests/Testing/Build.cs index a7cbfe9..c7cd9fe 100644 --- a/src/tests/FlashOWare.Tool.Cli.Tests/Testing/Build.cs +++ b/src/tests/FlashOWare.Tool.Cli.Tests/Testing/Build.cs @@ -21,6 +21,8 @@ private static string GetTargetFrameworkMoniker() return "net6.0"; #elif NET7_0 return "net7.0"; +#elif NET8_0 + return "net8.0"; #else #error TFM not implemented. #endif diff --git a/src/tests/FlashOWare.Tool.Cli.Tests/Testing/TargetFramework.cs b/src/tests/FlashOWare.Tool.Cli.Tests/Testing/TargetFramework.cs index a60fbe8..680fb9f 100644 --- a/src/tests/FlashOWare.Tool.Cli.Tests/Testing/TargetFramework.cs +++ b/src/tests/FlashOWare.Tool.Cli.Tests/Testing/TargetFramework.cs @@ -9,6 +9,7 @@ internal enum TargetFramework NetStandard20, Net60, Net70, + Net80, Latest, } @@ -23,7 +24,8 @@ public static string ToMonikerString(this TargetFramework tfm) TargetFramework.NetStandard20 => "netstandard2.0", TargetFramework.Net60 => "net6.0", TargetFramework.Net70 => "net7.0", - TargetFramework.Latest => "net7.0", + TargetFramework.Net80 => "net8.0", + TargetFramework.Latest => "net8.0", _ => throw new InvalidEnumArgumentException(nameof(tfm), (int)tfm, typeof(TargetFramework)), }; } @@ -56,6 +58,7 @@ public static string ToTargetFrameworkVersionString(this TargetFramework targetF TargetFramework.NetStandard20 => throw new NotSupportedException(".NET Standard 2.0 is not supported."), TargetFramework.Net60 => throw new NotSupportedException(".NET 6.0 is not supported."), TargetFramework.Net70 => throw new NotSupportedException(".NET 7.0 is not supported."), + TargetFramework.Net80 => throw new NotSupportedException(".NET 8.0 is not supported."), TargetFramework.Latest => throw new NotSupportedException($"{nameof(TargetFramework)} 'latest' is not supported."), _ => throw new InvalidEnumArgumentException(nameof(targetFrameworkVersion), (int)targetFrameworkVersion, typeof(TargetFramework)), }; @@ -69,6 +72,7 @@ public static bool IsDotNetFramework(this TargetFramework tfm) TargetFramework.NetStandard20 => false, TargetFramework.Net60 => false, TargetFramework.Net70 => false, + TargetFramework.Net80 => false, TargetFramework.Latest => false, _ => throw new InvalidEnumArgumentException(nameof(tfm), (int)tfm, typeof(TargetFramework)), }; diff --git a/src/tests/FlashOWare.Tool.Core.Tests/FlashOWare.Tool.Core.Tests.csproj b/src/tests/FlashOWare.Tool.Core.Tests/FlashOWare.Tool.Core.Tests.csproj index e6a6262..07b6ff9 100644 --- a/src/tests/FlashOWare.Tool.Core.Tests/FlashOWare.Tool.Core.Tests.csproj +++ b/src/tests/FlashOWare.Tool.Core.Tests/FlashOWare.Tool.Core.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0 + net8.0;net7.0;net6.0 11.0 enable enable @@ -13,10 +13,10 @@ - - - - + + + + diff --git a/src/tools/FlashOWare.Tool/FlashOWare.Tool.csproj b/src/tools/FlashOWare.Tool/FlashOWare.Tool.csproj index e1a5e0c..2a61e3c 100644 --- a/src/tools/FlashOWare.Tool/FlashOWare.Tool.csproj +++ b/src/tools/FlashOWare.Tool/FlashOWare.Tool.csproj @@ -2,7 +2,7 @@ Exe - net6.0;net7.0 + net8.0;net7.0;net6.0 11.0 enable enable