From 9b9725ac38be1466dca70cc9787413cefb847e86 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Wed, 30 Mar 2016 16:01:23 -0700 Subject: [PATCH] Remove rid inference --- scripts/dotnet-cli-build/TestTargets.cs | 12 ++++++------ src/dotnet/commands/dotnet-restore/Program.cs | 8 +------- .../Commands/RestoreCommand.cs | 2 +- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/scripts/dotnet-cli-build/TestTargets.cs b/scripts/dotnet-cli-build/TestTargets.cs index 990cc77da..32c31aea2 100644 --- a/scripts/dotnet-cli-build/TestTargets.cs +++ b/scripts/dotnet-cli-build/TestTargets.cs @@ -75,7 +75,7 @@ namespace Microsoft.DotNet.Cli.Build CleanNuGetTempCache(); var dotnet = DotNetCli.Stage2; - dotnet.Restore("--verbosity", "verbose", "--disable-parallel").WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "TestPackages")).Execute().EnsureSuccessful(); + dotnet.Restore("--verbosity", "verbose", "--infer-runtimes", "--disable-parallel").WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "TestPackages")).Execute().EnsureSuccessful(); return c.Success(); } @@ -90,16 +90,16 @@ namespace Microsoft.DotNet.Cli.Build var dotnet = DotNetCli.Stage2; - dotnet.Restore("--verbosity", "verbose", "--disable-parallel", "--fallbacksource", Dirs.TestPackages) + dotnet.Restore("--verbosity", "verbose", "--disable-parallel", "--infer-runtimes", "--fallbacksource", Dirs.TestPackages) .WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "TestProjects")) .Execute().EnsureSuccessful(); // The 'ProjectModelServer' directory contains intentionally-unresolved dependencies, so don't check for success. Also, suppress the output - dotnet.Restore("--verbosity", "verbose", "--disable-parallel") + dotnet.Restore("--verbosity", "verbose", "--disable-parallel", "--infer-runtimes") .WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "ProjectModelServer", "DthTestProjects")) .Execute(); - dotnet.Restore("--verbosity", "verbose", "--disable-parallel") + dotnet.Restore("--verbosity", "verbose", "--disable-parallel", "--infer-runtimes") .WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "ProjectModelServer", "DthUpdateSearchPathSample")) .Execute(); @@ -112,7 +112,7 @@ namespace Microsoft.DotNet.Cli.Build { var dotnet = DotNetCli.Stage2; - dotnet.Restore("--verbosity", "verbose", "--disable-parallel", "--fallbacksource", Dirs.TestPackages) + dotnet.Restore("--verbosity", "verbose", "--disable-parallel", "--infer-runtimes", "--fallbacksource", Dirs.TestPackages) .WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "DesktopTestProjects")) .Execute().EnsureSuccessful(); @@ -188,7 +188,7 @@ namespace Microsoft.DotNet.Cli.Build CleanBinObj(c, Path.Combine(c.BuildContext.BuildDirectory, "test")); CleanNuGetTempCache(); - DotNetCli.Stage2.Restore("--verbosity", "verbose", "--disable-parallel", "--fallbacksource", Dirs.TestPackages) + DotNetCli.Stage2.Restore("--verbosity", "verbose", "--disable-parallel", "--infer-runtimes","--fallbacksource", Dirs.TestPackages) .WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "test")) .Execute() .EnsureSuccessful(); diff --git a/src/dotnet/commands/dotnet-restore/Program.cs b/src/dotnet/commands/dotnet-restore/Program.cs index 6ccfb516f..822fb57f3 100644 --- a/src/dotnet/commands/dotnet-restore/Program.cs +++ b/src/dotnet/commands/dotnet-restore/Program.cs @@ -35,13 +35,7 @@ namespace Microsoft.DotNet.Tools.Restore // "--verbosity" switch that goes BEFORE the command var quiet = args.Any(s => s.Equals("--quiet", StringComparison.OrdinalIgnoreCase)); args = args.Where(s => !s.Equals("--quiet", StringComparison.OrdinalIgnoreCase)).ToArray(); - - // Always infer runtimes in dotnet-restore (for now). - if (!args.Any(s => s.Equals("--infer-runtimes", StringComparison.OrdinalIgnoreCase))) - { - args = Enumerable.Concat(new [] { "--infer-runtimes" }, args).ToArray(); - } - + app.OnExecute(() => { try diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreCommand.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreCommand.cs index 03b62d448..2e2985a4d 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreCommand.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreCommand.cs @@ -15,7 +15,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities public override CommandResult Execute(string args="") { - args = $"restore {args}"; + args = $"restore {args} --infer-runtimes"; return base.Execute(args); } }