diff --git a/Build/.nuke/build.schema.json b/Build/.nuke/build.schema.json index 3906733..c17becd 100644 --- a/Build/.nuke/build.schema.json +++ b/Build/.nuke/build.schema.json @@ -27,6 +27,7 @@ "Build", "Clean", "Compile", + "GenerateTools", "GitRelease", "Release", "Sign", diff --git a/Build/Build.cs b/Build/Build.cs index 261b091..19ac1c5 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -3,7 +3,7 @@ using ricaun.Nuke; using ricaun.Nuke.Components; -class Build : NukeBuild, IPublish, ITest //,IShowNuGetKeyVaultSign +class Build : NukeBuild, IPublish, ITest, IGenerateTools { string ITest.TestProjectName => "Nuke.NuGetKeyVaultSignTool"; public static int Main() => Execute(x => x.From().Build); diff --git a/Build/Build.csproj b/Build/Build.csproj index c370a1b..b12f505 100644 --- a/Build/Build.csproj +++ b/Build/Build.csproj @@ -11,6 +11,7 @@ + diff --git a/Build/IGenerateTools.cs b/Build/IGenerateTools.cs new file mode 100644 index 0000000..fac86af --- /dev/null +++ b/Build/IGenerateTools.cs @@ -0,0 +1,27 @@ +using Nuke.Common; +using Nuke.Common.IO; +using Nuke.Common.Utilities.Collections; +using ricaun.Nuke.Components; +using static Nuke.CodeGeneration.CodeGenerator; + +using Nuke.Common.Tools.GitHub; + +public interface IGenerateTools : IClean, ICompile, IHazMainProject, IHazGitRepository +{ + AbsolutePath SpecificationsDirectory => MainProject.Directory / "Tools"; + Target GenerateTools => _ => _ + .TriggeredBy(Clean) + .Before(Compile) + .Executes(() => + { + SpecificationsDirectory.GlobFiles("*.json").ForEach(x => + { + Serilog.Log.Information($"GenerateCode: {x.Name}"); + GenerateCode( + x, + namespaceProvider: x => $"Nuke.Common.Tools.{x.Name}", + sourceFileProvider: x => GitRepository.GetGitHubBrowseUrl(x.SpecificationFile) + ); + }); + }); +} diff --git a/Nuke.NuGetKeyVaultSignTool/Tools/NuGetKeyVaultSignTool.Generated.cs b/Nuke.NuGetKeyVaultSignTool/Tools/NuGetKeyVaultSignTool.Generated.cs index 4642711..d2bc1e2 100644 --- a/Nuke.NuGetKeyVaultSignTool/Tools/NuGetKeyVaultSignTool.Generated.cs +++ b/Nuke.NuGetKeyVaultSignTool/Tools/NuGetKeyVaultSignTool.Generated.cs @@ -17,7 +17,7 @@ namespace Nuke.Common.Tools.NuGetKeyVaultSignTool; /// -///

Azure Sign Tool is similar to signtool in the Windows SDK, with the major difference being that it uses Azure Key Vault for performing the signing process. The usage is like signtool, except with a limited set of options for signing and options for authenticating to Azure Key Vault.

+///

NuGet Key Vault Sign Tool is similar to nuget sign, with the major difference being that it uses Azure Key Vault for performing the signing process. Similar usage configuration like AzureSignTool, except is used to sign nuget package.

///

For more details, visit the official website.

///
[PublicAPI] @@ -36,7 +36,7 @@ public partial class NuGetKeyVaultSignToolTasks public static Action NuGetKeyVaultSignToolLogger { get; set; } = ProcessTasks.DefaultLogger; public static Action NuGetKeyVaultSignToolExitHandler { get; set; } = ProcessTasks.DefaultExitHandler; /// - ///

Azure Sign Tool is similar to signtool in the Windows SDK, with the major difference being that it uses Azure Key Vault for performing the signing process. The usage is like signtool, except with a limited set of options for signing and options for authenticating to Azure Key Vault.

+ ///

NuGet Key Vault Sign Tool is similar to nuget sign, with the major difference being that it uses Azure Key Vault for performing the signing process. Similar usage configuration like AzureSignTool, except is used to sign nuget package.

///

For more details, visit the official website.

