From c2ca18ecb3ae0584fe5e1022e7a99b7c1184a620 Mon Sep 17 00:00:00 2001 From: Luiz Henrique Cassettari Date: Sat, 4 Jan 2025 09:26:29 -0300 Subject: [PATCH 1/3] Add `DotNet` nuget commands `delete`, `sign` and `verify` --- .../Tools/DotNet/DotNet.Generated.cs | 386 +++++++++++++++++- source/Nuke.Common/Tools/DotNet/DotNet.json | 197 +++++++++ 2 files changed, 582 insertions(+), 1 deletion(-) diff --git a/source/Nuke.Common/Tools/DotNet/DotNet.Generated.cs b/source/Nuke.Common/Tools/DotNet/DotNet.Generated.cs index 5bacfe12d..966e15a50 100644 --- a/source/Nuke.Common/Tools/DotNet/DotNet.Generated.cs +++ b/source/Nuke.Common/Tools/DotNet/DotNet.Generated.cs @@ -1,4 +1,4 @@ -// Generated from https://github.com/nuke-build/nuke/blob/master/source/Nuke.Common/Tools/DotNet/DotNet.json +// Generated from https://github.com/nuke-build/nuke/blob/master/source/Nuke.Common/Tools/DotNet/DotNet.json using JetBrains.Annotations; using Newtonsoft.Json; @@ -97,6 +97,27 @@ public partial class DotNetTasks : ToolTasks, IRequirePathTool public static IReadOnlyCollection DotNetNuGetPush(Configure configurator) => new DotNetTasks().Run(configurator.Invoke(new DotNetNuGetPushSettings())); /// public static IEnumerable<(DotNetNuGetPushSettings Settings, IReadOnlyCollection Output)> DotNetNuGetPush(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) => configurator.Invoke(DotNetNuGetPush, degreeOfParallelism, completeOnFailure); + ///

The dotnet nuget delete command deletes or unlists a package from the server. For nuget.org, the action is to unlist the package.

For more details, visit the official website.

+ ///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

  • <packageId> via
  • <packageVersion> via
  • --api-key via
  • --force-english-output via
  • --interactive via
  • --no-service-endpoint via
  • --non-interactive via
  • --source via
+ public static IReadOnlyCollection DotNetNuGetDelete(DotNetNuGetDeleteSettings options = null) => new DotNetTasks().Run(options); + /// + public static IReadOnlyCollection DotNetNuGetDelete(Configure configurator) => new DotNetTasks().Run(configurator.Invoke(new DotNetNuGetDeleteSettings())); + /// + public static IEnumerable<(DotNetNuGetDeleteSettings Settings, IReadOnlyCollection Output)> DotNetNuGetDelete(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) => configurator.Invoke(DotNetNuGetDelete, degreeOfParallelism, completeOnFailure); + ///

The dotnet nuget sign command signs all the packages matching the first argument with a certificate. The certificate with the private key can be obtained from a file or from a certificate installed in a certificate store by providing a subject name or a SHA-1 fingerprint.

For more details, visit the official website.

+ ///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

  • <targetPath> via
  • --certificate-fingerprint via
  • --certificate-password via
  • --certificate-path via
  • --certificate-store-location via
  • --certificate-store-name via
  • --certificate-subject-name via
  • --hash-algorithm via
  • --output via
  • --overwrite via
  • --timestamp-hash-algorithm via
  • --timestamper via
  • --verbosity via
+ public static IReadOnlyCollection DotNetNuGetSign(DotNetNuGetSignSettings options = null) => new DotNetTasks().Run(options); + /// + public static IReadOnlyCollection DotNetNuGetSign(Configure configurator) => new DotNetTasks().Run(configurator.Invoke(new DotNetNuGetSignSettings())); + /// + public static IEnumerable<(DotNetNuGetSignSettings Settings, IReadOnlyCollection Output)> DotNetNuGetSign(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) => configurator.Invoke(DotNetNuGetSign, degreeOfParallelism, completeOnFailure); + ///

The dotnet nuget verify command verifies a signed NuGet package.

For more details, visit the official website.

+ ///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

  • <targetPath> via
  • --certificate-fingerprint via
  • --configfile via
  • --verbosity via
+ public static IReadOnlyCollection DotNetNuGetVerify(DotNetNuGetVerifySettings options = null) => new DotNetTasks().Run(options); + /// + public static IReadOnlyCollection DotNetNuGetVerify(Configure configurator) => new DotNetTasks().Run(configurator.Invoke(new DotNetNuGetVerifySettings())); + /// + public static IEnumerable<(DotNetNuGetVerifySettings Settings, IReadOnlyCollection Output)> DotNetNuGetVerify(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) => configurator.Invoke(DotNetNuGetVerify, degreeOfParallelism, completeOnFailure); ///

Adds a NuGet source.

For more details, visit the official website.

///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

  • <source> via
  • --configfile via
  • --name via
  • --password via
  • --store-password-in-clear-text via
  • --username via
  • --valid-authentication-types via
