Update build and test dependencies

This commit is contained in:
Alex Barney 2023-10-08 21:03:56 -07:00
parent 8de9980160
commit e7b642380c
9 changed files with 33 additions and 32 deletions

View file

@ -1,7 +1,7 @@
{ {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-04/schema#",
"title": "Build Schema",
"$ref": "#/definitions/build", "$ref": "#/definitions/build",
"title": "Build Schema",
"definitions": { "definitions": {
"build": { "build": {
"type": "object", "type": "object",
@ -133,4 +133,4 @@
} }
} }
} }
} }

View file

@ -1 +1 @@
7.0.401 7.0.402

View file

@ -19,8 +19,6 @@ using Nuke.Common.Tooling;
using Nuke.Common.Tools.DotNet; using Nuke.Common.Tools.DotNet;
using Nuke.Common.Tools.GitVersion; using Nuke.Common.Tools.GitVersion;
using Nuke.Common.Tools.SignTool; using Nuke.Common.Tools.SignTool;
using static Nuke.Common.IO.FileSystemTasks;
using static Nuke.Common.IO.PathConstruction;
using static Nuke.Common.Tools.DotNet.DotNetTasks; using static Nuke.Common.Tools.DotNet.DotNetTasks;
namespace LibHacBuild; namespace LibHacBuild;
@ -99,10 +97,9 @@ partial class Build : NukeBuild
try try
{ {
gitRepository = (GitRepository)new GitRepositoryAttribute().GetValue(null, null); gitRepository = GitRepository.FromLocalDirectory(RootDirectory);
gitVersion = GitVersionTasks.GitVersion(s => s gitVersion = GitVersionTasks.GitVersion(s => s
.SetFramework("net6.0")
.DisableProcessLogOutput()) .DisableProcessLogOutput())
.Result; .Result;
} }
@ -127,7 +124,7 @@ partial class Build : NukeBuild
HasGitDir = true; HasGitDir = true;
if (DateTimeOffset.TryParseExact(gitVersion.CommitDate, "yyyy-MM-dd HH:mm:ss", if (DateTimeOffset.TryParseExact(gitVersion.CommitDate, "yyyy-MM-dd HH:mm:ss",
CultureInfo.InvariantCulture.DateTimeFormat, DateTimeStyles.AssumeUniversal, out DateTimeOffset commitTime)) CultureInfo.InvariantCulture.DateTimeFormat, DateTimeStyles.AssumeUniversal, out DateTimeOffset commitTime))
{ {
CommitTime = commitTime.LocalDateTime; CommitTime = commitTime.LocalDateTime;
} }
@ -179,17 +176,17 @@ partial class Build : NukeBuild
Target Clean => _ => _ Target Clean => _ => _
.Executes(() => .Executes(() =>
{ {
List<string> toDelete = GlobDirectories(SourceDirectory, "**/bin", "**/obj") List<AbsolutePath> toDelete = SourceDirectory.GlobDirectories("**/bin", "**/obj")
.Concat(GlobDirectories(TestsDirectory, "**/bin", "**/obj")).ToList(); .Concat(TestsDirectory.GlobDirectories("**/bin", "**/obj")).ToList();
foreach (string dir in toDelete) foreach (AbsolutePath dir in toDelete)
{ {
DeleteDirectory(dir); dir.DeleteDirectory();
} }
EnsureCleanDirectory(ArtifactsDirectory); ArtifactsDirectory.CreateOrCleanDirectory();
EnsureCleanDirectory(CliCoreDir); CliCoreDir.CreateOrCleanDirectory();
EnsureCleanDirectory(CliNativeDir); CliNativeDir.CreateOrCleanDirectory();
}); });
Target Restore => _ => _ Target Restore => _ => _
@ -293,7 +290,7 @@ partial class Build : NukeBuild
.Concat(Directory.EnumerateFiles(CliCoreDir, "*.dll")) .Concat(Directory.EnumerateFiles(CliCoreDir, "*.dll"))
.ToArray(); .ToArray();
EnsureExistingDirectory(ArtifactsDirectory); ArtifactsDirectory.CreateDirectory();
ZipFiles(CliCoreZip, namesCore, CommitTime); ZipFiles(CliCoreZip, namesCore, CommitTime);
Serilog.Log.Debug($"Created {CliCoreZip}"); Serilog.Log.Debug($"Created {CliCoreZip}");
@ -396,7 +393,7 @@ partial class Build : NukeBuild
ProcessTasks.StartProcess("strip", CliNativeExe).AssertZeroExitCode(); ProcessTasks.StartProcess("strip", CliNativeExe).AssertZeroExitCode();
} }
EnsureExistingDirectory(ArtifactsDirectory); ArtifactsDirectory.CreateOrCleanDirectory();
ZipFile(CliNativeZip, CliNativeExe, $"hactoolnet{NativeProgramExtension}", CommitTime); ZipFile(CliNativeZip, CliNativeExe, $"hactoolnet{NativeProgramExtension}", CommitTime);
Serilog.Log.Debug($"Created {CliNativeZip}"); Serilog.Log.Debug($"Created {CliNativeZip}");

