();
/// Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].
public virtual DotNetVerbosity Verbosity { get; internal set; }
protected override Arguments ConfigureArguments(Arguments arguments)
@@ -289,7 +290,7 @@ protected override Arguments ConfigureArguments(Arguments arguments)
.Add("--no-dependencies", NoDependencies)
.Add("--packages {value}", PackageDirectory)
.Add("--runtime {value}", Runtimes)
- .Add("--source {value}", Source)
+ .Add("--source {value}", Sources)
.Add("--verbosity {value}", Verbosity);
return base.ConfigureArguments(arguments);
}
@@ -2192,21 +2193,63 @@ public static DotNetRestoreSettings RemoveRuntimes(this DotNetRestoreSettings to
return toolSettings;
}
#endregion
- #region Source
- /// Sets .
Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the NuGet.config file(s). Multiple sources can be provided by specifying this option multiple times.
+ #region Sources
+ /// Sets to a new list.
Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the NuGet.config file(s). Multiple sources can be provided by specifying this option multiple times.
[Pure]
- public static DotNetRestoreSettings SetSource(this DotNetRestoreSettings toolSettings, string source)
+ public static DotNetRestoreSettings SetSources(this DotNetRestoreSettings toolSettings, params string[] sources)
{
toolSettings = toolSettings.NewInstance();
- toolSettings.Source = source;
+ toolSettings.SourcesInternal = sources.ToList();
return toolSettings;
}
- /// Resets .
Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the NuGet.config file(s). Multiple sources can be provided by specifying this option multiple times.
+ /// Sets to a new list.
Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the NuGet.config file(s). Multiple sources can be provided by specifying this option multiple times.
[Pure]
- public static DotNetRestoreSettings ResetSource(this DotNetRestoreSettings toolSettings)
+ public static DotNetRestoreSettings SetSources(this DotNetRestoreSettings toolSettings, IEnumerable sources)
{
toolSettings = toolSettings.NewInstance();
- toolSettings.Source = null;
+ toolSettings.SourcesInternal = sources.ToList();
+ return toolSettings;
+ }
+ /// Adds values to .
Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the NuGet.config file(s). Multiple sources can be provided by specifying this option multiple times.
+ [Pure]
+ public static DotNetRestoreSettings AddSources(this DotNetRestoreSettings toolSettings, params string[] sources)
+ {
+ toolSettings = toolSettings.NewInstance();
+ toolSettings.SourcesInternal.AddRange(sources);
+ return toolSettings;
+ }
+ /// Adds values to .
Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the NuGet.config file(s). Multiple sources can be provided by specifying this option multiple times.
+ [Pure]
+ public static DotNetRestoreSettings AddSources(this DotNetRestoreSettings toolSettings, IEnumerable sources)
+ {
+ toolSettings = toolSettings.NewInstance();
+ toolSettings.SourcesInternal.AddRange(sources);
+ return toolSettings;
+ }
+ /// Clears .
Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the NuGet.config file(s). Multiple sources can be provided by specifying this option multiple times.
+ [Pure]
+ public static DotNetRestoreSettings ClearSources(this DotNetRestoreSettings toolSettings)
+ {
+ toolSettings = toolSettings.NewInstance();
+ toolSettings.SourcesInternal.Clear();
+ return toolSettings;
+ }
+ /// Removes values from .
Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the NuGet.config file(s). Multiple sources can be provided by specifying this option multiple times.
+ [Pure]
+ public static DotNetRestoreSettings RemoveSources(this DotNetRestoreSettings toolSettings, params string[] sources)
+ {
+ toolSettings = toolSettings.NewInstance();
+ var hashSet = new HashSet(sources);
+ toolSettings.SourcesInternal.RemoveAll(x => hashSet.Contains(x));
+ return toolSettings;
+ }
+ /// Removes values from .
Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the NuGet.config file(s). Multiple sources can be provided by specifying this option multiple times.
+ [Pure]
+ public static DotNetRestoreSettings RemoveSources(this DotNetRestoreSettings toolSettings, IEnumerable sources)
+ {
+ toolSettings = toolSettings.NewInstance();
+ var hashSet = new HashSet(sources);
+ toolSettings.SourcesInternal.RemoveAll(x => hashSet.Contains(x));
return toolSettings;
}
#endregion