[xbuild] Show the deprecation notice with logo, and so hide it with (#4399)
authorAnkit Jain <radical@gmail.com>
Fri, 17 Feb 2017 18:32:13 +0000 (13:32 -0500)
committerGitHub <noreply@github.com>
Fri, 17 Feb 2017 18:32:13 +0000 (13:32 -0500)
`/nologo`. It is not controlled by logging levels now.
But we also show the deprecation notice if we couldn't parse
the arguments, which would be more likely to be noticed by a user.

mcs/tools/xbuild/Main.cs

index e81574d27879487030f093450c810ded1a3fb12b..3fe5475097d1c05a094dc63ac97b30a1becf3fa4 100644 (file)
@@ -82,12 +82,13 @@ namespace Mono.XBuild.CommandLine {
                                        throw;
                                }
 
-                               ShowDeprecationNotice ();
                                show_stacktrace = (parameters.LoggerVerbosity == LoggerVerbosity.Detailed ||
                                        parameters.LoggerVerbosity == LoggerVerbosity.Diagnostic);
                                
-                               if (!parameters.NoLogo)
+                               if (!parameters.NoLogo) {
+                                       ShowDeprecationNotice ();
                                        ErrorUtilities.ShowVersion (false);
+                               }
                                
                                engine  = Engine.GlobalEngine;
                                if (!String.IsNullOrEmpty (parameters.ToolsVersion)) {
@@ -175,13 +176,11 @@ namespace Mono.XBuild.CommandLine {
 
                void ShowDeprecationNotice ()
                {
-                       if (parameters.LoggerVerbosity != LoggerVerbosity.Minimal && parameters.LoggerVerbosity != LoggerVerbosity.Quiet) {
-                               Console.ForegroundColor = ConsoleColor.DarkRed;
-                               Console.WriteLine ();
-                               Console.WriteLine (">>>> xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<");
-                               Console.WriteLine ();
-                               Console.ResetColor ();
-                       }
+                       Console.ForegroundColor = ConsoleColor.DarkRed;
+                       Console.WriteLine ();
+                       Console.WriteLine (">>>> xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<");
+                       Console.WriteLine ();
+                       Console.ResetColor ();
                }
        }