View file

@ -17,7 +17,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Nuke.Common" Version="6.3.0" /> <PackageReference Include="Nuke.Common" Version="7.0.6" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View file

@ -23,7 +23,7 @@ public partial class Build
try try
{ {
EnsureCleanDirectory(tempDir); tempDir.CreateOrCleanDirectory();
List<string> fileList = UnzipPackage(path, tempDir); List<string> fileList = UnzipPackage(path, tempDir);
string newPsmdcpName = CalcPsmdcpName(libDir); string newPsmdcpName = CalcPsmdcpName(libDir);
@ -123,9 +123,7 @@ public partial class Build
public void SignNupkg(string pkgPath, string password) public void SignNupkg(string pkgPath, string password)
{ {
NuGetTasks.NuGet( NuGetTasks.NuGet($"sign \"{pkgPath}\" -CertificatePath cert.pfx -CertificatePassword {password:r} -Timestamper http://timestamp.digicert.com");
$"sign \"{pkgPath}\" -CertificatePath cert.pfx -CertificatePassword {password} -Timestamper http://timestamp.digicert.com",
outputFilter: x => x.Replace(password, "hunter2"));
} }
public static string ToHexString(byte[] arr) public static string ToHexString(byte[] arr)

View file

@ -13,10 +13,13 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageDownload Include="GitVersion.Tool" Version="[5.9.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.4.0" /> <PackageReference Include="NuGet.CommandLine" Version="6.7.0">
<PackageReference Include="Nuke.Common" Version="6.3.0" /> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Nuke.Common" Version="7.0.6" />
<PackageReference Include="SharpZipLib" Version="1.4.2" /> <PackageReference Include="SharpZipLib" Version="1.4.2" />
</ItemGroup> </ItemGroup>

View file

@ -9,11 +9,14 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit.core" Version="2.4.2" /> <PackageReference Include="xunit.core" Version="2.5.1" />
<PackageReference Include="xunit.analyzers" Version="1.1.0" /> <PackageReference Include="xunit.analyzers" Version="1.3.0" />
<PackageReference Include="xunit.assert.source" Version="2.4.2" /> <PackageReference Include="xunit.assert.source" Version="2.5.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" /> <PackageReference Include="xunit.runner.visualstudio" Version="2.5.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View file

@ -19,6 +19,6 @@ public partial class Assert
public static void Result(Result.Base expected, Result actual) public static void Result(Result.Base expected, Result actual)
{ {
if (!expected.Includes(actual)) if (!expected.Includes(actual))
throw new EqualException(expected.Value, actual); throw EqualException.ForMismatchedValues(expected.Value, actual);
} }
} }

View file

@ -16,6 +16,6 @@ public partial class Assert
public static void Equal<T>(ReadOnlySpan<T> expected, ReadOnlySpan<T> actual) where T : unmanaged, IEquatable<T> public static void Equal<T>(ReadOnlySpan<T> expected, ReadOnlySpan<T> actual) where T : unmanaged, IEquatable<T>
{ {
if (!expected.SequenceEqual(actual)) if (!expected.SequenceEqual(actual))
throw new EqualException(expected.ToArray(), actual.ToArray()); throw EqualException.ForMismatchedValues(expected.ToArray(), actual.ToArray());
} }
} }