public static IReadOnlyCollection DotNetNuGetAddSource(DotNetNuGetAddSourceSettings options = null) => new DotNetTasks().Run(options); @@ -669,6 +690,83 @@ public partial class DotNetNuGetPushSettings : ToolOptions [Argument(Format = "--no-service-endpoint")] public bool? NoServiceEndpoint => Get(() => NoServiceEndpoint); } #endregion +#region DotNetNuGetDeleteSettings +/// +[PublicAPI] +[ExcludeFromCodeCoverage] +[Command(Type = typeof(DotNetTasks), Command = nameof(DotNetTasks.DotNetNuGetDelete), Arguments = "nuget delete")] +public partial class DotNetNuGetDeleteSettings : ToolOptions +{ + /// Package Id to delete. The exact behavior depends on the source. For local folders, for instance, the package is deleted; for nuget.org the package is unlisted. + [Argument(Format = "{value}", Position = 1)] public string PackageId => Get(() => PackageId); + /// Package Version to delete. The exact behavior depends on the source. For local folders, for instance, the package is deleted; for nuget.org the package is unlisted. + [Argument(Format = "{value}", Position = 2)] public string PackageVersion => Get(() => PackageVersion); + /// Specifies the server URL. This option is required unless DefaultPushSource config value is set in the NuGet config file. + [Argument(Format = "--source {value}")] public string Source => Get(() => Source); + /// The API key for the server. + [Argument(Format = "--api-key {value}", Secret = true)] public string ApiKey => Get(() => ApiKey); + /// Forces all logged output in English. + [Argument(Format = "--force-english-output")] public bool? ForceEnglishOutput => Get(() => ForceEnglishOutput); + /// Doesn't append api/v2/package to the source URL. Option available since .NET Core 2.1 SDK. + [Argument(Format = "--no-service-endpoint")] public bool? NoServiceEndpoint => Get(() => NoServiceEndpoint); + /// Allows the command to stop and wait for user input or action. For example, to complete authentication. Available since .NET Core 3.0 SDK. + [Argument(Format = "--interactive")] public bool? Interactive => Get(() => Interactive); + /// Doesn't prompt for user input or confirmations. + [Argument(Format = "--non-interactive")] public bool? NonInteractive => Get(() => NonInteractive); +} +#endregion +#region DotNetNuGetSignSettings +/// +[PublicAPI] +[ExcludeFromCodeCoverage] +[Command(Type = typeof(DotNetTasks), Command = nameof(DotNetTasks.DotNetNuGetSign), Arguments = "nuget sign")] +public partial class DotNetNuGetSignSettings : ToolOptions +{ + /// Path of the package to sign. + [Argument(Format = "{value}", Position = 1)] public string TargetPath => Get(() => TargetPath); + /// Specifies the file path to the certificate to be used in signing the package. + [Argument(Format = "--certificate-path {value}")] public string CertificatePath => Get(() => CertificatePath); + /// Specifies the name of the X.509 certificate store to use to search for the certificate. Defaults to 'My', the X.509 certificate store for personal certificates. This option should be used when specifying the certificate via --certificate-subject-name or --certificate-fingerprint options. + [Argument(Format = "--certificate-store-name {value}")] public string CertificateStoreName => Get(() => CertificateStoreName); + /// Specifies the name of the X.509 certificate store use to search for the certificate. Defaults to 'CurrentUser', the X.509 certificate store used by the current user. This option should be used when specifying the certificate via --certificate-subject-name or --certificate-fingerprint options. + [Argument(Format = "--certificate-store-location {value}")] public string CertificateStoreLocation => Get(() => CertificateStoreLocation); + /// Specifies the subject name of the certificate used to search a local certificate store for the certificate. The search is a case-insensitive string comparison using the supplied value, which finds all certificates with the subject name containing that string, regardless of other subject values. The certificate store can be specified by --certificate-store-name and --certificate-store-location options. + [Argument(Format = "--certificate-subject-name {value}")] public string CertificateSubjectName => Get(() => CertificateSubjectName); + /// Specifies the fingerprint of the certificate used to search a local certificate store for the certificate. Starting with .NET 9, this option can be used to specify the SHA-1, SHA-256, SHA-384, or SHA-512 fingerprint of the certificate. However, a NU3043 warning is raised when a SHA-1 certificate fingerprint is used because it is no longer considered secure. + [Argument(Format = "--certificate-fingerprint {value}")] public string CertificateFingerprint => Get(() => CertificateFingerprint); + /// Specifies the certificate password, if needed. If a certificate is password protected but no password is provided, the sign command will fail. + [Argument(Format = "--certificate-password {value}", Secret = true)] public string CertificatePassword => Get(() => CertificatePassword); + /// Hash algorithm to be used to sign the package. Defaults to SHA256. Possible values are SHA256, SHA384, and SHA512. + [Argument(Format = "--hash-algorithm {value}")] public DotNetNuGetSignHashAlgorithm HashAlgorithm => Get(() => HashAlgorithm); + /// Specifies the directory where the signed package should be saved. If this option isn't specified, by default the original package is overwritten by the signed package. + [Argument(Format = "--output {value}")] public string Output => Get(() => Output); + /// Indicate that the current signature should be overwritten. By default the command will fail if the package already has a signature. + [Argument(Format = "--overwrite")] public bool? Overwrite => Get(() => Overwrite); + /// Hash algorithm to be used by the RFC 3161 timestamp server. Defaults to SHA256. + [Argument(Format = "--timestamp-hash-algorithm {value}")] public DotNetNuGetSignHashAlgorithm TimestampHashAlgorithm => Get(() => TimestampHashAlgorithm); + /// URL to an RFC 3161 timestamping server. + [Argument(Format = "--timestamper {value}")] public string Timestamper => Get(() => Timestamper); + /// Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + [Argument(Format = "--verbosity {value}")] public DotNetVerbosity Verbosity => Get(() => Verbosity); +} +#endregion +#region DotNetNuGetVerifySettings +/// +[PublicAPI] +[ExcludeFromCodeCoverage] +[Command(Type = typeof(DotNetTasks), Command = nameof(DotNetTasks.DotNetNuGetVerify), Arguments = "nuget verify")] +public partial class DotNetNuGetVerifySettings : ToolOptions +{ + /// Path of the package to verify. + [Argument(Format = "{value}", Position = 1)] public string TargetPath => Get(() => TargetPath); + /// Verify that the signer certificate matches with one of the specified SHA256 fingerprints. This option can be supplied multiple times to provide multiple fingerprints. + [Argument(Format = "--certificate-fingerprint {value}")] public string CertificateFingerprint => Get(() => CertificateFingerprint); + /// The NuGet configuration file (nuget.config) to use. + [Argument(Format = "--configfile {value}")] public string ConfigFile => Get(() => ConfigFile); + /// Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + [Argument(Format = "--verbosity {value}")] public DotNetVerbosity Verbosity => Get(() => Verbosity); +} +#endregion #region DotNetNuGetAddSourceSettings /// [PublicAPI] @@ -6953,6 +7051,275 @@ [Pure] [Builder(Type = typeof(DotNetNuGetPushSettings), Property = nameof(DotNet #endregion } #endregion +#region DotNetNuGetDeleteSettingsExtensions +/// +[PublicAPI] +[ExcludeFromCodeCoverage] +public static partial class DotNetNuGetDeleteSettingsExtensions +{ + #region PackageId + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.PackageId))] + public static T SetPackageId(this T o, string v) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.PackageId, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.PackageId))] + public static T ResetPackageId(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Remove(() => o.PackageId)); + #endregion + #region PackageVersion + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.PackageVersion))] + public static T SetPackageVersion(this T o, string v) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.PackageVersion, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.PackageVersion))] + public static T ResetPackageVersion(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Remove(() => o.PackageVersion)); + #endregion + #region Source + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.Source))] + public static T SetSource(this T o, string v) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.Source, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.Source))] + public static T ResetSource(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Remove(() => o.Source)); + #endregion + #region ApiKey + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.ApiKey))] + public static T SetApiKey(this T o, [Secret] string v) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.ApiKey, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.ApiKey))] + public static T ResetApiKey(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Remove(() => o.ApiKey)); + #endregion + #region ForceEnglishOutput + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.ForceEnglishOutput))] + public static T SetForceEnglishOutput(this T o, bool? v) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.ForceEnglishOutput))] + public static T ResetForceEnglishOutput(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Remove(() => o.ForceEnglishOutput)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.ForceEnglishOutput))] + public static T EnableForceEnglishOutput(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, true)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.ForceEnglishOutput))] + public static T DisableForceEnglishOutput(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, false)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.ForceEnglishOutput))] + public static T ToggleForceEnglishOutput(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, !o.ForceEnglishOutput)); + #endregion + #region NoServiceEndpoint + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.NoServiceEndpoint))] + public static T SetNoServiceEndpoint(this T o, bool? v) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.NoServiceEndpoint, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.NoServiceEndpoint))] + public static T ResetNoServiceEndpoint(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Remove(() => o.NoServiceEndpoint)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.NoServiceEndpoint))] + public static T EnableNoServiceEndpoint(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.NoServiceEndpoint, true)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.NoServiceEndpoint))] + public static T DisableNoServiceEndpoint(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.NoServiceEndpoint, false)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.NoServiceEndpoint))] + public static T ToggleNoServiceEndpoint(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.NoServiceEndpoint, !o.NoServiceEndpoint)); + #endregion + #region Interactive + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.Interactive))] + public static T SetInteractive(this T o, bool? v) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.Interactive, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.Interactive))] + public static T ResetInteractive(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Remove(() => o.Interactive)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.Interactive))] + public static T EnableInteractive(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.Interactive, true)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.Interactive))] + public static T DisableInteractive(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.Interactive, false)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.Interactive))] + public static T ToggleInteractive(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.Interactive, !o.Interactive)); + #endregion + #region NonInteractive + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.NonInteractive))] + public static T SetNonInteractive(this T o, bool? v) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.NonInteractive, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.NonInteractive))] + public static T ResetNonInteractive(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Remove(() => o.NonInteractive)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.NonInteractive))] + public static T EnableNonInteractive(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.NonInteractive, true)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.NonInteractive))] + public static T DisableNonInteractive(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.NonInteractive, false)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.NonInteractive))] + public static T ToggleNonInteractive(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.NonInteractive, !o.NonInteractive)); + #endregion +} +#endregion +#region DotNetNuGetSignSettingsExtensions +/// +[PublicAPI] +[ExcludeFromCodeCoverage] +public static partial class DotNetNuGetSignSettingsExtensions +{ + #region TargetPath + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.TargetPath))] + public static T SetTargetPath(this T o, string v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.TargetPath, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.TargetPath))] + public static T ResetTargetPath(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.TargetPath)); + #endregion + #region CertificatePath + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificatePath))] + public static T SetCertificatePath(this T o, string v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.CertificatePath, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificatePath))] + public static T ResetCertificatePath(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificatePath)); + #endregion + #region CertificateStoreName + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificateStoreName))] + public static T SetCertificateStoreName(this T o, string v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.CertificateStoreName, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificateStoreName))] + public static T ResetCertificateStoreName(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificateStoreName)); + #endregion + #region CertificateStoreLocation + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificateStoreLocation))] + public static T SetCertificateStoreLocation(this T o, string v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.CertificateStoreLocation, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificateStoreLocation))] + public static T ResetCertificateStoreLocation(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificateStoreLocation)); + #endregion + #region CertificateSubjectName + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificateSubjectName))] + public static T SetCertificateSubjectName(this T o, string v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.CertificateSubjectName, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificateSubjectName))] + public static T ResetCertificateSubjectName(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificateSubjectName)); + #endregion + #region CertificateFingerprint + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificateFingerprint))] + public static T SetCertificateFingerprint(this T o, string v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.CertificateFingerprint, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificateFingerprint))] + public static T ResetCertificateFingerprint(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificateFingerprint)); + #endregion + #region CertificatePassword + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificatePassword))] + public static T SetCertificatePassword(this T o, [Secret] string v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.CertificatePassword, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificatePassword))] + public static T ResetCertificatePassword(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificatePassword)); + #endregion + #region HashAlgorithm + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.HashAlgorithm))] + public static T SetHashAlgorithm(this T o, DotNetNuGetSignHashAlgorithm v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.HashAlgorithm, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.HashAlgorithm))] + public static T ResetHashAlgorithm(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.HashAlgorithm)); + #endregion + #region Output + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Output))] + public static T SetOutput(this T o, string v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.Output, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Output))] + public static T ResetOutput(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.Output)); + #endregion + #region Overwrite + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Overwrite))] + public static T SetOverwrite(this T o, bool? v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.Overwrite, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Overwrite))] + public static T ResetOverwrite(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.Overwrite)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Overwrite))] + public static T EnableOverwrite(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.Overwrite, true)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Overwrite))] + public static T DisableOverwrite(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.Overwrite, false)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Overwrite))] + public static T ToggleOverwrite(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.Overwrite, !o.Overwrite)); + #endregion + #region TimestampHashAlgorithm + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.TimestampHashAlgorithm))] + public static T SetTimestampHashAlgorithm(this T o, DotNetNuGetSignHashAlgorithm v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.TimestampHashAlgorithm, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.TimestampHashAlgorithm))] + public static T ResetTimestampHashAlgorithm(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.TimestampHashAlgorithm)); + #endregion + #region Timestamper + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Timestamper))] + public static T SetTimestamper(this T o, string v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.Timestamper, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Timestamper))] + public static T ResetTimestamper(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.Timestamper)); + #endregion + #region Verbosity + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Verbosity))] + public static T SetVerbosity(this T o, DotNetVerbosity v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.Verbosity, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Verbosity))] + public static T ResetVerbosity(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.Verbosity)); + #endregion +} +#endregion +#region DotNetNuGetVerifySettingsExtensions +/// +[PublicAPI] +[ExcludeFromCodeCoverage] +public static partial class DotNetNuGetVerifySettingsExtensions +{ + #region TargetPath + /// + [Pure] [Builder(Type = typeof(DotNetNuGetVerifySettings), Property = nameof(DotNetNuGetVerifySettings.TargetPath))] + public static T SetTargetPath(this T o, string v) where T : DotNetNuGetVerifySettings => o.Modify(b => b.Set(() => o.TargetPath, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetVerifySettings), Property = nameof(DotNetNuGetVerifySettings.TargetPath))] + public static T ResetTargetPath(this T o) where T : DotNetNuGetVerifySettings => o.Modify(b => b.Remove(() => o.TargetPath)); + #endregion + #region CertificateFingerprint + /// + [Pure] [Builder(Type = typeof(DotNetNuGetVerifySettings), Property = nameof(DotNetNuGetVerifySettings.CertificateFingerprint))] + public static T SetCertificateFingerprint(this T o, string v) where T : DotNetNuGetVerifySettings => o.Modify(b => b.Set(() => o.CertificateFingerprint, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetVerifySettings), Property = nameof(DotNetNuGetVerifySettings.CertificateFingerprint))] + public static T ResetCertificateFingerprint(this T o) where T : DotNetNuGetVerifySettings => o.Modify(b => b.Remove(() => o.CertificateFingerprint)); + #endregion + #region ConfigFile + /// + [Pure] [Builder(Type = typeof(DotNetNuGetVerifySettings), Property = nameof(DotNetNuGetVerifySettings.ConfigFile))] + public static T SetConfigFile(this T o, string v) where T : DotNetNuGetVerifySettings => o.Modify(b => b.Set(() => o.ConfigFile, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetVerifySettings), Property = nameof(DotNetNuGetVerifySettings.ConfigFile))] + public static T ResetConfigFile(this T o) where T : DotNetNuGetVerifySettings => o.Modify(b => b.Remove(() => o.ConfigFile)); + #endregion + #region Verbosity + /// + [Pure] [Builder(Type = typeof(DotNetNuGetVerifySettings), Property = nameof(DotNetNuGetVerifySettings.Verbosity))] + public static T SetVerbosity(this T o, DotNetVerbosity v) where T : DotNetNuGetVerifySettings => o.Modify(b => b.Set(() => o.Verbosity, v)); + /// + [Pure] [Builder(Type = typeof(DotNetNuGetVerifySettings), Property = nameof(DotNetNuGetVerifySettings.Verbosity))] + public static T ResetVerbosity(this T o) where T : DotNetNuGetVerifySettings => o.Modify(b => b.Remove(() => o.Verbosity)); + #endregion +} +#endregion #region DotNetNuGetAddSourceSettingsExtensions /// [PublicAPI] @@ -8254,3 +8621,20 @@ public static implicit operator DotNetFormatSeverity(string value) } } #endregion +#region DotNetNuGetSignHashAlgorithm +/// Used within . +[PublicAPI] +[Serializable] +[ExcludeFromCodeCoverage] +[TypeConverter(typeof(TypeConverter))] +public partial class DotNetNuGetSignHashAlgorithm : Enumeration +{ + public static DotNetNuGetSignHashAlgorithm sha256 = (DotNetNuGetSignHashAlgorithm) "sha256"; + public static DotNetNuGetSignHashAlgorithm sha384 = (DotNetNuGetSignHashAlgorithm) "sha384"; + public static DotNetNuGetSignHashAlgorithm sha512 = (DotNetNuGetSignHashAlgorithm) "sha512"; + public static implicit operator DotNetNuGetSignHashAlgorithm(string value) + { + return new DotNetNuGetSignHashAlgorithm { Value = value }; + } +} +#endregion diff --git a/source/Nuke.Common/Tools/DotNet/DotNet.json b/source/Nuke.Common/Tools/DotNet/DotNet.json index 81dfb1cff..09aa008cf 100644 --- a/source/Nuke.Common/Tools/DotNet/DotNet.json +++ b/source/Nuke.Common/Tools/DotNet/DotNet.json @@ -9,6 +9,9 @@ "https://raw.githubusercontent.com/dotnet/docs/main/docs/core/tools/dotnet-clean.md", "https://raw.githubusercontent.com/dotnet/docs/main/docs/core/tools/dotnet-publish.md", "https://raw.githubusercontent.com/dotnet/docs/main/docs/core/tools/dotnet-nuget-push.md", + "https://raw.githubusercontent.com/dotnet/docs/main/docs/core/tools/dotnet-nuget-delete.md", + "https://raw.githubusercontent.com/dotnet/docs/main/docs/core/tools/dotnet-nuget-sign.md", + "https://raw.githubusercontent.com/dotnet/docs/main/docs/core/tools/dotnet-nuget-verify.md", "https://raw.githubusercontent.com/dotnet/docs/main/docs/core/tools/dotnet-tool-install.md", "https://raw.githubusercontent.com/dotnet/docs/main/docs/core/tools/dotnet-tool-uninstall.md", "https://raw.githubusercontent.com/dotnet/docs/main/docs/core/tools/dotnet-tool-update.md", @@ -1058,6 +1061,192 @@ ] } }, + { + "help": "The dotnet nuget delete command deletes or unlists a package from the server. For nuget.org, the action is to unlist the package.", + "postfix": "NuGetDelete", + "omitCommonProperties": true, + "definiteArgument": "nuget delete", + "settingsClass": { + "properties": [ + { + "name": "PackageId", + "type": "string", + "format": "{value}", + "position": 1, + "help": "Package Id to delete. The exact behavior depends on the source. For local folders, for instance, the package is deleted; for nuget.org the package is unlisted." + }, + { + "name": "PackageVersion", + "type": "string", + "format": "{value}", + "position": 2, + "help": "Package Version to delete. The exact behavior depends on the source. For local folders, for instance, the package is deleted; for nuget.org the package is unlisted." + }, + { + "name": "Source", + "type": "string", + "format": "--source {value}", + "help": "Specifies the server URL. This option is required unless DefaultPushSource config value is set in the NuGet config file." + }, + { + "name": "ApiKey", + "type": "string", + "format": "--api-key {value}", + "secret": true, + "help": "The API key for the server." + }, + { + "name": "ForceEnglishOutput", + "type": "bool", + "format": "--force-english-output", + "help": "Forces all logged output in English." + }, + { + "name": "NoServiceEndpoint", + "type": "bool", + "format": "--no-service-endpoint", + "help": "Doesn't append api/v2/package to the source URL. Option available since .NET Core 2.1 SDK." + }, + { + "name": "Interactive", + "type": "bool", + "format": "--interactive", + "help": "Allows the command to stop and wait for user input or action. For example, to complete authentication. Available since .NET Core 3.0 SDK." + }, + { + "name": "NonInteractive", + "type": "bool", + "format": "--non-interactive", + "help": "Doesn't prompt for user input or confirmations." + } + ] + } + }, + { + "help": "The dotnet nuget sign command signs all the packages matching the first argument with a certificate. The certificate with the private key can be obtained from a file or from a certificate installed in a certificate store by providing a subject name or a SHA-1 fingerprint.", + "postfix": "NuGetSign", + "omitCommonProperties": true, + "definiteArgument": "nuget sign", + "settingsClass": { + "properties": [ + { + "name": "TargetPath", + "type": "string", + "format": "{value}", + "position": 1, + "help": "Path of the package to sign." + }, + { + "name": "CertificatePath", + "type": "string", + "format": "--certificate-path {value}", + "help": "Specifies the file path to the certificate to be used in signing the package." + }, + { + "name": "CertificateStoreName", + "type": "string", + "format": "--certificate-store-name {value}", + "help": "Specifies the name of the X.509 certificate store to use to search for the certificate. Defaults to 'My', the X.509 certificate store for personal certificates. This option should be used when specifying the certificate via --certificate-subject-name or --certificate-fingerprint options." + }, + { + "name": "CertificateStoreLocation", + "type": "string", + "format": "--certificate-store-location {value}", + "help": "Specifies the name of the X.509 certificate store use to search for the certificate. Defaults to 'CurrentUser', the X.509 certificate store used by the current user. This option should be used when specifying the certificate via --certificate-subject-name or --certificate-fingerprint options." + }, + { + "name": "CertificateSubjectName", + "type": "string", + "format": "--certificate-subject-name {value}", + "help": "Specifies the subject name of the certificate used to search a local certificate store for the certificate. The search is a case-insensitive string comparison using the supplied value, which finds all certificates with the subject name containing that string, regardless of other subject values. The certificate store can be specified by --certificate-store-name and --certificate-store-location options." + }, + { + "name": "CertificateFingerprint", + "type": "string", + "format": "--certificate-fingerprint {value}", + "help": "Specifies the fingerprint of the certificate used to search a local certificate store for the certificate. Starting with .NET 9, this option can be used to specify the SHA-1, SHA-256, SHA-384, or SHA-512 fingerprint of the certificate. However, a NU3043 warning is raised when a SHA-1 certificate fingerprint is used because it is no longer considered secure." + }, + { + "name": "CertificatePassword", + "type": "string", + "format": "--certificate-password {value}", + "secret": true, + "help": "Specifies the certificate password, if needed. If a certificate is password protected but no password is provided, the sign command will fail." + }, + { + "name": "HashAlgorithm", + "type": "DotNetNuGetSignHashAlgorithm", + "format": "--hash-algorithm {value}", + "help": "Hash algorithm to be used to sign the package. Defaults to SHA256. Possible values are SHA256, SHA384, and SHA512." + }, + { + "name": "Output", + "type": "string", + "format": "--output {value}", + "help": "Specifies the directory where the signed package should be saved. If this option isn't specified, by default the original package is overwritten by the signed package." + }, + { + "name": "Overwrite", + "type": "bool", + "format": "--overwrite", + "help": "Indicate that the current signature should be overwritten. By default the command will fail if the package already has a signature." + }, + { + "name": "TimestampHashAlgorithm", + "type": "DotNetNuGetSignHashAlgorithm", + "format": "--timestamp-hash-algorithm {value}", + "help": "Hash algorithm to be used by the RFC 3161 timestamp server. Defaults to SHA256." + }, + { + "name": "Timestamper", + "type": "string", + "format": "--timestamper {value}", + "help": "URL to an RFC 3161 timestamping server." + }, + { + "name": "Verbosity", + "type": "DotNetVerbosity", + "format": "--verbosity {value}", + "help": "Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]." + } + ] + } + }, + { + "help": "The dotnet nuget verify command verifies a signed NuGet package.", + "postfix": "NuGetVerify", + "omitCommonProperties": true, + "definiteArgument": "nuget verify", + "settingsClass": { + "properties": [ + { + "name": "TargetPath", + "type": "string", + "format": "{value}", + "position": 1, + "help": "Path of the package to verify." + }, + { + "name": "CertificateFingerprint", + "type": "string", + "format": "--certificate-fingerprint {value}", + "help": "Verify that the signer certificate matches with one of the specified SHA256 fingerprints. This option can be supplied multiple times to provide multiple fingerprints." + }, + { + "name": "ConfigFile", + "type": "string", + "format": "--configfile {value}", + "help": "The NuGet configuration file (nuget.config) to use." + }, + { + "name": "Verbosity", + "type": "DotNetVerbosity", + "format": "--verbosity {value}", + "help": "Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]." + } + ] + } + }, { "help": "Adds a NuGet source.", "postfix": "NuGetAddSource", @@ -1968,6 +2157,14 @@ "warn", "error" ] + }, + { + "name": "DotNetNuGetSignHashAlgorithm", + "values": [ + "sha256", + "sha384", + "sha512" + ] } ] } From 7d7e6f154006063212b0db71f854503096a6f4d0 Mon Sep 17 00:00:00 2001 From: Luiz Henrique Cassettari Date: Sat, 4 Jan 2025 09:35:15 -0300 Subject: [PATCH 2/3] Add `NuGet` commands `delete`, `sign` and `verify`. --- .../Tools/NuGet/NuGet.Generated.cs | 473 +++++++++++++++++- source/Nuke.Common/Tools/NuGet/NuGet.json | 224 +++++++++ 2 files changed, 696 insertions(+), 1 deletion(-) diff --git a/source/Nuke.Common/Tools/NuGet/NuGet.Generated.cs b/source/Nuke.Common/Tools/NuGet/NuGet.Generated.cs index c1f303036..61db08932 100644 --- a/source/Nuke.Common/Tools/NuGet/NuGet.Generated.cs +++ b/source/Nuke.Common/Tools/NuGet/NuGet.Generated.cs @@ -1,4 +1,4 @@ -// Generated from https://github.com/nuke-build/nuke/blob/master/source/Nuke.Common/Tools/NuGet/NuGet.json +// Generated from https://github.com/nuke-build/nuke/blob/master/source/Nuke.Common/Tools/NuGet/NuGet.json using JetBrains.Annotations; using Newtonsoft.Json; @@ -36,6 +36,27 @@ public partial class NuGetTasks : ToolTasks, IRequireNuGetPackage /// public static IEnumerable<(NuGetPushSettings Settings, IReadOnlyCollection Output)> NuGetPush(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) => configurator.Invoke(NuGetPush, degreeOfParallelism, completeOnFailure); ///

