Target .NET 8

This commit is contained in:
Alex Barney 2023-12-08 23:30:46 -07:00
parent f28e7a7dbb
commit 48e7651291
8 changed files with 28 additions and 31 deletions

View file

@ -1 +1 @@
7.0.402 8.0.100

View file

@ -43,7 +43,7 @@ partial class Build : NukeBuild
AbsolutePath ArtifactsDirectory => RootDirectory / "artifacts"; AbsolutePath ArtifactsDirectory => RootDirectory / "artifacts";
AbsolutePath SignedArtifactsDirectory => ArtifactsDirectory / "signed"; AbsolutePath SignedArtifactsDirectory => ArtifactsDirectory / "signed";
AbsolutePath TempDirectory => RootDirectory / ".nuke" / "temp"; AbsolutePath TempDirectory => RootDirectory / ".nuke" / "temp";
AbsolutePath CliCoreDir => TempDirectory / "hactoolnet_net7.0"; AbsolutePath CliCoreDir => TempDirectory / "hactoolnet_net8.0";
AbsolutePath CliNativeDir => TempDirectory / $"hactoolnet_{HostOsName}"; AbsolutePath CliNativeDir => TempDirectory / $"hactoolnet_{HostOsName}";
AbsolutePath CliNativeExe => CliNativeDir / $"hactoolnet{NativeProgramExtension}"; AbsolutePath CliNativeExe => CliNativeDir / $"hactoolnet{NativeProgramExtension}";
AbsolutePath CliCoreZip => ArtifactsDirectory / $"hactoolnet-{VersionString}-netcore.zip"; AbsolutePath CliCoreZip => ArtifactsDirectory / $"hactoolnet-{VersionString}-netcore.zip";
@ -226,7 +226,7 @@ partial class Build : NukeBuild
DotNetPublish(s => publishSettings DotNetPublish(s => publishSettings
.SetProject(HactoolnetProject) .SetProject(HactoolnetProject)
.SetFramework("net7.0") .SetFramework("net8.0")
.SetOutput(CliCoreDir) .SetOutput(CliCoreDir)
.SetNoBuild(true) .SetNoBuild(true)
.SetProperties(VersionProps)); .SetProperties(VersionProps));
@ -276,7 +276,7 @@ partial class Build : NukeBuild
.EnableNoBuild() .EnableNoBuild()
.SetConfiguration(Configuration); .SetConfiguration(Configuration);
if (EnvironmentInfo.IsUnix) settings = settings.SetProperty("TargetFramework", "net7.0"); if (EnvironmentInfo.IsUnix) settings = settings.SetProperty("TargetFramework", "net8.0");
DotNetTest(s => settings); DotNetTest(s => settings);
}); });
@ -593,7 +593,7 @@ partial class Build : NukeBuild
SignAssemblies(password, toSign.Select(x => x.ToString()).ToArray()); SignAssemblies(password, toSign.Select(x => x.ToString()).ToArray());
// Avoid having multiple signed versions of the same file // Avoid having multiple signed versions of the same file
File.Copy(nupkgDir / "lib" / "net7.0" / "LibHac.dll", coreFxDir / "LibHac.dll", true); File.Copy(nupkgDir / "lib" / "net8.0" / "LibHac.dll", coreFxDir / "LibHac.dll", true);
ZipDirectory(SignedArtifactsDirectory / Path.GetFileName(nupkgFile), nupkgDir, pkgFileList, CommitTime); ZipDirectory(SignedArtifactsDirectory / Path.GetFileName(nupkgFile), nupkgDir, pkgFileList, CommitTime);
ZipDirectory(SignedArtifactsDirectory / Path.GetFileName(CliCoreZip), coreFxDir, CommitTime); ZipDirectory(SignedArtifactsDirectory / Path.GetFileName(CliCoreZip), coreFxDir, CommitTime);

View file

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<RootNamespace>LibHacBuild.CodeGen</RootNamespace> <RootNamespace>LibHacBuild.CodeGen</RootNamespace>
<IsPackable>False</IsPackable> <IsPackable>False</IsPackable>

View file

