Skip to content

Commit

Permalink
feat: target .NET 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Flash0ver committed Nov 14, 2023
1 parent 5d8543e commit bed2932
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 9 deletions.
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
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"
}
}
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 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 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

0 comments on commit bed2932

Please sign in to comment.