cake icon indicating copy to clipboard operation
cake copied to clipboard

DotNetCoreMSBuildSettings.Verbose: Unknown switch

Open patriksvensson opened this issue 6 years ago • 8 comments

Executing task: Build
Executing: "C:/Program Files/dotnet/dotnet.exe" msbuild /property:Configuration=Release "./master/Lol.sln" --verbosity Minimal
Microsoft (R) Build Engine version 16.0.450+ga8dc7f1d34 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1001: Unknown switch.
Switch: --verbosity

patriksvensson avatar May 06 '19 08:05 patriksvensson

It's inherited from DotNetCoreSettings

Common --verbosity was obsoleted in .NET Core 2.x, and removed in 2.1.4xx, so we should obsolete now with errror, and remove next version.

Reference discussion around it dotnet/cli#9165

--verbosity has been removed from the top-level and the few commands that do support it now make it clear the option is controlling the MSBuild verbosity.

devlead avatar May 06 '19 08:05 devlead

We could replace the underlying functionality by setting the /Verbosity=Diagnostic. That would work regardless of version.

patriksvensson avatar May 06 '19 08:05 patriksvensson

It's not been avail for 1 year, and didn't work as expected before that. So my vote is on obsolete :)

devlead avatar May 06 '19 08:05 devlead

But we still want to be able to set Verbosity for MSBuild. What should we replace the obsoleted Verbosity with for DotNetCoreMSBuild? Verbosity2? 😄

patriksvensson avatar May 06 '19 08:05 patriksvensson

Since DotNetCoreMSBuildSettings proxies parameters to MSBuild I would want this to be analog to how MSBuild command works

patriksvensson avatar May 06 '19 08:05 patriksvensson

Could we obsolete in base and do a new property in DotNetCoreMSBuildSettings?

Maybe a MSBuildVerbosity enum as Vebosity is Cake verbosities which doesn't totally match MSbuild but instead gets translated by GetMSBuildVerbosity extension.

Or should we use Verbosity as MSBuildSettings does?

devlead avatar May 06 '19 08:05 devlead

Or we can just keep it as it is and change how the DotNetCoreMSBuild runner does the mapping from settings class to arguments.

patriksvensson avatar May 06 '19 09:05 patriksvensson

In my PR I removed the DotNetCoreMSBuildSettings.Verbosity and created MSBuildVerbosity thats used by both settings. Personally I don't think the DotNetCoreMSBuildSettings.Verbosity should stay in cake just for compatibiltiy reasons but I'm open to discuss this.

daveMueller avatar Jun 15 '19 06:06 daveMueller