The NuGet Command Line Interface (CLI) provides the full extent of NuGet functionality to install, create, publish, and manage packages.

For more details, visit the official website.

+ ///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

  • <packageId> via
  • <packageVersion> via
  • -ApiKey via
  • -ConfigFile via
  • -ForceEnglishOutput via
  • -NonInteractive via
  • -NoPrompt via
  • -Source via
  • -Verbosity via
+ public static IReadOnlyCollection NuGetDelete(NuGetDeleteSettings options = null) => new NuGetTasks().Run(options); + /// + public static IReadOnlyCollection NuGetDelete(Configure configurator) => new NuGetTasks().Run(configurator.Invoke(new NuGetDeleteSettings())); + /// + public static IEnumerable<(NuGetDeleteSettings Settings, IReadOnlyCollection Output)> NuGetDelete(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) => configurator.Invoke(NuGetDelete, degreeOfParallelism, completeOnFailure); + ///

The NuGet Command Line Interface (CLI) provides the full extent of NuGet functionality to install, create, publish, and manage packages.

For more details, visit the official website.

+ ///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

  • <targetPath> via
  • -CertificateFingerprint via
  • -CertificatePassword via
  • -CertificatePath via
  • -CertificateStoreLocation via
  • -CertificateStoreName via
  • -CertificateSubjectName via
  • -ConfigFile via
  • -ForceEnglishOutput via
  • -HashAlgorithm via
  • -NonInteractive via
  • -OutputDirectory via
  • -Overwrite via
  • -Timestamper via
  • -TimestampHashAlgorithm via
  • -Verbosity via
+ public static IReadOnlyCollection NuGetSign(NuGetSignSettings options = null) => new NuGetTasks().Run(options); + /// + public static IReadOnlyCollection NuGetSign(Configure configurator) => new NuGetTasks().Run(configurator.Invoke(new NuGetSignSettings())); + /// + public static IEnumerable<(NuGetSignSettings Settings, IReadOnlyCollection Output)> NuGetSign(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) => configurator.Invoke(NuGetSign, degreeOfParallelism, completeOnFailure); + ///

The NuGet Command Line Interface (CLI) provides the full extent of NuGet functionality to install, create, publish, and manage packages.

For more details, visit the official website.

+ ///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

  • -CertificateFingerprint via
  • -ConfigFile via
  • -ForceEnglishOutput via
  • -NonInteractive via
  • -Signatures via
  • -Verbosity via
+ public static IReadOnlyCollection NuGetVerify(NuGetVerifySettings options = null) => new NuGetTasks().Run(options); + /// + public static IReadOnlyCollection NuGetVerify(Configure configurator) => new NuGetTasks().Run(configurator.Invoke(new NuGetVerifySettings())); + /// + public static IEnumerable<(NuGetVerifySettings Settings, IReadOnlyCollection Output)> NuGetVerify(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) => configurator.Invoke(NuGetVerify, degreeOfParallelism, completeOnFailure); + ///

The NuGet Command Line Interface (CLI) provides the full extent of NuGet functionality to install, create, publish, and manage packages.

For more details, visit the official website.

///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

  • <targetPath> via
  • -BasePath via
  • -Build via
  • -Exclude via
  • -ExcludeEmptyDirectories via
  • -ForceEnglishOutput via
  • -IncludeReferencedProjects via
  • -MinClientVersion via
  • -MSBuildPath via
  • -MSBuildVersion via
  • -NoDefaultExcludes via
  • -NoPackageAnalysis via
  • -OutputDirectory via
  • -Properties via
  • -Suffix via
  • -SymbolPackageFormat via
  • -Symbols via
  • -Tool via
  • -Verbosity via
  • -Version via
