Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: target .NET 8.0 #79

Merged
merged 11 commits into from
Nov 30, 2023
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"nuke.globaltool": {
"version": "7.0.2",
"version": "7.0.6",
"commands": [
"nuke"
]
Expand Down
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -398,8 +401,8 @@ FodyWeavers.xsd
*.msp

# JetBrains Rider
.idea/
*.sln.iml
.idea

##
## Visual studio for Mac
Expand Down Expand Up @@ -477,6 +480,9 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

# Vim temporary swap files
*.swp

# NUKE
.nuke/temp/
.nuke/build.schema.json
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions docs/CHANGELOG-Prerelease.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.100",
"version": "8.0.100",
"rollForward": "feature"
}
}
5 changes: 5 additions & 0 deletions src/build/FlashOWare.Tool.Build/Build.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
5 changes: 3 additions & 2 deletions src/build/FlashOWare.Tool.Build/FlashOWare.Tool.Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169</NoWarn>
<NoWarn>CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006</NoWarn>
<NukeRootDirectory>..\..\..</NukeRootDirectory>
<NukeScriptDirectory>..\..\..</NukeScriptDirectory>
<NukeTelemetryVersion>1</NukeTelemetryVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nuke.Common" Version="7.0.2" />
<PackageReference Include="Nuke.Common" Version="7.0.6" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<LangVersion>11.0</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<LangVersion>11.0</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<LangVersion>11.0</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
Expand All @@ -13,8 +13,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="3.2.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="coverlet.collector" Version="6.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" PrivateAssets="all" />
</ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/tests/FlashOWare.Tool.Cli.Tests/Testing/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ internal enum TargetFramework
NetStandard20,
Net60,
Net70,
Net80,

Latest,
}
Expand All @@ -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)),
};
}
Expand Down Expand Up @@ -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)),
};
Expand All @@ -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)),
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<LangVersion>11.0</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
Expand All @@ -13,8 +13,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="3.2.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="coverlet.collector" Version="6.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" PrivateAssets="all" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/tools/FlashOWare.Tool/FlashOWare.Tool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<LangVersion>11.0</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
Loading