Implicit restore for build, pack, publish, run and test.
This commit is contained in:
parent
a3d6c2a551
commit
dd76fec564
13 changed files with 91 additions and 21 deletions
|
|
@ -2,18 +2,21 @@
|
|||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.DotNet.Cli.CommandLine;
|
||||
using Microsoft.DotNet.Cli.Utils;
|
||||
using Microsoft.DotNet.Tools.MSBuild;
|
||||
using Microsoft.DotNet.Tools;
|
||||
using Microsoft.DotNet.Cli;
|
||||
using Microsoft.DotNet.Tools.Restore;
|
||||
using Parser = Microsoft.DotNet.Cli.Parser;
|
||||
|
||||
namespace Microsoft.DotNet.Tools.Build
|
||||
{
|
||||
public class BuildCommand : MSBuildForwardingApp
|
||||
public class BuildCommand : RestoringCommand
|
||||
{
|
||||
public BuildCommand(IEnumerable<string> msbuildArgs, string msbuildPath = null)
|
||||
: base(msbuildArgs, msbuildPath)
|
||||
public BuildCommand(IEnumerable<string> msbuildArgs, bool noRestore, string msbuildPath = null)
|
||||
: base(msbuildArgs, noRestore, msbuildPath)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -44,7 +47,9 @@ namespace Microsoft.DotNet.Tools.Build
|
|||
|
||||
msbuildArgs.Add($"/clp:Summary");
|
||||
|
||||
return new BuildCommand(msbuildArgs, msbuildPath);
|
||||
bool noRestore = appliedBuildOptions.HasOption("--no-restore");
|
||||
|
||||
return new BuildCommand(msbuildArgs, noRestore, msbuildPath);
|
||||
}
|
||||
|
||||
public static int Run(string[] args)
|
||||
|
|
|
|||
Reference in a new issue