public static IReadOnlyCollection NuGetPack(NuGetPackSettings options = null) => new NuGetTasks().Run(options); /// @@ -132,6 +153,95 @@ public partial class NuGetPushSettings : ToolOptions [Argument(Format = "-Timeout {value}")] public int? Timeout => Get(() => Timeout); } #endregion +#region NuGetDeleteSettings +/// +[PublicAPI] +[ExcludeFromCodeCoverage] +[Command(Type = typeof(NuGetTasks), Command = nameof(NuGetTasks.NuGetDelete), Arguments = "delete")] +public partial class NuGetDeleteSettings : ToolOptions +{ + /// Package Id to delete. The exact behavior depends on the source. For local folders, for instance, the package is deleted; for nuget.org the package is unlisted. + [Argument(Format = "{value}", Position = 1)] public string PackageId => Get(() => PackageId); + /// Package Version to delete. The exact behavior depends on the source. For local folders, for instance, the package is deleted; for nuget.org the package is unlisted. + [Argument(Format = "{value}", Position = 2)] public string PackageVersion => Get(() => PackageVersion); + /// The API key for the target repository. If not present, the one specified in %AppData%\NuGet\NuGet.Config is used. + [Argument(Format = "-ApiKey {value}", Secret = true)] public string ApiKey => Get(() => ApiKey); + /// The NuGet configuration file to apply. If not specified, %AppData%\NuGet\NuGet.Config (Windows) or ~/.nuget/NuGet/NuGet.Config (Mac/Linux) is used. + [Argument(Format = "-ConfigFile {value}")] public string ConfigFile => Get(() => ConfigFile); + /// (3.5+) Forces nuget.exe to run using an invariant, English-based culture. + [Argument(Format = "-ForceEnglishOutput")] public bool? ForceEnglishOutput => Get(() => ForceEnglishOutput); + /// Suppresses prompts for user input or confirmations. + [Argument(Format = "-NonInteractive")] public bool? NonInteractive => Get(() => NonInteractive); + /// Do not prompt when deleting. + [Argument(Format = "-NoPrompt")] public bool? NoPrompt => Get(() => NoPrompt); + /// Specifies the server URL. NuGet identifies a UNC or local folder source and simply copies the file there instead of pushing it using HTTP. Also, starting with NuGet 3.4.2, this is a mandatory parameter unless the NuGet.Config file specifies a DefaultPushSource value (see Configuring NuGet behavior). + [Argument(Format = "-Source {value}")] public string Source => Get(() => Source); + /// Specifies the amount of detail displayed in the output: normal, quiet, detailed. + [Argument(Format = "-Verbosity {value}")] public NuGetVerbosity Verbosity => Get(() => Verbosity); +} +#endregion +#region NuGetSignSettings +/// +[PublicAPI] +[ExcludeFromCodeCoverage] +[Command(Type = typeof(NuGetTasks), Command = nameof(NuGetTasks.NuGetSign), Arguments = "sign")] +public partial class NuGetSignSettings : ToolOptions +{ + /// Path of the package to sign. + [Argument(Format = "{value}", Position = 1)] public string TargetPath => Get(() => TargetPath); + /// Specifies the fingerprint to be used to search for the certificate in a local certificate store. + [Argument(Format = "-CertificateFingerprint {value}")] public string CertificateFingerprint => Get(() => CertificateFingerprint); + /// Specifies the certificate password, if needed. If a certificate is password protected but no password is provided, the command will prompt for a password at run time, unless the -NonInteractive option is passed. + [Argument(Format = "-CertificatePassword {value}", Secret = true)] public string CertificatePassword => Get(() => CertificatePassword); + /// Specifies the file path to the certificate to be used in signing the package. + [Argument(Format = "-CertificatePath {value}")] public string CertificatePath => Get(() => CertificatePath); + /// Specifies the name of the X.509 certificate store use to search for the certificate. Defaults to 'CurrentUser', the X.509 certificate store used by the current user. This option should be used when specifying the certificate via -CertificateSubjectName or -CertificateFingerprint options. + [Argument(Format = "-CertificateStoreLocation {value}")] public string CertificateStoreLocation => Get(() => CertificateStoreLocation); + /// Specifies the name of the X.509 certificate store to use to search for the certificate. Defaults to 'My', the X.509 certificate store for personal certificates. This option should be used when specifying the certificate via -CertificateSubjectName or -CertificateFingerprint options. + [Argument(Format = "-CertificateStoreName {value}")] public string CertificateStoreName => Get(() => CertificateStoreName); + /// Specifies the subject name of the certificate used to search a local certificate store for the certificate. The search is a case-insensitive string comparison using the supplied value, which will find all certificates with the subject name containing that string, regardless of other subject values. The certificate store can be specified by -CertificateStoreName and -CertificateStoreLocation options. + [Argument(Format = "-CertificateSubjectName {value}")] public string CertificateSubjectName => Get(() => CertificateSubjectName); + /// Hash algorithm to be used to sign the package. Defaults to SHA256. Possible values are SHA256, SHA384, and SHA512. + [Argument(Format = "-HashAlgorithm {value}")] public NuGetSignHashAlgorithm HashAlgorithm => Get(() => HashAlgorithm); + /// Specifies the directory where the signed package should be saved. By default the original package is overwritten by the signed package. + [Argument(Format = "-OutputDirectory {value}")] public string OutputDirectory => Get(() => OutputDirectory); + /// Switch to indicate if the current signature should be overwritten. By default the command will fail if the package already has a signature. + [Argument(Format = "-Overwrite")] public bool? Overwrite => Get(() => Overwrite); + /// URL to an RFC 3161 timestamping server. + [Argument(Format = "-Timestamper {value}")] public string Timestamper => Get(() => Timestamper); + /// Hash algorithm to be used by the RFC 3161 timestamp server. Defaults to SHA256. + [Argument(Format = "-TimestampHashAlgorithm {value}")] public NuGetSignHashAlgorithm TimestampHashAlgorithm => Get(() => TimestampHashAlgorithm); + /// The NuGet configuration file to apply. If not specified, %AppData%\NuGet\NuGet.Config (Windows) or ~/.nuget/NuGet/NuGet.Config (Mac/Linux) is used. + [Argument(Format = "-ConfigFile {value}")] public string ConfigFile => Get(() => ConfigFile); + /// (3.5+) Forces nuget.exe to run using an invariant, English-based culture. + [Argument(Format = "-ForceEnglishOutput")] public bool? ForceEnglishOutput => Get(() => ForceEnglishOutput); + /// Suppresses prompts for user input or confirmations. + [Argument(Format = "-NonInteractive")] public bool? NonInteractive => Get(() => NonInteractive); + /// Specifies the amount of detail displayed in the output: normal, quiet, detailed. + [Argument(Format = "-Verbosity {value}")] public NuGetVerbosity Verbosity => Get(() => Verbosity); +} +#endregion +#region NuGetVerifySettings +/// +[PublicAPI] +[ExcludeFromCodeCoverage] +[Command(Type = typeof(NuGetTasks), Command = nameof(NuGetTasks.NuGetVerify), Arguments = "verify")] +public partial class NuGetVerifySettings : ToolOptions +{ + /// Path of the package to verify Signatures. + [Argument(Format = "-Signatures {value}", Position = 1)] public string TargetPath => Get(() => TargetPath); + /// Specifies one or more SHA-256 certificate fingerprints of certificates(s) which signed packages must be signed with. A certificate SHA-256 fingerprint is a SHA-256 hash of the certificate. Multiple inputs should be semicolon separated. + [Argument(Format = "-CertificateFingerprint {value}")] public string CertificateFingerprint => Get(() => CertificateFingerprint); + /// The NuGet configuration file to apply. If not specified, %AppData%\NuGet\NuGet.Config (Windows) or ~/.nuget/NuGet/NuGet.Config (Mac/Linux) is used. + [Argument(Format = "-ConfigFile {value}")] public string ConfigFile => Get(() => ConfigFile); + /// (3.5+) Forces nuget.exe to run using an invariant, English-based culture. + [Argument(Format = "-ForceEnglishOutput")] public bool? ForceEnglishOutput => Get(() => ForceEnglishOutput); + /// Suppresses prompts for user input or confirmations. + [Argument(Format = "-NonInteractive")] public bool? NonInteractive => Get(() => NonInteractive); + /// Specifies the amount of detail displayed in the output: normal, quiet, detailed. + [Argument(Format = "-Verbosity {value}")] public NuGetVerbosity Verbosity => Get(() => Verbosity); +} +#endregion #region NuGetPackSettings /// [PublicAPI] @@ -543,6 +653,350 @@ [Pure] [Builder(Type = typeof(NuGetPushSettings), Property = nameof(NuGetPushSet #endregion } #endregion +#region NuGetDeleteSettingsExtensions +/// +[PublicAPI] +[ExcludeFromCodeCoverage] +public static partial class NuGetDeleteSettingsExtensions +{ + #region PackageId + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.PackageId))] + public static T SetPackageId(this T o, string v) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.PackageId, v)); + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.PackageId))] + public static T ResetPackageId(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Remove(() => o.PackageId)); + #endregion + #region PackageVersion + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.PackageVersion))] + public static T SetPackageVersion(this T o, string v) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.PackageVersion, v)); + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.PackageVersion))] + public static T ResetPackageVersion(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Remove(() => o.PackageVersion)); + #endregion + #region ApiKey + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.ApiKey))] + public static T SetApiKey(this T o, [Secret] string v) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.ApiKey, v)); + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.ApiKey))] + public static T ResetApiKey(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Remove(() => o.ApiKey)); + #endregion + #region ConfigFile + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.ConfigFile))] + public static T SetConfigFile(this T o, string v) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.ConfigFile, v)); + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.ConfigFile))] + public static T ResetConfigFile(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Remove(() => o.ConfigFile)); + #endregion + #region ForceEnglishOutput + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.ForceEnglishOutput))] + public static T SetForceEnglishOutput(this T o, bool? v) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, v)); + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.ForceEnglishOutput))] + public static T ResetForceEnglishOutput(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Remove(() => o.ForceEnglishOutput)); + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.ForceEnglishOutput))] + public static T EnableForceEnglishOutput(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, true)); + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.ForceEnglishOutput))] + public static T DisableForceEnglishOutput(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, false)); + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.ForceEnglishOutput))] + public static T ToggleForceEnglishOutput(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, !o.ForceEnglishOutput)); + #endregion + #region NonInteractive + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.NonInteractive))] + public static T SetNonInteractive(this T o, bool? v) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.NonInteractive, v)); + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.NonInteractive))] + public static T ResetNonInteractive(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Remove(() => o.NonInteractive)); + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.NonInteractive))] + public static T EnableNonInteractive(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.NonInteractive, true)); + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.NonInteractive))] + public static T DisableNonInteractive(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.NonInteractive, false)); + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.NonInteractive))] + public static T ToggleNonInteractive(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.NonInteractive, !o.NonInteractive)); + #endregion + #region NoPrompt + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.NoPrompt))] + public static T SetNoPrompt(this T o, bool? v) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.NoPrompt, v)); + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.NoPrompt))] + public static T ResetNoPrompt(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Remove(() => o.NoPrompt)); + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.NoPrompt))] + public static T EnableNoPrompt(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.NoPrompt, true)); + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.NoPrompt))] + public static T DisableNoPrompt(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.NoPrompt, false)); + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.NoPrompt))] + public static T ToggleNoPrompt(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.NoPrompt, !o.NoPrompt)); + #endregion + #region Source + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.Source))] + public static T SetSource(this T o, string v) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.Source, v)); + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.Source))] + public static T ResetSource(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Remove(() => o.Source)); + #endregion + #region Verbosity + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.Verbosity))] + public static T SetVerbosity(this T o, NuGetVerbosity v) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.Verbosity, v)); + /// + [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.Verbosity))] + public static T ResetVerbosity(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Remove(() => o.Verbosity)); + #endregion +} +#endregion +#region NuGetSignSettingsExtensions +/// +[PublicAPI] +[ExcludeFromCodeCoverage] +public static partial class NuGetSignSettingsExtensions +{ + #region TargetPath + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.TargetPath))] + public static T SetTargetPath(this T o, string v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.TargetPath, v)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.TargetPath))] + public static T ResetTargetPath(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.TargetPath)); + #endregion + #region CertificateFingerprint + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificateFingerprint))] + public static T SetCertificateFingerprint(this T o, string v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.CertificateFingerprint, v)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificateFingerprint))] + public static T ResetCertificateFingerprint(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificateFingerprint)); + #endregion + #region CertificatePassword + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificatePassword))] + public static T SetCertificatePassword(this T o, [Secret] string v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.CertificatePassword, v)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificatePassword))] + public static T ResetCertificatePassword(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificatePassword)); + #endregion + #region CertificatePath + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificatePath))] + public static T SetCertificatePath(this T o, string v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.CertificatePath, v)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificatePath))] + public static T ResetCertificatePath(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificatePath)); + #endregion + #region CertificateStoreLocation + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificateStoreLocation))] + public static T SetCertificateStoreLocation(this T o, string v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.CertificateStoreLocation, v)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificateStoreLocation))] + public static T ResetCertificateStoreLocation(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificateStoreLocation)); + #endregion + #region CertificateStoreName + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificateStoreName))] + public static T SetCertificateStoreName(this T o, string v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.CertificateStoreName, v)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificateStoreName))] + public static T ResetCertificateStoreName(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificateStoreName)); + #endregion + #region CertificateSubjectName + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificateSubjectName))] + public static T SetCertificateSubjectName(this T o, string v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.CertificateSubjectName, v)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificateSubjectName))] + public static T ResetCertificateSubjectName(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificateSubjectName)); + #endregion + #region HashAlgorithm + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.HashAlgorithm))] + public static T SetHashAlgorithm(this T o, NuGetSignHashAlgorithm v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.HashAlgorithm, v)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.HashAlgorithm))] + public static T ResetHashAlgorithm(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.HashAlgorithm)); + #endregion + #region OutputDirectory + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.OutputDirectory))] + public static T SetOutputDirectory(this T o, string v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.OutputDirectory, v)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.OutputDirectory))] + public static T ResetOutputDirectory(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.OutputDirectory)); + #endregion + #region Overwrite + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.Overwrite))] + public static T SetOverwrite(this T o, bool? v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.Overwrite, v)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.Overwrite))] + public static T ResetOverwrite(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.Overwrite)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.Overwrite))] + public static T EnableOverwrite(this T o) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.Overwrite, true)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.Overwrite))] + public static T DisableOverwrite(this T o) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.Overwrite, false)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.Overwrite))] + public static T ToggleOverwrite(this T o) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.Overwrite, !o.Overwrite)); + #endregion + #region Timestamper + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.Timestamper))] + public static T SetTimestamper(this T o, string v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.Timestamper, v)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.Timestamper))] + public static T ResetTimestamper(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.Timestamper)); + #endregion + #region TimestampHashAlgorithm + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.TimestampHashAlgorithm))] + public static T SetTimestampHashAlgorithm(this T o, NuGetSignHashAlgorithm v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.TimestampHashAlgorithm, v)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.TimestampHashAlgorithm))] + public static T ResetTimestampHashAlgorithm(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.TimestampHashAlgorithm)); + #endregion + #region ConfigFile + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.ConfigFile))] + public static T SetConfigFile(this T o, string v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.ConfigFile, v)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.ConfigFile))] + public static T ResetConfigFile(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.ConfigFile)); + #endregion + #region ForceEnglishOutput + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.ForceEnglishOutput))] + public static T SetForceEnglishOutput(this T o, bool? v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, v)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.ForceEnglishOutput))] + public static T ResetForceEnglishOutput(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.ForceEnglishOutput)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.ForceEnglishOutput))] + public static T EnableForceEnglishOutput(this T o) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, true)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.ForceEnglishOutput))] + public static T DisableForceEnglishOutput(this T o) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, false)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.ForceEnglishOutput))] + public static T ToggleForceEnglishOutput(this T o) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, !o.ForceEnglishOutput)); + #endregion + #region NonInteractive + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.NonInteractive))] + public static T SetNonInteractive(this T o, bool? v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.NonInteractive, v)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.NonInteractive))] + public static T ResetNonInteractive(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.NonInteractive)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.NonInteractive))] + public static T EnableNonInteractive(this T o) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.NonInteractive, true)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.NonInteractive))] + public static T DisableNonInteractive(this T o) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.NonInteractive, false)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.NonInteractive))] + public static T ToggleNonInteractive(this T o) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.NonInteractive, !o.NonInteractive)); + #endregion + #region Verbosity + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.Verbosity))] + public static T SetVerbosity(this T o, NuGetVerbosity v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.Verbosity, v)); + /// + [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.Verbosity))] + public static T ResetVerbosity(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.Verbosity)); + #endregion +} +#endregion +#region NuGetVerifySettingsExtensions +/// +[PublicAPI] +[ExcludeFromCodeCoverage] +public static partial class NuGetVerifySettingsExtensions +{ + #region TargetPath + /// + [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.TargetPath))] + public static T SetTargetPath(this T o, string v) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.TargetPath, v)); + /// + [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.TargetPath))] + public static T ResetTargetPath(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Remove(() => o.TargetPath)); + #endregion + #region CertificateFingerprint + /// + [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.CertificateFingerprint))] + public static T SetCertificateFingerprint(this T o, string v) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.CertificateFingerprint, v)); + /// + [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.CertificateFingerprint))] + public static T ResetCertificateFingerprint(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Remove(() => o.CertificateFingerprint)); + #endregion + #region ConfigFile + /// + [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.ConfigFile))] + public static T SetConfigFile(this T o, string v) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.ConfigFile, v)); + /// + [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.ConfigFile))] + public static T ResetConfigFile(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Remove(() => o.ConfigFile)); + #endregion + #region ForceEnglishOutput + /// + [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.ForceEnglishOutput))] + public static T SetForceEnglishOutput(this T o, bool? v) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, v)); + /// + [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.ForceEnglishOutput))] + public static T ResetForceEnglishOutput(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Remove(() => o.ForceEnglishOutput)); + /// + [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.ForceEnglishOutput))] + public static T EnableForceEnglishOutput(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, true)); + /// + [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.ForceEnglishOutput))] + public static T DisableForceEnglishOutput(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, false)); + /// + [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.ForceEnglishOutput))] + public static T ToggleForceEnglishOutput(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, !o.ForceEnglishOutput)); + #endregion + #region NonInteractive + /// + [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.NonInteractive))] + public static T SetNonInteractive(this T o, bool? v) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.NonInteractive, v)); + /// + [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.NonInteractive))] + public static T ResetNonInteractive(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Remove(() => o.NonInteractive)); + /// + [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.NonInteractive))] + public static T EnableNonInteractive(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.NonInteractive, true)); + /// + [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.NonInteractive))] + public static T DisableNonInteractive(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.NonInteractive, false)); + /// + [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.NonInteractive))] + public static T ToggleNonInteractive(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.NonInteractive, !o.NonInteractive)); + #endregion + #region Verbosity + /// + [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.Verbosity))] + public static T SetVerbosity(this T o, NuGetVerbosity v) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.Verbosity, v)); + /// + [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.Verbosity))] + public static T ResetVerbosity(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Remove(() => o.Verbosity)); + #endregion +} +#endregion #region NuGetPackSettingsExtensions /// [PublicAPI] @@ -1916,3 +2370,20 @@ public static implicit operator DependencyVersion(string value) } } #endregion +#region NuGetSignHashAlgorithm +/// Used within . +[PublicAPI] +[Serializable] +[ExcludeFromCodeCoverage] +[TypeConverter(typeof(TypeConverter))] +public partial class NuGetSignHashAlgorithm : Enumeration +{ + public static NuGetSignHashAlgorithm sha256 = (NuGetSignHashAlgorithm) "sha256"; + public static NuGetSignHashAlgorithm sha384 = (NuGetSignHashAlgorithm) "sha384"; + public static NuGetSignHashAlgorithm sha512 = (NuGetSignHashAlgorithm) "sha512"; + public static implicit operator NuGetSignHashAlgorithm(string value) + { + return new NuGetSignHashAlgorithm { Value = value }; + } +} +#endregion diff --git a/source/Nuke.Common/Tools/NuGet/NuGet.json b/source/Nuke.Common/Tools/NuGet/NuGet.json index ddbafb6e5..41a669f28 100644 --- a/source/Nuke.Common/Tools/NuGet/NuGet.json +++ b/source/Nuke.Common/Tools/NuGet/NuGet.json @@ -96,6 +96,222 @@ ] } }, + { + "postfix": "Delete", + "definiteArgument": "delete", + "settingsClass": { + "properties": [ + { + "name": "PackageId", + "type": "string", + "format": "{value}", + "position": 1, + "help": "Package Id to delete. The exact behavior depends on the source. For local folders, for instance, the package is deleted; for nuget.org the package is unlisted." + }, + { + "name": "PackageVersion", + "type": "string", + "format": "{value}", + "position": 2, + "help": "Package Version to delete. The exact behavior depends on the source. For local folders, for instance, the package is deleted; for nuget.org the package is unlisted." + }, + { + "name": "ApiKey", + "type": "string", + "format": "-ApiKey {value}", + "secret": true, + "help": "The API key for the target repository. If not present, the one specified in %AppData%\\NuGet\\NuGet.Config is used." + }, + { + "name": "ConfigFile", + "type": "string", + "format": "-ConfigFile {value}", + "help": "The NuGet configuration file to apply. If not specified, %AppData%\\NuGet\\NuGet.Config (Windows) or ~/.nuget/NuGet/NuGet.Config (Mac/Linux) is used." + }, + { + "name": "ForceEnglishOutput", + "type": "bool", + "format": "-ForceEnglishOutput", + "help": "(3.5+) Forces nuget.exe to run using an invariant, English-based culture." + }, + { + "name": "NonInteractive", + "type": "bool", + "format": "-NonInteractive", + "help": "Suppresses prompts for user input or confirmations." + }, + { + "name": "NoPrompt", + "type": "bool", + "format": "-NoPrompt", + "help": "Do not prompt when deleting." + }, + { + "name": "Source", + "type": "string", + "format": "-Source {value}", + "help": "Specifies the server URL. NuGet identifies a UNC or local folder source and simply copies the file there instead of pushing it using HTTP. Also, starting with NuGet 3.4.2, this is a mandatory parameter unless the NuGet.Config file specifies a DefaultPushSource value (see Configuring NuGet behavior)." + }, + { + "name": "Verbosity", + "type": "NuGetVerbosity", + "format": "-Verbosity {value}", + "help": "Specifies the amount of detail displayed in the output: normal, quiet, detailed." + } + ] + } + }, + { + "postfix": "Sign", + "definiteArgument": "sign", + "settingsClass": { + "properties": [ + { + "name": "TargetPath", + "type": "string", + "format": "{value}", + "position": 1, + "help": "Path of the package to sign." + }, + { + "name": "CertificateFingerprint", + "type": "string", + "format": "-CertificateFingerprint {value}", + "help": "Specifies the fingerprint to be used to search for the certificate in a local certificate store." + }, + { + "name": "CertificatePassword", + "type": "string", + "format": "-CertificatePassword {value}", + "secret": true, + "help": "Specifies the certificate password, if needed. If a certificate is password protected but no password is provided, the command will prompt for a password at run time, unless the -NonInteractive option is passed." + }, + { + "name": "CertificatePath", + "type": "string", + "format": "-CertificatePath {value}", + "help": "Specifies the file path to the certificate to be used in signing the package." + }, + { + "name": "CertificateStoreLocation", + "type": "string", + "format": "-CertificateStoreLocation {value}", + "help": "Specifies the name of the X.509 certificate store use to search for the certificate. Defaults to 'CurrentUser', the X.509 certificate store used by the current user. This option should be used when specifying the certificate via -CertificateSubjectName or -CertificateFingerprint options." + }, + { + "name": "CertificateStoreName", + "type": "string", + "format": "-CertificateStoreName {value}", + "help": "Specifies the name of the X.509 certificate store to use to search for the certificate. Defaults to 'My', the X.509 certificate store for personal certificates. This option should be used when specifying the certificate via -CertificateSubjectName or -CertificateFingerprint options." + }, + { + "name": "CertificateSubjectName", + "type": "string", + "format": "-CertificateSubjectName {value}", + "help": "Specifies the subject name of the certificate used to search a local certificate store for the certificate. The search is a case-insensitive string comparison using the supplied value, which will find all certificates with the subject name containing that string, regardless of other subject values. The certificate store can be specified by -CertificateStoreName and -CertificateStoreLocation options." + }, + { + "name": "HashAlgorithm", + "type": "NuGetSignHashAlgorithm", + "format": "-HashAlgorithm {value}", + "help": "Hash algorithm to be used to sign the package. Defaults to SHA256. Possible values are SHA256, SHA384, and SHA512." + }, + { + "name": "OutputDirectory", + "type": "string", + "format": "-OutputDirectory {value}", + "help": "Specifies the directory where the signed package should be saved. By default the original package is overwritten by the signed package." + }, + { + "name": "Overwrite", + "type": "bool", + "format": "-Overwrite", + "help": "Switch to indicate if the current signature should be overwritten. By default the command will fail if the package already has a signature." + }, + { + "name": "Timestamper", + "type": "string", + "format": "-Timestamper {value}", + "help": "URL to an RFC 3161 timestamping server." + }, + { + "name": "TimestampHashAlgorithm", + "type": "NuGetSignHashAlgorithm", + "format": "-TimestampHashAlgorithm {value}", + "help": "Hash algorithm to be used by the RFC 3161 timestamp server. Defaults to SHA256." + }, + { + "name": "ConfigFile", + "type": "string", + "format": "-ConfigFile {value}", + "help": "The NuGet configuration file to apply. If not specified, %AppData%\\NuGet\\NuGet.Config (Windows) or ~/.nuget/NuGet/NuGet.Config (Mac/Linux) is used." + }, + { + "name": "ForceEnglishOutput", + "type": "bool", + "format": "-ForceEnglishOutput", + "help": "(3.5+) Forces nuget.exe to run using an invariant, English-based culture." + }, + { + "name": "NonInteractive", + "type": "bool", + "format": "-NonInteractive", + "help": "Suppresses prompts for user input or confirmations." + }, + { + "name": "Verbosity", + "type": "NuGetVerbosity", + "format": "-Verbosity {value}", + "help": "Specifies the amount of detail displayed in the output: normal, quiet, detailed." + } + ] + } + }, + { + "postfix": "Verify", + "definiteArgument": "verify", + "settingsClass": { + "properties": [ + { + "name": "TargetPath", + "type": "string", + "format": "-Signatures {value}", + "position": 1, + "help": "Path of the package to verify Signatures." + }, + { + "name": "CertificateFingerprint", + "type": "string", + "format": "-CertificateFingerprint {value}", + "help": "Specifies one or more SHA-256 certificate fingerprints of certificates(s) which signed packages must be signed with. A certificate SHA-256 fingerprint is a SHA-256 hash of the certificate. Multiple inputs should be semicolon separated." + }, + { + "name": "ConfigFile", + "type": "string", + "format": "-ConfigFile {value}", + "help": "The NuGet configuration file to apply. If not specified, %AppData%\\NuGet\\NuGet.Config (Windows) or ~/.nuget/NuGet/NuGet.Config (Mac/Linux) is used." + }, + { + "name": "ForceEnglishOutput", + "type": "bool", + "format": "-ForceEnglishOutput", + "help": "(3.5+) Forces nuget.exe to run using an invariant, English-based culture." + }, + { + "name": "NonInteractive", + "type": "bool", + "format": "-NonInteractive", + "help": "Suppresses prompts for user input or confirmations." + }, + { + "name": "Verbosity", + "type": "NuGetVerbosity", + "format": "-Verbosity {value}", + "help": "Specifies the amount of detail displayed in the output: normal, quiet, detailed." + } + ] + } + }, { "postfix": "Pack", "definiteArgument": "pack", @@ -637,6 +853,14 @@ "Highest", "Ignore" ] + }, + { + "name": "NuGetSignHashAlgorithm", + "values": [ + "sha256", + "sha384", + "sha512" + ] } ] } From 7dfb699698b44145d2d9c5f4ed2da30fd1fd1d0c Mon Sep 17 00:00:00 2001 From: Matthias Koch Date: Wed, 15 Jan 2025 22:19:57 +0100 Subject: [PATCH 3/3] rem --- .../Tools/DotNet/DotNet.Generated.cs | 384 -------------- .../Tools/NuGet/NuGet.Generated.cs | 471 ------------------ 2 files changed, 855 deletions(-) diff --git a/source/Nuke.Common/Tools/DotNet/DotNet.Generated.cs b/source/Nuke.Common/Tools/DotNet/DotNet.Generated.cs index 966e15a50..5167ca1df 100644 --- a/source/Nuke.Common/Tools/DotNet/DotNet.Generated.cs +++ b/source/Nuke.Common/Tools/DotNet/DotNet.Generated.cs @@ -97,27 +97,6 @@ public partial class DotNetTasks : ToolTasks, IRequirePathTool public static IReadOnlyCollection DotNetNuGetPush(Configure configurator) => new DotNetTasks().Run(configurator.Invoke(new DotNetNuGetPushSettings())); /// public static IEnumerable<(DotNetNuGetPushSettings Settings, IReadOnlyCollection Output)> DotNetNuGetPush(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) => configurator.Invoke(DotNetNuGetPush, degreeOfParallelism, completeOnFailure); - ///

