Skip to content

Commit

Permalink
add debug
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel committed Jul 22, 2022
1 parent 6c0ecc5 commit 3a2b942
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/AvantiPoint.Nuke.Maui/Windows/WinUIAppSigning.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using AvantiPoint.Nuke.Maui.Tools.DotNet;
using System.Text.Json;
using AvantiPoint.Nuke.Maui.Tools.DotNet;
using Nuke.Common;
using Nuke.Common.IO;
using Nuke.Common.Tooling;
using Nuke.Common.Tools.AzureSignTool;
using Nuke.Common.Tools.DotNet;
using Nuke.Common.Tools.SignTool;
using Nuke.Common.Utilities.Collections;
using Serilog;
using static Nuke.Common.Tools.AzureSignTool.AzureSignToolTasks;
using static Nuke.Common.Tools.SignTool.SignToolTasks;
Expand Down Expand Up @@ -53,7 +55,14 @@ public static bool AzureKeyVaultSign(this IWinUICodeSign codeSign, IEnumerable<s
Assert.True(codeSign.AzureKeyVault.StartsWith("https://"), "The Uri must start with the https protocol");
Assert.True(Uri.TryCreate(codeSign.AzureKeyVault, UriKind.Absolute, out var uri), "The supplied Azure Key Vault is not a valid Uri.");

DotNetToolHelper.EnsureInstalled("AzureSignTool");
var json = File.ReadAllText(codeSign.RootDirectory / "build" / "obj" / "project.assets.json");
var assets = JsonSerializer.Deserialize<ProjectAssets>(json);
Assert.True(assets.Project.Frameworks.ContainsKey("net6.0"), "Expected to find a net6.0 target in the build project.assets.json");

var framework = assets.Project.Frameworks["net6.0"];
framework.DownloadDependencies
.ForEach(x => Log.Information($"Download Dependency: {x.Name} - {x.Version}"));
//DotNetToolHelper.EnsureInstalled("AzureSignTool");

AzureSignTool(_ => _
.SetKeyVaultUrl(codeSign.AzureKeyVault)
Expand All @@ -70,4 +79,9 @@ public static bool AzureKeyVaultSign(this IWinUICodeSign codeSign, IEnumerable<s

return true;
}

record ProjectAssets(Project Project);
record Project(Dictionary<string, Framework> Frameworks);
record Framework(DownloadDependency[] DownloadDependencies);
record DownloadDependency(string Name, string Version);
}

0 comments on commit 3a2b942

Please sign in to comment.