@ -2,20 +2,21 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<RootNamespace>LibHacBuild</RootNamespace> <RootNamespace>LibHacBuild</RootNamespace>
<IsPackable>False</IsPackable> <IsPackable>False</IsPackable>
<NoWarn>CS0649;CS0169</NoWarn> <NoWarn>CS0649;CS0169</NoWarn>
<NukeRootDirectory>..</NukeRootDirectory> <NukeRootDirectory>..</NukeRootDirectory>
<NukeScriptDirectory>..</NukeScriptDirectory> <NukeScriptDirectory>..</NukeScriptDirectory>
<NukeTelemetryVersion>1</NukeTelemetryVersion> <NukeTelemetryVersion>1</NukeTelemetryVersion>
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageDownload Include="GitVersion.Tool" Version="[5.12.0]" /> <PackageDownload Include="GitVersion.Tool" Version="[5.12.0]" />
<PackageReference Include="CsvHelper" Version="30.0.1" /> <PackageReference Include="CsvHelper" Version="30.0.1" />
<PackageReference Include="NuGet.CommandLine" Version="6.7.0"> <PackageReference Include="NuGet.CommandLine" Version="6.8.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>

View file

@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<VersionPrefix>0.19.0</VersionPrefix> <VersionPrefix>0.19.0</VersionPrefix>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>
@ -37,10 +37,6 @@
<Compile Condition="Exists('Common\Keys\DefaultKeySet.Generated.cs')" Remove="Common\Keys\DefaultKeySet.Empty.cs" /> <Compile Condition="Exists('Common\Keys\DefaultKeySet.Generated.cs')" Remove="Common\Keys\DefaultKeySet.Empty.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo"> <AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>LibHac.Tests</_Parameter1> <_Parameter1>LibHac.Tests</_Parameter1>

View file

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
@ -24,8 +24,8 @@
</ItemGroup> </ItemGroup>
<PropertyGroup Condition=" $(BuildType.StartsWith('native')) "> <PropertyGroup Condition=" $(BuildType.StartsWith('native')) ">
<PublishAot>true</PublishAot> <PublishAot>true</PublishAot>
<DefineConstants>NATIVEAOT;$(DefineConstants)</DefineConstants> <DefineConstants>NATIVEAOT;$(DefineConstants)</DefineConstants>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" $(BuildType.StartsWith('native')) and '$(BuildType)' != 'native-untrimmed' "> <PropertyGroup Condition=" $(BuildType.StartsWith('native')) and '$(BuildType)' != 'native-untrimmed' ">

View file