The dotnet nuget delete command deletes or unlists a package from the server. For nuget.org, the action is to unlist the package.

For more details, visit the official website.

- ///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

  • <packageId> via
  • <packageVersion> via
  • --api-key via
  • --force-english-output via
  • --interactive via
  • --no-service-endpoint via
  • --non-interactive via
  • --source via
- public static IReadOnlyCollection DotNetNuGetDelete(DotNetNuGetDeleteSettings options = null) => new DotNetTasks().Run(options); - /// - public static IReadOnlyCollection DotNetNuGetDelete(Configure configurator) => new DotNetTasks().Run(configurator.Invoke(new DotNetNuGetDeleteSettings())); - /// - public static IEnumerable<(DotNetNuGetDeleteSettings Settings, IReadOnlyCollection Output)> DotNetNuGetDelete(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) => configurator.Invoke(DotNetNuGetDelete, degreeOfParallelism, completeOnFailure); - ///

The dotnet nuget sign command signs all the packages matching the first argument with a certificate. The certificate with the private key can be obtained from a file or from a certificate installed in a certificate store by providing a subject name or a SHA-1 fingerprint.

For more details, visit the official website.

- ///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

  • <targetPath> via
  • --certificate-fingerprint via
  • --certificate-password via
  • --certificate-path via
  • --certificate-store-location via
  • --certificate-store-name via
  • --certificate-subject-name via
  • --hash-algorithm via
  • --output via
  • --overwrite via
  • --timestamp-hash-algorithm via
  • --timestamper via
  • --verbosity via
- public static IReadOnlyCollection DotNetNuGetSign(DotNetNuGetSignSettings options = null) => new DotNetTasks().Run(options); - /// - public static IReadOnlyCollection DotNetNuGetSign(Configure configurator) => new DotNetTasks().Run(configurator.Invoke(new DotNetNuGetSignSettings())); - /// - public static IEnumerable<(DotNetNuGetSignSettings Settings, IReadOnlyCollection Output)> DotNetNuGetSign(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) => configurator.Invoke(DotNetNuGetSign, degreeOfParallelism, completeOnFailure); - ///

The dotnet nuget verify command verifies a signed NuGet package.

For more details, visit the official website.

- ///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

  • <targetPath> via
  • --certificate-fingerprint via
  • --configfile via
  • --verbosity via
- public static IReadOnlyCollection DotNetNuGetVerify(DotNetNuGetVerifySettings options = null) => new DotNetTasks().Run(options); - /// - public static IReadOnlyCollection DotNetNuGetVerify(Configure configurator) => new DotNetTasks().Run(configurator.Invoke(new DotNetNuGetVerifySettings())); - /// - public static IEnumerable<(DotNetNuGetVerifySettings Settings, IReadOnlyCollection Output)> DotNetNuGetVerify(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) => configurator.Invoke(DotNetNuGetVerify, degreeOfParallelism, completeOnFailure); ///

Adds a NuGet source.

For more details, visit the official website.

///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

  • <source> via
  • --configfile via
  • --name via
  • --password via
  • --store-password-in-clear-text via
  • --username via
  • --valid-authentication-types via