///
public static IReadOnlyCollection NuGetKeyVaultSignTool(ArgumentStringHandler arguments, string workingDirectory = null, IReadOnlyDictionary environmentVariables = null, int? timeout = null, bool? logOutput = null, bool? logInvocation = null, Action logger = null, Action exitHandler = null) @@ -46,7 +46,7 @@ public static IReadOnlyCollection NuGetKeyVaultSignTool(ArgumentStringHa return process.Output; } /// - ///

Azure Sign Tool is similar to signtool in the Windows SDK, with the major difference being that it uses Azure Key Vault for performing the signing process. The usage is like signtool, except with a limited set of options for signing and options for authenticating to Azure Key Vault.

+ ///

NuGet Key Vault Sign Tool is similar to nuget sign, with the major difference being that it uses Azure Key Vault for performing the signing process. Similar usage configuration like AzureSignTool, except is used to sign nuget package.

///

For more details, visit the official website.

///
/// @@ -75,7 +75,7 @@ public static IReadOnlyCollection NuGetKeyVaultSignTool(NuGetKeyVaultSig return process.Output; } /// - ///

Azure Sign Tool is similar to signtool in the Windows SDK, with the major difference being that it uses Azure Key Vault for performing the signing process. The usage is like signtool, except with a limited set of options for signing and options for authenticating to Azure Key Vault.

+ ///

NuGet Key Vault Sign Tool is similar to nuget sign, with the major difference being that it uses Azure Key Vault for performing the signing process. Similar usage configuration like AzureSignTool, except is used to sign nuget package.

///

For more details, visit the official website.

///
/// @@ -101,7 +101,7 @@ public static IReadOnlyCollection NuGetKeyVaultSignTool(Configure - ///

Azure Sign Tool is similar to signtool in the Windows SDK, with the major difference being that it uses Azure Key Vault for performing the signing process. The usage is like signtool, except with a limited set of options for signing and options for authenticating to Azure Key Vault.

+ ///

NuGet Key Vault Sign Tool is similar to nuget sign, with the major difference being that it uses Azure Key Vault for performing the signing process. Similar usage configuration like AzureSignTool, except is used to sign nuget package.

///

For more details, visit the official website.

/// /// diff --git a/Nuke.NuGetKeyVaultSignTool/Tools/NuGetKeyVaultSignTool.json b/Nuke.NuGetKeyVaultSignTool/Tools/NuGetKeyVaultSignTool.json index 43387bb..7ad5acd 100644 --- a/Nuke.NuGetKeyVaultSignTool/Tools/NuGetKeyVaultSignTool.json +++ b/Nuke.NuGetKeyVaultSignTool/Tools/NuGetKeyVaultSignTool.json @@ -20,12 +20,14 @@ "name": "KeyVaultUrl", "type": "string", "format": "--azure-key-vault-url {value}", + "secret": false, "help": "A fully qualified URL of the key vault with the certificate that will be used for signing. An example value might be https://my-vault.vault.azure.net." }, { "name": "KeyVaultClientId", "type": "string", "format": "--azure-key-vault-client-id {value}", + "secret": false, "help": "This is the client ID used to authenticate to Azure, which will be used to generate an access token. This parameter is not required if an access token is supplied directly with the --azure-key-vault-accesstoken option. If this parameter is supplied, --azure-key-vault-client-secret and --azure-key-vault-tenant-id must be supplied as well." }, { @@ -39,12 +41,14 @@ "name": "KeyVaultTenantId", "type": "string", "format": "--azure-key-vault-tenant-id {value}", + "secret": false, "help": "This is the tenant id used to authenticate to Azure, which will be used to generate an access token. This parameter is not required if an access token is supplied directly with the --azure-key-vault-accesstoken option or when using managed identities with --azure-key-vault-managed-identity. If this parameter is supplied, --azure-key-vault-client-id and --azure-key-vault-client-secret must be supplied as well." }, { "name": "KeyVaultCertificateName", "type": "string", "format": "--azure-key-vault-certificate {value}", + "secret": false, "help": "The name of the certificate used to perform the signing operation." }, { @@ -58,6 +62,7 @@ "name": "KeyVaultManagedIdentity", "type": "bool", "format": "--azure-key-vault-managed-identity", + "secret": false, "help": "Use the ambient Managed Identity to authenticate to Azure. This can be used instead of the --azure-key-vault-accesstoken, --azure-key-vault-client-id and --azure-key-vault-client-secret options. This is useful if NuGetKeyVaultSignTool is being used on a VM/service/CLI that is configured for managed identities to Azure." }, {