From 1271d855320015dd97b9bb422159519a890a8093 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger Date: Fri, 17 Jul 2026 19:40:50 +0200 Subject: [PATCH] Add missing ArtifactsPath property to `dotnet restore` --- src/Fallout.Common/Tools/DotNet/DotNet.Generated.cs | 12 +++++++++++- src/Fallout.Common/Tools/DotNet/DotNet.json | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Fallout.Common/Tools/DotNet/DotNet.Generated.cs b/src/Fallout.Common/Tools/DotNet/DotNet.Generated.cs index f80a0f741..1c6bad26b 100644 --- a/src/Fallout.Common/Tools/DotNet/DotNet.Generated.cs +++ b/src/Fallout.Common/Tools/DotNet/DotNet.Generated.cs @@ -40,7 +40,7 @@ public partial class DotNetTasks : ToolTasks, IRequirePathTool /// public static IEnumerable<(DotNetRunSettings Settings, IReadOnlyCollection Output)> DotNetRun(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) => configurator.Invoke(DotNetRun, degreeOfParallelism, completeOnFailure); ///

The dotnet restore command uses NuGet to restore dependencies as well as project-specific tools that are specified in the project file. By default, the restoration of dependencies and tools are performed in parallel.

Starting with .NET Core 2.0, you don't have to run dotnet restore because it's run implicitly by all commands, such as dotnet build and dotnet run, that require a restore to occur. It's still a valid command in certain scenarios where doing an explicit restore makes sense, such as continuous integration builds in Visual Studio Team Services or in build systems that need to explicitly control the time at which the restore occurs.

In order to restore the dependencies, NuGet needs the feeds where the packages are located. Feeds are usually provided via the NuGet.config configuration file. A default configuration file is provided when the CLI tools are installed. You specify additional feeds by creating your own NuGet.config file in the project directory. You also specify additional feeds per invocation at a command prompt.

For dependencies, you specify where the restored packages are placed during the restore operation using the --packages argument. If not specified, the default NuGet package cache is used, which is found in the .nuget/packages directory in the user's home directory on all operating systems (for example, /home/user1 on Linux or C:\Users\user1 on Windows).

For project-specific tooling, dotnet restore first restores the package in which the tool is packed, and then proceeds to restore the tool's dependencies as specified in its project file.

The behavior of the dotnet restore command is affected by some of the settings in the Nuget.Config file, if present. For example, setting the globalPackagesFolder in NuGet.Config places the restored NuGet packages in the specified folder. This is an alternative to specifying the --packages option on the dotnet restore command. For more information, see the NuGet.Config reference.

For more details, visit the official website.

- ///

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

  • <projectFile> via
  • --configfile via
  • --disable-parallel via
  • --force via
  • --force-evaluate via
  • --ignore-failed-sources via
  • --lock-file-path via
  • --locked-mode via
  • --no-cache via
  • --no-dependencies via
  • --packages via
  • --property via
  • --runtime via
  • --source via
  • --use-lock-file via
  • --verbosity via
+ ///

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

  • <projectFile> via
  • --artifacts-path via
  • --configfile via
  • --disable-parallel via
  • --force via
  • --force-evaluate via
  • --ignore-failed-sources via
  • --lock-file-path via
  • --locked-mode via
  • --no-cache via
  • --no-dependencies via
  • --packages via
  • --property via
  • --runtime via
  • --source via
  • --use-lock-file via
  • --verbosity via
public static IReadOnlyCollection DotNetRestore(DotNetRestoreSettings options = null) => new DotNetTasks().Run(options); /// public static IReadOnlyCollection DotNetRestore(Configure configurator) => new DotNetTasks().Run(configurator.Invoke(new DotNetRestoreSettings())); @@ -356,6 +356,8 @@ public partial class DotNetRestoreSettings : ToolOptions [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); + /// All build output files from the executed command will go in subfolders under the specified path, separated by project. For more information see Artifacts Output Layout. Available since .NET 8 SDK. + [Argument(Format = "--artifacts-path {value}")] public string ArtifactsPath => Get(() => ArtifactsPath); /// Disables restoring multiple projects in parallel. [Argument(Format = "--disable-parallel")] public bool? DisableParallel => Get(() => DisableParallel); /// Forces all dependencies to be resolved even if the last restore was successful. This is equivalent to deleting the project.assets.json file. @@ -2370,6 +2372,14 @@ public static partial class DotNetRestoreSettingsExtensions [Builder(Type = typeof(DotNetRestoreSettings), Property = nameof(DotNetRestoreSettings.Verbosity))] public static T ResetVerbosity(this T o) where T : DotNetRestoreSettings => o.Modify(b => b.Remove(() => o.Verbosity)); #endregion + #region ArtifactsPath + /// + [Builder(Type = typeof(DotNetRestoreSettings), Property = nameof(DotNetRestoreSettings.ArtifactsPath))] + public static T SetArtifactsPath(this T o, string v) where T : DotNetRestoreSettings => o.Modify(b => b.Set(() => o.ArtifactsPath, v)); + /// + [Builder(Type = typeof(DotNetRestoreSettings), Property = nameof(DotNetRestoreSettings.ArtifactsPath))] + public static T ResetArtifactsPath(this T o) where T : DotNetRestoreSettings => o.Modify(b => b.Remove(() => o.ArtifactsPath)); + #endregion #region DisableParallel /// [Builder(Type = typeof(DotNetRestoreSettings), Property = nameof(DotNetRestoreSettings.DisableParallel))] diff --git a/src/Fallout.Common/Tools/DotNet/DotNet.json b/src/Fallout.Common/Tools/DotNet/DotNet.json index 3bee6104d..5364cf5da 100644 --- a/src/Fallout.Common/Tools/DotNet/DotNet.json +++ b/src/Fallout.Common/Tools/DotNet/DotNet.json @@ -347,6 +347,12 @@ "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]." + }, + { + "name": "ArtifactsPath", + "type": "string", + "format": "--artifacts-path {value}", + "help": "All build output files from the executed command will go in subfolders under the specified path, separated by project. For more information see Artifacts Output Layout. Available since .NET 8 SDK." } ] }