public static IReadOnlyCollection DotNetNuGetAddSource(DotNetNuGetAddSourceSettings options = null) => new DotNetTasks().Run(options); @@ -690,83 +669,6 @@ public partial class DotNetNuGetPushSettings : ToolOptions [Argument(Format = "--no-service-endpoint")] public bool? NoServiceEndpoint => Get(() => NoServiceEndpoint); } #endregion -#region DotNetNuGetDeleteSettings -/// -[PublicAPI] -[ExcludeFromCodeCoverage] -[Command(Type = typeof(DotNetTasks), Command = nameof(DotNetTasks.DotNetNuGetDelete), Arguments = "nuget delete")] -public partial class DotNetNuGetDeleteSettings : ToolOptions -{ - /// Package Id to delete. The exact behavior depends on the source. For local folders, for instance, the package is deleted; for nuget.org the package is unlisted. - [Argument(Format = "{value}", Position = 1)] public string PackageId => Get(() => PackageId); - /// Package Version to delete. The exact behavior depends on the source. For local folders, for instance, the package is deleted; for nuget.org the package is unlisted. - [Argument(Format = "{value}", Position = 2)] public string PackageVersion => Get(() => PackageVersion); - /// Specifies the server URL. This option is required unless DefaultPushSource config value is set in the NuGet config file. - [Argument(Format = "--source {value}")] public string Source => Get(() => Source); - /// The API key for the server. - [Argument(Format = "--api-key {value}", Secret = true)] public string ApiKey => Get(() => ApiKey); - /// Forces all logged output in English. - [Argument(Format = "--force-english-output")] public bool? ForceEnglishOutput => Get(() => ForceEnglishOutput); - /// Doesn't append api/v2/package to the source URL. Option available since .NET Core 2.1 SDK. - [Argument(Format = "--no-service-endpoint")] public bool? NoServiceEndpoint => Get(() => NoServiceEndpoint); - /// Allows the command to stop and wait for user input or action. For example, to complete authentication. Available since .NET Core 3.0 SDK. - [Argument(Format = "--interactive")] public bool? Interactive => Get(() => Interactive); - /// Doesn't prompt for user input or confirmations. - [Argument(Format = "--non-interactive")] public bool? NonInteractive => Get(() => NonInteractive); -} -#endregion -#region DotNetNuGetSignSettings -/// -[PublicAPI] -[ExcludeFromCodeCoverage] -[Command(Type = typeof(DotNetTasks), Command = nameof(DotNetTasks.DotNetNuGetSign), Arguments = "nuget sign")] -public partial class DotNetNuGetSignSettings : ToolOptions -{ - /// Path of the package to sign. - [Argument(Format = "{value}", Position = 1)] public string TargetPath => Get(() => TargetPath); - /// Specifies the file path to the certificate to be used in signing the package. - [Argument(Format = "--certificate-path {value}")] public string CertificatePath => Get(() => CertificatePath); - /// Specifies the name of the X.509 certificate store to use to search for the certificate. Defaults to 'My', the X.509 certificate store for personal certificates. This option should be used when specifying the certificate via --certificate-subject-name or --certificate-fingerprint options. - [Argument(Format = "--certificate-store-name {value}")] public string CertificateStoreName => Get(() => CertificateStoreName); - /// Specifies the name of the X.509 certificate store use to search for the certificate. Defaults to 'CurrentUser', the X.509 certificate store used by the current user. This option should be used when specifying the certificate via --certificate-subject-name or --certificate-fingerprint options. - [Argument(Format = "--certificate-store-location {value}")] public string CertificateStoreLocation => Get(() => CertificateStoreLocation); - /// Specifies the subject name of the certificate used to search a local certificate store for the certificate. The search is a case-insensitive string comparison using the supplied value, which finds all certificates with the subject name containing that string, regardless of other subject values. The certificate store can be specified by --certificate-store-name and --certificate-store-location options. - [Argument(Format = "--certificate-subject-name {value}")] public string CertificateSubjectName => Get(() => CertificateSubjectName); - /// Specifies the fingerprint of the certificate used to search a local certificate store for the certificate. Starting with .NET 9, this option can be used to specify the SHA-1, SHA-256, SHA-384, or SHA-512 fingerprint of the certificate. However, a NU3043 warning is raised when a SHA-1 certificate fingerprint is used because it is no longer considered secure. - [Argument(Format = "--certificate-fingerprint {value}")] public string CertificateFingerprint => Get(() => CertificateFingerprint); - /// Specifies the certificate password, if needed. If a certificate is password protected but no password is provided, the sign command will fail. - [Argument(Format = "--certificate-password {value}", Secret = true)] public string CertificatePassword => Get(() => CertificatePassword); - /// Hash algorithm to be used to sign the package. Defaults to SHA256. Possible values are SHA256, SHA384, and SHA512. - [Argument(Format = "--hash-algorithm {value}")] public DotNetNuGetSignHashAlgorithm HashAlgorithm => Get(() => HashAlgorithm); - /// Specifies the directory where the signed package should be saved. If this option isn't specified, by default the original package is overwritten by the signed package. - [Argument(Format = "--output {value}")] public string Output => Get(() => Output); - /// Indicate that the current signature should be overwritten. By default the command will fail if the package already has a signature. - [Argument(Format = "--overwrite")] public bool? Overwrite => Get(() => Overwrite); - /// Hash algorithm to be used by the RFC 3161 timestamp server. Defaults to SHA256. - [Argument(Format = "--timestamp-hash-algorithm {value}")] public DotNetNuGetSignHashAlgorithm TimestampHashAlgorithm => Get(() => TimestampHashAlgorithm); - /// URL to an RFC 3161 timestamping server. - [Argument(Format = "--timestamper {value}")] public string Timestamper => Get(() => Timestamper); - /// Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. - [Argument(Format = "--verbosity {value}")] public DotNetVerbosity Verbosity => Get(() => Verbosity); -} -#endregion -#region DotNetNuGetVerifySettings -/// -[PublicAPI] -[ExcludeFromCodeCoverage] -[Command(Type = typeof(DotNetTasks), Command = nameof(DotNetTasks.DotNetNuGetVerify), Arguments = "nuget verify")] -public partial class DotNetNuGetVerifySettings : ToolOptions -{ - /// Path of the package to verify. - [Argument(Format = "{value}", Position = 1)] public string TargetPath => Get(() => TargetPath); - /// Verify that the signer certificate matches with one of the specified SHA256 fingerprints. This option can be supplied multiple times to provide multiple fingerprints. - [Argument(Format = "--certificate-fingerprint {value}")] public string CertificateFingerprint => Get(() => CertificateFingerprint); - /// The NuGet configuration file (nuget.config) to use. - [Argument(Format = "--configfile {value}")] public string ConfigFile => Get(() => ConfigFile); - /// Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. - [Argument(Format = "--verbosity {value}")] public DotNetVerbosity Verbosity => Get(() => Verbosity); -} -#endregion #region DotNetNuGetAddSourceSettings /// [PublicAPI] @@ -7051,275 +6953,6 @@ [Pure] [Builder(Type = typeof(DotNetNuGetPushSettings), Property = nameof(DotNet #endregion } #endregion -#region DotNetNuGetDeleteSettingsExtensions -/// -[PublicAPI] -[ExcludeFromCodeCoverage] -public static partial class DotNetNuGetDeleteSettingsExtensions -{ - #region PackageId - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.PackageId))] - public static T SetPackageId(this T o, string v) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.PackageId, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.PackageId))] - public static T ResetPackageId(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Remove(() => o.PackageId)); - #endregion - #region PackageVersion - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.PackageVersion))] - public static T SetPackageVersion(this T o, string v) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.PackageVersion, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.PackageVersion))] - public static T ResetPackageVersion(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Remove(() => o.PackageVersion)); - #endregion - #region Source - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.Source))] - public static T SetSource(this T o, string v) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.Source, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.Source))] - public static T ResetSource(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Remove(() => o.Source)); - #endregion - #region ApiKey - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.ApiKey))] - public static T SetApiKey(this T o, [Secret] string v) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.ApiKey, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.ApiKey))] - public static T ResetApiKey(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Remove(() => o.ApiKey)); - #endregion - #region ForceEnglishOutput - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.ForceEnglishOutput))] - public static T SetForceEnglishOutput(this T o, bool? v) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.ForceEnglishOutput))] - public static T ResetForceEnglishOutput(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Remove(() => o.ForceEnglishOutput)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.ForceEnglishOutput))] - public static T EnableForceEnglishOutput(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, true)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.ForceEnglishOutput))] - public static T DisableForceEnglishOutput(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, false)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.ForceEnglishOutput))] - public static T ToggleForceEnglishOutput(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, !o.ForceEnglishOutput)); - #endregion - #region NoServiceEndpoint - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.NoServiceEndpoint))] - public static T SetNoServiceEndpoint(this T o, bool? v) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.NoServiceEndpoint, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.NoServiceEndpoint))] - public static T ResetNoServiceEndpoint(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Remove(() => o.NoServiceEndpoint)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.NoServiceEndpoint))] - public static T EnableNoServiceEndpoint(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.NoServiceEndpoint, true)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.NoServiceEndpoint))] - public static T DisableNoServiceEndpoint(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.NoServiceEndpoint, false)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.NoServiceEndpoint))] - public static T ToggleNoServiceEndpoint(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.NoServiceEndpoint, !o.NoServiceEndpoint)); - #endregion - #region Interactive - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.Interactive))] - public static T SetInteractive(this T o, bool? v) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.Interactive, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.Interactive))] - public static T ResetInteractive(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Remove(() => o.Interactive)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.Interactive))] - public static T EnableInteractive(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.Interactive, true)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.Interactive))] - public static T DisableInteractive(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.Interactive, false)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.Interactive))] - public static T ToggleInteractive(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.Interactive, !o.Interactive)); - #endregion - #region NonInteractive - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.NonInteractive))] - public static T SetNonInteractive(this T o, bool? v) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.NonInteractive, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.NonInteractive))] - public static T ResetNonInteractive(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Remove(() => o.NonInteractive)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.NonInteractive))] - public static T EnableNonInteractive(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.NonInteractive, true)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.NonInteractive))] - public static T DisableNonInteractive(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.NonInteractive, false)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetDeleteSettings), Property = nameof(DotNetNuGetDeleteSettings.NonInteractive))] - public static T ToggleNonInteractive(this T o) where T : DotNetNuGetDeleteSettings => o.Modify(b => b.Set(() => o.NonInteractive, !o.NonInteractive)); - #endregion -} -#endregion -#region DotNetNuGetSignSettingsExtensions -/// -[PublicAPI] -[ExcludeFromCodeCoverage] -public static partial class DotNetNuGetSignSettingsExtensions -{ - #region TargetPath - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.TargetPath))] - public static T SetTargetPath(this T o, string v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.TargetPath, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.TargetPath))] - public static T ResetTargetPath(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.TargetPath)); - #endregion - #region CertificatePath - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificatePath))] - public static T SetCertificatePath(this T o, string v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.CertificatePath, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificatePath))] - public static T ResetCertificatePath(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificatePath)); - #endregion - #region CertificateStoreName - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificateStoreName))] - public static T SetCertificateStoreName(this T o, string v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.CertificateStoreName, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificateStoreName))] - public static T ResetCertificateStoreName(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificateStoreName)); - #endregion - #region CertificateStoreLocation - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificateStoreLocation))] - public static T SetCertificateStoreLocation(this T o, string v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.CertificateStoreLocation, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificateStoreLocation))] - public static T ResetCertificateStoreLocation(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificateStoreLocation)); - #endregion - #region CertificateSubjectName - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificateSubjectName))] - public static T SetCertificateSubjectName(this T o, string v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.CertificateSubjectName, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificateSubjectName))] - public static T ResetCertificateSubjectName(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificateSubjectName)); - #endregion - #region CertificateFingerprint - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificateFingerprint))] - public static T SetCertificateFingerprint(this T o, string v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.CertificateFingerprint, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificateFingerprint))] - public static T ResetCertificateFingerprint(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificateFingerprint)); - #endregion - #region CertificatePassword - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificatePassword))] - public static T SetCertificatePassword(this T o, [Secret] string v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.CertificatePassword, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.CertificatePassword))] - public static T ResetCertificatePassword(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificatePassword)); - #endregion - #region HashAlgorithm - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.HashAlgorithm))] - public static T SetHashAlgorithm(this T o, DotNetNuGetSignHashAlgorithm v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.HashAlgorithm, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.HashAlgorithm))] - public static T ResetHashAlgorithm(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.HashAlgorithm)); - #endregion - #region Output - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Output))] - public static T SetOutput(this T o, string v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.Output, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Output))] - public static T ResetOutput(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.Output)); - #endregion - #region Overwrite - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Overwrite))] - public static T SetOverwrite(this T o, bool? v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.Overwrite, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Overwrite))] - public static T ResetOverwrite(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.Overwrite)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Overwrite))] - public static T EnableOverwrite(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.Overwrite, true)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Overwrite))] - public static T DisableOverwrite(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.Overwrite, false)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Overwrite))] - public static T ToggleOverwrite(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.Overwrite, !o.Overwrite)); - #endregion - #region TimestampHashAlgorithm - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.TimestampHashAlgorithm))] - public static T SetTimestampHashAlgorithm(this T o, DotNetNuGetSignHashAlgorithm v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.TimestampHashAlgorithm, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.TimestampHashAlgorithm))] - public static T ResetTimestampHashAlgorithm(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.TimestampHashAlgorithm)); - #endregion - #region Timestamper - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Timestamper))] - public static T SetTimestamper(this T o, string v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.Timestamper, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Timestamper))] - public static T ResetTimestamper(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.Timestamper)); - #endregion - #region Verbosity - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Verbosity))] - public static T SetVerbosity(this T o, DotNetVerbosity v) where T : DotNetNuGetSignSettings => o.Modify(b => b.Set(() => o.Verbosity, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetSignSettings), Property = nameof(DotNetNuGetSignSettings.Verbosity))] - public static T ResetVerbosity(this T o) where T : DotNetNuGetSignSettings => o.Modify(b => b.Remove(() => o.Verbosity)); - #endregion -} -#endregion -#region DotNetNuGetVerifySettingsExtensions -/// -[PublicAPI] -[ExcludeFromCodeCoverage] -public static partial class DotNetNuGetVerifySettingsExtensions -{ - #region TargetPath - /// - [Pure] [Builder(Type = typeof(DotNetNuGetVerifySettings), Property = nameof(DotNetNuGetVerifySettings.TargetPath))] - public static T SetTargetPath(this T o, string v) where T : DotNetNuGetVerifySettings => o.Modify(b => b.Set(() => o.TargetPath, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetVerifySettings), Property = nameof(DotNetNuGetVerifySettings.TargetPath))] - public static T ResetTargetPath(this T o) where T : DotNetNuGetVerifySettings => o.Modify(b => b.Remove(() => o.TargetPath)); - #endregion - #region CertificateFingerprint - /// - [Pure] [Builder(Type = typeof(DotNetNuGetVerifySettings), Property = nameof(DotNetNuGetVerifySettings.CertificateFingerprint))] - public static T SetCertificateFingerprint(this T o, string v) where T : DotNetNuGetVerifySettings => o.Modify(b => b.Set(() => o.CertificateFingerprint, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetVerifySettings), Property = nameof(DotNetNuGetVerifySettings.CertificateFingerprint))] - public static T ResetCertificateFingerprint(this T o) where T : DotNetNuGetVerifySettings => o.Modify(b => b.Remove(() => o.CertificateFingerprint)); - #endregion - #region ConfigFile - /// - [Pure] [Builder(Type = typeof(DotNetNuGetVerifySettings), Property = nameof(DotNetNuGetVerifySettings.ConfigFile))] - public static T SetConfigFile(this T o, string v) where T : DotNetNuGetVerifySettings => o.Modify(b => b.Set(() => o.ConfigFile, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetVerifySettings), Property = nameof(DotNetNuGetVerifySettings.ConfigFile))] - public static T ResetConfigFile(this T o) where T : DotNetNuGetVerifySettings => o.Modify(b => b.Remove(() => o.ConfigFile)); - #endregion - #region Verbosity - /// - [Pure] [Builder(Type = typeof(DotNetNuGetVerifySettings), Property = nameof(DotNetNuGetVerifySettings.Verbosity))] - public static T SetVerbosity(this T o, DotNetVerbosity v) where T : DotNetNuGetVerifySettings => o.Modify(b => b.Set(() => o.Verbosity, v)); - /// - [Pure] [Builder(Type = typeof(DotNetNuGetVerifySettings), Property = nameof(DotNetNuGetVerifySettings.Verbosity))] - public static T ResetVerbosity(this T o) where T : DotNetNuGetVerifySettings => o.Modify(b => b.Remove(() => o.Verbosity)); - #endregion -} -#endregion #region DotNetNuGetAddSourceSettingsExtensions /// [PublicAPI] @@ -8621,20 +8254,3 @@ public static implicit operator DotNetFormatSeverity(string value) } } #endregion -#region DotNetNuGetSignHashAlgorithm -/// Used within . -[PublicAPI] -[Serializable] -[ExcludeFromCodeCoverage] -[TypeConverter(typeof(TypeConverter))] -public partial class DotNetNuGetSignHashAlgorithm : Enumeration -{ - public static DotNetNuGetSignHashAlgorithm sha256 = (DotNetNuGetSignHashAlgorithm) "sha256"; - public static DotNetNuGetSignHashAlgorithm sha384 = (DotNetNuGetSignHashAlgorithm) "sha384"; - public static DotNetNuGetSignHashAlgorithm sha512 = (DotNetNuGetSignHashAlgorithm) "sha512"; - public static implicit operator DotNetNuGetSignHashAlgorithm(string value) - { - return new DotNetNuGetSignHashAlgorithm { Value = value }; - } -} -#endregion diff --git a/source/Nuke.Common/Tools/NuGet/NuGet.Generated.cs b/source/Nuke.Common/Tools/NuGet/NuGet.Generated.cs index 61db08932..b1772aba1 100644 --- a/source/Nuke.Common/Tools/NuGet/NuGet.Generated.cs +++ b/source/Nuke.Common/Tools/NuGet/NuGet.Generated.cs @@ -36,27 +36,6 @@ public partial class NuGetTasks : ToolTasks, IRequireNuGetPackage /// public static IEnumerable<(NuGetPushSettings Settings, IReadOnlyCollection Output)> NuGetPush(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) => configurator.Invoke(NuGetPush, degreeOfParallelism, completeOnFailure); ///