@ -215,7 +215,7 @@ public class PathFormatterTests
Assert.Equal(expectedNormalized, StringUtils.Utf8ZToString(buffer)); Assert.Equal(expectedNormalized, StringUtils.Utf8ZToString(buffer));
} }
public static TheoryData<string, string, bool, int, Result> TestData_IsNormalized_EmptyPath => new() public static TheoryData<string, string, bool, long, Result> TestData_IsNormalized_EmptyPath => new()
{ {
{ @"", "", false, 0, ResultFs.InvalidPathFormat.Value }, { @"", "", false, 0, ResultFs.InvalidPathFormat.Value },
{ @"", "E", true, 0, Result.Success }, { @"", "E", true, 0, Result.Success },
@ -229,7 +229,7 @@ public class PathFormatterTests
IsNormalizedImpl(path, pathFlags, expectedIsNormalized, expectedLength, expectedResult); IsNormalizedImpl(path, pathFlags, expectedIsNormalized, expectedLength, expectedResult);
} }
public static TheoryData<string, string, bool, int, Result> TestData_IsNormalized_MountName => new() public static TheoryData<string, string, bool, long, Result> TestData_IsNormalized_MountName => new()
{ {
{ @"mount:/aa/bb", "", false, 0, ResultFs.InvalidPathFormat.Value }, { @"mount:/aa/bb", "", false, 0, ResultFs.InvalidPathFormat.Value },
{ @"mount:/aa/bb", "W", false, 0, ResultFs.InvalidPathFormat.Value }, { @"mount:/aa/bb", "W", false, 0, ResultFs.InvalidPathFormat.Value },
@ -251,7 +251,7 @@ public class PathFormatterTests
IsNormalizedImpl(path, pathFlags, expectedIsNormalized, expectedLength, expectedResult); IsNormalizedImpl(path, pathFlags, expectedIsNormalized, expectedLength, expectedResult);
} }
public static TheoryData<string, string, bool, int, Result> TestData_IsNormalized_WindowsPath => new() public static TheoryData<string, string, bool, long, Result> TestData_IsNormalized_WindowsPath => new()
{ {
{ @"c:/aa/bb", "", false, 0, ResultFs.InvalidPathFormat.Value }, { @"c:/aa/bb", "", false, 0, ResultFs.InvalidPathFormat.Value },
{ @"c:\aa\bb", "", false, 0, ResultFs.InvalidPathFormat.Value }, { @"c:\aa\bb", "", false, 0, ResultFs.InvalidPathFormat.Value },
@ -298,7 +298,7 @@ public class PathFormatterTests
IsNormalizedImpl(path, pathFlags, expectedIsNormalized, expectedLength, expectedResult); IsNormalizedImpl(path, pathFlags, expectedIsNormalized, expectedLength, expectedResult);
} }
public static TheoryData<string, string, bool, int, Result> TestData_IsNormalized_RelativePath => new() public static TheoryData<string, string, bool, long, Result> TestData_IsNormalized_RelativePath => new()
{ {
{ @"./aa/bb", "", false, 0, ResultFs.InvalidPathFormat.Value }, { @"./aa/bb", "", false, 0, ResultFs.InvalidPathFormat.Value },
{ @"./aa/bb/../cc", "R", false, 1, Result.Success }, { @"./aa/bb/../cc", "R", false, 1, Result.Success },
@ -318,7 +318,7 @@ public class PathFormatterTests
IsNormalizedImpl(path, pathFlags, expectedIsNormalized, expectedLength, expectedResult); IsNormalizedImpl(path, pathFlags, expectedIsNormalized, expectedLength, expectedResult);
} }
public static TheoryData<string, string, bool, int, Result> TestData_IsNormalized_Backslash => new() public static TheoryData<string, string, bool, long, Result> TestData_IsNormalized_Backslash => new()
{ {
{ @"\aa\bb\..\cc", "", false, 0, ResultFs.InvalidPathFormat.Value }, { @"\aa\bb\..\cc", "", false, 0, ResultFs.InvalidPathFormat.Value },
{ @"\aa\bb\..\cc", "B", false, 0, ResultFs.InvalidPathFormat.Value }, { @"\aa\bb\..\cc", "B", false, 0, ResultFs.InvalidPathFormat.Value },
@ -339,7 +339,7 @@ public class PathFormatterTests
IsNormalizedImpl(path, pathFlags, expectedIsNormalized, expectedLength, expectedResult); IsNormalizedImpl(path, pathFlags, expectedIsNormalized, expectedLength, expectedResult);
} }
public static TheoryData<string, string, bool, int, Result> TestData_IsNormalized_AllowAllChars => new() public static TheoryData<string, string, bool, long, Result> TestData_IsNormalized_AllowAllChars => new()
{ {
{ @"/aa/b:b/cc", "", false, 0, ResultFs.InvalidCharacter.Value }, { @"/aa/b:b/cc", "", false, 0, ResultFs.InvalidCharacter.Value },
{ @"/aa/b*b/cc", "", false, 0, ResultFs.InvalidCharacter.Value }, { @"/aa/b*b/cc", "", false, 0, ResultFs.InvalidCharacter.Value },
@ -372,7 +372,7 @@ public class PathFormatterTests
IsNormalizedImpl(path, pathFlags, expectedIsNormalized, expectedLength, expectedResult); IsNormalizedImpl(path, pathFlags, expectedIsNormalized, expectedLength, expectedResult);
} }
public static TheoryData<string, string, bool, int, Result> TestData_IsNormalized_All => new() public static TheoryData<string, string, bool, long, Result> TestData_IsNormalized_All => new()
{ {
{ @"mount:./aa/bb", "WRM", true, 13, Result.Success }, { @"mount:./aa/bb", "WRM", true, 13, Result.Success },
{ @"mount:./aa/bb\cc/dd", "WRM", false, 0, Result.Success }, { @"mount:./aa/bb\cc/dd", "WRM", false, 0, Result.Success },

View file

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow> <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
@ -9,11 +9,11 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit.core" Version="2.5.1" /> <PackageReference Include="xunit.core" Version="2.6.2" />
<PackageReference Include="xunit.analyzers" Version="1.3.0" /> <PackageReference Include="xunit.analyzers" Version="1.6.0" />
<PackageReference Include="xunit.assert.source" Version="2.5.1" /> <PackageReference Include="xunit.assert.source" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.1"> <PackageReference Include="xunit.runner.visualstudio" Version="2.5.4">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>