The NuGet Command Line Interface (CLI) provides the full extent of NuGet functionality to install, create, publish, and manage packages.

For more details, visit the official website.

- ///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

  • <packageId> via
  • <packageVersion> via
  • -ApiKey via
  • -ConfigFile via
  • -ForceEnglishOutput via
  • -NonInteractive via
  • -NoPrompt via
  • -Source via
  • -Verbosity via
- public static IReadOnlyCollection NuGetDelete(NuGetDeleteSettings options = null) => new NuGetTasks().Run(options); - /// - public static IReadOnlyCollection NuGetDelete(Configure configurator) => new NuGetTasks().Run(configurator.Invoke(new NuGetDeleteSettings())); - /// - public static IEnumerable<(NuGetDeleteSettings Settings, IReadOnlyCollection Output)> NuGetDelete(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) => configurator.Invoke(NuGetDelete, degreeOfParallelism, completeOnFailure); - ///

The NuGet Command Line Interface (CLI) provides the full extent of NuGet functionality to install, create, publish, and manage packages.

For more details, visit the official website.

- ///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

  • <targetPath> via
  • -CertificateFingerprint via
  • -CertificatePassword via
  • -CertificatePath via
  • -CertificateStoreLocation via
  • -CertificateStoreName via
  • -CertificateSubjectName via
  • -ConfigFile via
  • -ForceEnglishOutput via
  • -HashAlgorithm via
  • -NonInteractive via
  • -OutputDirectory via
  • -Overwrite via
  • -Timestamper via
  • -TimestampHashAlgorithm via
  • -Verbosity via
- public static IReadOnlyCollection NuGetSign(NuGetSignSettings options = null) => new NuGetTasks().Run(options); - /// - public static IReadOnlyCollection NuGetSign(Configure configurator) => new NuGetTasks().Run(configurator.Invoke(new NuGetSignSettings())); - /// - public static IEnumerable<(NuGetSignSettings Settings, IReadOnlyCollection Output)> NuGetSign(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) => configurator.Invoke(NuGetSign, degreeOfParallelism, completeOnFailure); - ///

The NuGet Command Line Interface (CLI) provides the full extent of NuGet functionality to install, create, publish, and manage packages.

For more details, visit the official website.

- ///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

  • -CertificateFingerprint via
  • -ConfigFile via
  • -ForceEnglishOutput via
  • -NonInteractive via
  • -Signatures via
  • -Verbosity via
- public static IReadOnlyCollection NuGetVerify(NuGetVerifySettings options = null) => new NuGetTasks().Run(options); - /// - public static IReadOnlyCollection NuGetVerify(Configure configurator) => new NuGetTasks().Run(configurator.Invoke(new NuGetVerifySettings())); - /// - public static IEnumerable<(NuGetVerifySettings Settings, IReadOnlyCollection Output)> NuGetVerify(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) => configurator.Invoke(NuGetVerify, degreeOfParallelism, completeOnFailure); - ///

The NuGet Command Line Interface (CLI) provides the full extent of NuGet functionality to install, create, publish, and manage packages.

For more details, visit the official website.

///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

  • <targetPath> via
  • -BasePath via
  • -Build via
  • -Exclude via
  • -ExcludeEmptyDirectories via
  • -ForceEnglishOutput via
  • -IncludeReferencedProjects via
  • -MinClientVersion via
  • -MSBuildPath via
  • -MSBuildVersion via
  • -NoDefaultExcludes via
  • -NoPackageAnalysis via
  • -OutputDirectory via
  • -Properties via
  • -Suffix via
  • -SymbolPackageFormat via
  • -Symbols via
  • -Tool via
  • -Verbosity via
  • -Version via
public static IReadOnlyCollection NuGetPack(NuGetPackSettings options = null) => new NuGetTasks().Run(options); /// @@ -153,95 +132,6 @@ public partial class NuGetPushSettings : ToolOptions [Argument(Format = "-Timeout {value}")] public int? Timeout => Get(() => Timeout); } #endregion -#region NuGetDeleteSettings -/// -[PublicAPI] -[ExcludeFromCodeCoverage] -[Command(Type = typeof(NuGetTasks), Command = nameof(NuGetTasks.NuGetDelete), Arguments = "delete")] -public partial class NuGetDeleteSettings : ToolOptions -{ - /// Package Id to delete. The exact behavior depends on the source. For local folders, for instance, the package is deleted; for nuget.org the package is unlisted. - [Argument(Format = "{value}", Position = 1)] public string PackageId => Get(() => PackageId); - /// Package Version to delete. The exact behavior depends on the source. For local folders, for instance, the package is deleted; for nuget.org the package is unlisted. - [Argument(Format = "{value}", Position = 2)] public string PackageVersion => Get(() => PackageVersion); - /// The API key for the target repository. If not present, the one specified in %AppData%\NuGet\NuGet.Config is used. - [Argument(Format = "-ApiKey {value}", Secret = true)] public string ApiKey => Get(() => ApiKey); - /// The NuGet configuration file to apply. If not specified, %AppData%\NuGet\NuGet.Config (Windows) or ~/.nuget/NuGet/NuGet.Config (Mac/Linux) is used. - [Argument(Format = "-ConfigFile {value}")] public string ConfigFile => Get(() => ConfigFile); - /// (3.5+) Forces nuget.exe to run using an invariant, English-based culture. - [Argument(Format = "-ForceEnglishOutput")] public bool? ForceEnglishOutput => Get(() => ForceEnglishOutput); - /// Suppresses prompts for user input or confirmations. - [Argument(Format = "-NonInteractive")] public bool? NonInteractive => Get(() => NonInteractive); - /// Do not prompt when deleting. - [Argument(Format = "-NoPrompt")] public bool? NoPrompt => Get(() => NoPrompt); - /// Specifies the server URL. NuGet identifies a UNC or local folder source and simply copies the file there instead of pushing it using HTTP. Also, starting with NuGet 3.4.2, this is a mandatory parameter unless the NuGet.Config file specifies a DefaultPushSource value (see Configuring NuGet behavior). - [Argument(Format = "-Source {value}")] public string Source => Get(() => Source); - /// Specifies the amount of detail displayed in the output: normal, quiet, detailed. - [Argument(Format = "-Verbosity {value}")] public NuGetVerbosity Verbosity => Get(() => Verbosity); -} -#endregion -#region NuGetSignSettings -/// -[PublicAPI] -[ExcludeFromCodeCoverage] -[Command(Type = typeof(NuGetTasks), Command = nameof(NuGetTasks.NuGetSign), Arguments = "sign")] -public partial class NuGetSignSettings : ToolOptions -{ - /// Path of the package to sign. - [Argument(Format = "{value}", Position = 1)] public string TargetPath => Get(() => TargetPath); - /// Specifies the fingerprint to be used to search for the certificate in a local certificate store. - [Argument(Format = "-CertificateFingerprint {value}")] public string CertificateFingerprint => Get(() => CertificateFingerprint); - /// Specifies the certificate password, if needed. If a certificate is password protected but no password is provided, the command will prompt for a password at run time, unless the -NonInteractive option is passed. - [Argument(Format = "-CertificatePassword {value}", Secret = true)] public string CertificatePassword => Get(() => CertificatePassword); - /// Specifies the file path to the certificate to be used in signing the package. - [Argument(Format = "-CertificatePath {value}")] public string CertificatePath => Get(() => CertificatePath); - /// Specifies the name of the X.509 certificate store use to search for the certificate. Defaults to 'CurrentUser', the X.509 certificate store used by the current user. This option should be used when specifying the certificate via -CertificateSubjectName or -CertificateFingerprint options. - [Argument(Format = "-CertificateStoreLocation {value}")] public string CertificateStoreLocation => Get(() => CertificateStoreLocation); - /// Specifies the name of the X.509 certificate store to use to search for the certificate. Defaults to 'My', the X.509 certificate store for personal certificates. This option should be used when specifying the certificate via -CertificateSubjectName or -CertificateFingerprint options. - [Argument(Format = "-CertificateStoreName {value}")] public string CertificateStoreName => Get(() => CertificateStoreName); - /// Specifies the subject name of the certificate used to search a local certificate store for the certificate. The search is a case-insensitive string comparison using the supplied value, which will find all certificates with the subject name containing that string, regardless of other subject values. The certificate store can be specified by -CertificateStoreName and -CertificateStoreLocation options. - [Argument(Format = "-CertificateSubjectName {value}")] public string CertificateSubjectName => Get(() => CertificateSubjectName); - /// Hash algorithm to be used to sign the package. Defaults to SHA256. Possible values are SHA256, SHA384, and SHA512. - [Argument(Format = "-HashAlgorithm {value}")] public NuGetSignHashAlgorithm HashAlgorithm => Get(() => HashAlgorithm); - /// Specifies the directory where the signed package should be saved. By default the original package is overwritten by the signed package. - [Argument(Format = "-OutputDirectory {value}")] public string OutputDirectory => Get(() => OutputDirectory); - /// Switch to indicate if the current signature should be overwritten. By default the command will fail if the package already has a signature. - [Argument(Format = "-Overwrite")] public bool? Overwrite => Get(() => Overwrite); - /// URL to an RFC 3161 timestamping server. - [Argument(Format = "-Timestamper {value}")] public string Timestamper => Get(() => Timestamper); - /// Hash algorithm to be used by the RFC 3161 timestamp server. Defaults to SHA256. - [Argument(Format = "-TimestampHashAlgorithm {value}")] public NuGetSignHashAlgorithm TimestampHashAlgorithm => Get(() => TimestampHashAlgorithm); - /// The NuGet configuration file to apply. If not specified, %AppData%\NuGet\NuGet.Config (Windows) or ~/.nuget/NuGet/NuGet.Config (Mac/Linux) is used. - [Argument(Format = "-ConfigFile {value}")] public string ConfigFile => Get(() => ConfigFile); - /// (3.5+) Forces nuget.exe to run using an invariant, English-based culture. - [Argument(Format = "-ForceEnglishOutput")] public bool? ForceEnglishOutput => Get(() => ForceEnglishOutput); - /// Suppresses prompts for user input or confirmations. - [Argument(Format = "-NonInteractive")] public bool? NonInteractive => Get(() => NonInteractive); - /// Specifies the amount of detail displayed in the output: normal, quiet, detailed. - [Argument(Format = "-Verbosity {value}")] public NuGetVerbosity Verbosity => Get(() => Verbosity); -} -#endregion -#region NuGetVerifySettings -/// -[PublicAPI] -[ExcludeFromCodeCoverage] -[Command(Type = typeof(NuGetTasks), Command = nameof(NuGetTasks.NuGetVerify), Arguments = "verify")] -public partial class NuGetVerifySettings : ToolOptions -{ - /// Path of the package to verify Signatures. - [Argument(Format = "-Signatures {value}", Position = 1)] public string TargetPath => Get(() => TargetPath); - /// Specifies one or more SHA-256 certificate fingerprints of certificates(s) which signed packages must be signed with. A certificate SHA-256 fingerprint is a SHA-256 hash of the certificate. Multiple inputs should be semicolon separated. - [Argument(Format = "-CertificateFingerprint {value}")] public string CertificateFingerprint => Get(() => CertificateFingerprint); - /// The NuGet configuration file to apply. If not specified, %AppData%\NuGet\NuGet.Config (Windows) or ~/.nuget/NuGet/NuGet.Config (Mac/Linux) is used. - [Argument(Format = "-ConfigFile {value}")] public string ConfigFile => Get(() => ConfigFile); - /// (3.5+) Forces nuget.exe to run using an invariant, English-based culture. - [Argument(Format = "-ForceEnglishOutput")] public bool? ForceEnglishOutput => Get(() => ForceEnglishOutput); - /// Suppresses prompts for user input or confirmations. - [Argument(Format = "-NonInteractive")] public bool? NonInteractive => Get(() => NonInteractive); - /// Specifies the amount of detail displayed in the output: normal, quiet, detailed. - [Argument(Format = "-Verbosity {value}")] public NuGetVerbosity Verbosity => Get(() => Verbosity); -} -#endregion #region NuGetPackSettings /// [PublicAPI] @@ -653,350 +543,6 @@ [Pure] [Builder(Type = typeof(NuGetPushSettings), Property = nameof(NuGetPushSet #endregion } #endregion -#region NuGetDeleteSettingsExtensions -/// -[PublicAPI] -[ExcludeFromCodeCoverage] -public static partial class NuGetDeleteSettingsExtensions -{ - #region PackageId - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.PackageId))] - public static T SetPackageId(this T o, string v) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.PackageId, v)); - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.PackageId))] - public static T ResetPackageId(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Remove(() => o.PackageId)); - #endregion - #region PackageVersion - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.PackageVersion))] - public static T SetPackageVersion(this T o, string v) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.PackageVersion, v)); - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.PackageVersion))] - public static T ResetPackageVersion(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Remove(() => o.PackageVersion)); - #endregion - #region ApiKey - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.ApiKey))] - public static T SetApiKey(this T o, [Secret] string v) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.ApiKey, v)); - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.ApiKey))] - public static T ResetApiKey(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Remove(() => o.ApiKey)); - #endregion - #region ConfigFile - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.ConfigFile))] - public static T SetConfigFile(this T o, string v) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.ConfigFile, v)); - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.ConfigFile))] - public static T ResetConfigFile(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Remove(() => o.ConfigFile)); - #endregion - #region ForceEnglishOutput - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.ForceEnglishOutput))] - public static T SetForceEnglishOutput(this T o, bool? v) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, v)); - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.ForceEnglishOutput))] - public static T ResetForceEnglishOutput(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Remove(() => o.ForceEnglishOutput)); - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.ForceEnglishOutput))] - public static T EnableForceEnglishOutput(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, true)); - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.ForceEnglishOutput))] - public static T DisableForceEnglishOutput(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, false)); - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.ForceEnglishOutput))] - public static T ToggleForceEnglishOutput(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, !o.ForceEnglishOutput)); - #endregion - #region NonInteractive - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.NonInteractive))] - public static T SetNonInteractive(this T o, bool? v) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.NonInteractive, v)); - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.NonInteractive))] - public static T ResetNonInteractive(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Remove(() => o.NonInteractive)); - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.NonInteractive))] - public static T EnableNonInteractive(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.NonInteractive, true)); - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.NonInteractive))] - public static T DisableNonInteractive(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.NonInteractive, false)); - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.NonInteractive))] - public static T ToggleNonInteractive(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.NonInteractive, !o.NonInteractive)); - #endregion - #region NoPrompt - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.NoPrompt))] - public static T SetNoPrompt(this T o, bool? v) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.NoPrompt, v)); - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.NoPrompt))] - public static T ResetNoPrompt(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Remove(() => o.NoPrompt)); - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.NoPrompt))] - public static T EnableNoPrompt(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.NoPrompt, true)); - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.NoPrompt))] - public static T DisableNoPrompt(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.NoPrompt, false)); - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.NoPrompt))] - public static T ToggleNoPrompt(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.NoPrompt, !o.NoPrompt)); - #endregion - #region Source - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.Source))] - public static T SetSource(this T o, string v) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.Source, v)); - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.Source))] - public static T ResetSource(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Remove(() => o.Source)); - #endregion - #region Verbosity - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.Verbosity))] - public static T SetVerbosity(this T o, NuGetVerbosity v) where T : NuGetDeleteSettings => o.Modify(b => b.Set(() => o.Verbosity, v)); - /// - [Pure] [Builder(Type = typeof(NuGetDeleteSettings), Property = nameof(NuGetDeleteSettings.Verbosity))] - public static T ResetVerbosity(this T o) where T : NuGetDeleteSettings => o.Modify(b => b.Remove(() => o.Verbosity)); - #endregion -} -#endregion -#region NuGetSignSettingsExtensions -/// -[PublicAPI] -[ExcludeFromCodeCoverage] -public static partial class NuGetSignSettingsExtensions -{ - #region TargetPath - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.TargetPath))] - public static T SetTargetPath(this T o, string v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.TargetPath, v)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.TargetPath))] - public static T ResetTargetPath(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.TargetPath)); - #endregion - #region CertificateFingerprint - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificateFingerprint))] - public static T SetCertificateFingerprint(this T o, string v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.CertificateFingerprint, v)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificateFingerprint))] - public static T ResetCertificateFingerprint(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificateFingerprint)); - #endregion - #region CertificatePassword - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificatePassword))] - public static T SetCertificatePassword(this T o, [Secret] string v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.CertificatePassword, v)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificatePassword))] - public static T ResetCertificatePassword(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificatePassword)); - #endregion - #region CertificatePath - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificatePath))] - public static T SetCertificatePath(this T o, string v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.CertificatePath, v)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificatePath))] - public static T ResetCertificatePath(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificatePath)); - #endregion - #region CertificateStoreLocation - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificateStoreLocation))] - public static T SetCertificateStoreLocation(this T o, string v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.CertificateStoreLocation, v)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificateStoreLocation))] - public static T ResetCertificateStoreLocation(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificateStoreLocation)); - #endregion - #region CertificateStoreName - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificateStoreName))] - public static T SetCertificateStoreName(this T o, string v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.CertificateStoreName, v)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificateStoreName))] - public static T ResetCertificateStoreName(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificateStoreName)); - #endregion - #region CertificateSubjectName - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificateSubjectName))] - public static T SetCertificateSubjectName(this T o, string v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.CertificateSubjectName, v)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.CertificateSubjectName))] - public static T ResetCertificateSubjectName(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.CertificateSubjectName)); - #endregion - #region HashAlgorithm - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.HashAlgorithm))] - public static T SetHashAlgorithm(this T o, NuGetSignHashAlgorithm v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.HashAlgorithm, v)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.HashAlgorithm))] - public static T ResetHashAlgorithm(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.HashAlgorithm)); - #endregion - #region OutputDirectory - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.OutputDirectory))] - public static T SetOutputDirectory(this T o, string v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.OutputDirectory, v)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.OutputDirectory))] - public static T ResetOutputDirectory(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.OutputDirectory)); - #endregion - #region Overwrite - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.Overwrite))] - public static T SetOverwrite(this T o, bool? v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.Overwrite, v)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.Overwrite))] - public static T ResetOverwrite(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.Overwrite)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.Overwrite))] - public static T EnableOverwrite(this T o) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.Overwrite, true)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.Overwrite))] - public static T DisableOverwrite(this T o) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.Overwrite, false)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.Overwrite))] - public static T ToggleOverwrite(this T o) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.Overwrite, !o.Overwrite)); - #endregion - #region Timestamper - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.Timestamper))] - public static T SetTimestamper(this T o, string v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.Timestamper, v)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.Timestamper))] - public static T ResetTimestamper(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.Timestamper)); - #endregion - #region TimestampHashAlgorithm - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.TimestampHashAlgorithm))] - public static T SetTimestampHashAlgorithm(this T o, NuGetSignHashAlgorithm v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.TimestampHashAlgorithm, v)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.TimestampHashAlgorithm))] - public static T ResetTimestampHashAlgorithm(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.TimestampHashAlgorithm)); - #endregion - #region ConfigFile - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.ConfigFile))] - public static T SetConfigFile(this T o, string v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.ConfigFile, v)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.ConfigFile))] - public static T ResetConfigFile(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.ConfigFile)); - #endregion - #region ForceEnglishOutput - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.ForceEnglishOutput))] - public static T SetForceEnglishOutput(this T o, bool? v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, v)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.ForceEnglishOutput))] - public static T ResetForceEnglishOutput(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.ForceEnglishOutput)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.ForceEnglishOutput))] - public static T EnableForceEnglishOutput(this T o) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, true)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.ForceEnglishOutput))] - public static T DisableForceEnglishOutput(this T o) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, false)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.ForceEnglishOutput))] - public static T ToggleForceEnglishOutput(this T o) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, !o.ForceEnglishOutput)); - #endregion - #region NonInteractive - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.NonInteractive))] - public static T SetNonInteractive(this T o, bool? v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.NonInteractive, v)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.NonInteractive))] - public static T ResetNonInteractive(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.NonInteractive)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.NonInteractive))] - public static T EnableNonInteractive(this T o) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.NonInteractive, true)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.NonInteractive))] - public static T DisableNonInteractive(this T o) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.NonInteractive, false)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.NonInteractive))] - public static T ToggleNonInteractive(this T o) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.NonInteractive, !o.NonInteractive)); - #endregion - #region Verbosity - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.Verbosity))] - public static T SetVerbosity(this T o, NuGetVerbosity v) where T : NuGetSignSettings => o.Modify(b => b.Set(() => o.Verbosity, v)); - /// - [Pure] [Builder(Type = typeof(NuGetSignSettings), Property = nameof(NuGetSignSettings.Verbosity))] - public static T ResetVerbosity(this T o) where T : NuGetSignSettings => o.Modify(b => b.Remove(() => o.Verbosity)); - #endregion -} -#endregion -#region NuGetVerifySettingsExtensions -/// -[PublicAPI] -[ExcludeFromCodeCoverage] -public static partial class NuGetVerifySettingsExtensions -{ - #region TargetPath - /// - [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.TargetPath))] - public static T SetTargetPath(this T o, string v) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.TargetPath, v)); - /// - [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.TargetPath))] - public static T ResetTargetPath(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Remove(() => o.TargetPath)); - #endregion - #region CertificateFingerprint - /// - [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.CertificateFingerprint))] - public static T SetCertificateFingerprint(this T o, string v) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.CertificateFingerprint, v)); - /// - [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.CertificateFingerprint))] - public static T ResetCertificateFingerprint(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Remove(() => o.CertificateFingerprint)); - #endregion - #region ConfigFile - /// - [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.ConfigFile))] - public static T SetConfigFile(this T o, string v) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.ConfigFile, v)); - /// - [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.ConfigFile))] - public static T ResetConfigFile(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Remove(() => o.ConfigFile)); - #endregion - #region ForceEnglishOutput - /// - [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.ForceEnglishOutput))] - public static T SetForceEnglishOutput(this T o, bool? v) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, v)); - /// - [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.ForceEnglishOutput))] - public static T ResetForceEnglishOutput(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Remove(() => o.ForceEnglishOutput)); - /// - [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.ForceEnglishOutput))] - public static T EnableForceEnglishOutput(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, true)); - /// - [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.ForceEnglishOutput))] - public static T DisableForceEnglishOutput(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, false)); - /// - [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.ForceEnglishOutput))] - public static T ToggleForceEnglishOutput(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.ForceEnglishOutput, !o.ForceEnglishOutput)); - #endregion - #region NonInteractive - /// - [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.NonInteractive))] - public static T SetNonInteractive(this T o, bool? v) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.NonInteractive, v)); - /// - [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.NonInteractive))] - public static T ResetNonInteractive(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Remove(() => o.NonInteractive)); - /// - [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.NonInteractive))] - public static T EnableNonInteractive(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.NonInteractive, true)); - /// - [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.NonInteractive))] - public static T DisableNonInteractive(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.NonInteractive, false)); - /// - [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.NonInteractive))] - public static T ToggleNonInteractive(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.NonInteractive, !o.NonInteractive)); - #endregion - #region Verbosity - /// - [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.Verbosity))] - public static T SetVerbosity(this T o, NuGetVerbosity v) where T : NuGetVerifySettings => o.Modify(b => b.Set(() => o.Verbosity, v)); - /// - [Pure] [Builder(Type = typeof(NuGetVerifySettings), Property = nameof(NuGetVerifySettings.Verbosity))] - public static T ResetVerbosity(this T o) where T : NuGetVerifySettings => o.Modify(b => b.Remove(() => o.Verbosity)); - #endregion -} -#endregion #region NuGetPackSettingsExtensions /// [PublicAPI] @@ -2370,20 +1916,3 @@ public static implicit operator DependencyVersion(string value) } } #endregion -#region NuGetSignHashAlgorithm -/// Used within . -[PublicAPI] -[Serializable] -[ExcludeFromCodeCoverage] -[TypeConverter(typeof(TypeConverter))] -public partial class NuGetSignHashAlgorithm : Enumeration -{ - public static NuGetSignHashAlgorithm sha256 = (NuGetSignHashAlgorithm) "sha256"; - public static NuGetSignHashAlgorithm sha384 = (NuGetSignHashAlgorithm) "sha384"; - public static NuGetSignHashAlgorithm sha512 = (NuGetSignHashAlgorithm) "sha512"; - public static implicit operator NuGetSignHashAlgorithm(string value) - { - return new NuGetSignHashAlgorithm { Value = value }; - } -} -#endregion