diff --git a/src/Build.UnitTests/BinaryLogger_Tests.cs b/src/Build.UnitTests/BinaryLogger_Tests.cs index 97fe6342c62..ec9b843a9a7 100644 --- a/src/Build.UnitTests/BinaryLogger_Tests.cs +++ b/src/Build.UnitTests/BinaryLogger_Tests.cs @@ -611,7 +611,7 @@ public void SuppressCommandOutputForNonDiagVerbosity() TransientTestFile projectFile1 = env.CreateFile(testFolder, "testProject01.proj", contents); string consoleOutput1 = RunnerUtilities.ExecMSBuild($"{projectFile1.Path} -bl:{_logFile} -verbosity:diag -nologo", out bool success1); success1.ShouldBeTrue(); - var expected1 = $"-nologo -bl:{_logFile} -verbosity:diag {projectFile1.Path}"; + var expected1 = $"-bl:{_logFile} -nologo -verbosity:diag {projectFile1.Path}"; consoleOutput1.ShouldContain(expected1); foreach (var verbosity in new string[] { "q", "m", "n", "d" }) @@ -619,7 +619,7 @@ public void SuppressCommandOutputForNonDiagVerbosity() TransientTestFile projectFile2 = env.CreateFile(testFolder, $"testProject_{verbosity}.proj", contents); string consoleOutput2 = RunnerUtilities.ExecMSBuild($"{projectFile2.Path} -bl:{_logFile} -verbosity:{verbosity} -nologo", out bool success2); success2.ShouldBeTrue(); - var expected2 = $"-nologo -bl:{_logFile} -verbosity:{verbosity} {projectFile2.Path}"; + var expected2 = $"-bl:{_logFile} -nologo -verbosity:{verbosity} {projectFile2.Path}"; consoleOutput2.ShouldNotContain(expected2); } } diff --git a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs index 7e8af34b3b3..f9db1f275c8 100644 --- a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs +++ b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs @@ -87,8 +87,8 @@ public void VersionSwitchIdentificationTests(string version) [InlineData("NoLogo")] public void NoLogoSwitchIdentificationTests(string nologo) { - CommandLineSwitches.IsParameterlessSwitch(nologo, out CommandLineSwitches.ParameterlessSwitch parameterlessSwitch, out string duplicateSwitchErrorMessage).ShouldBeTrue(); - parameterlessSwitch.ShouldBe(CommandLineSwitches.ParameterlessSwitch.NoLogo); + CommandLineSwitches.IsParameterizedSwitch(nologo, out CommandLineSwitches.ParameterizedSwitch parameterizedSwitch, out string duplicateSwitchErrorMessage, out bool multipleParametersAllowed, out string missingParametersErrorMessage, out bool unquoteParameters, out bool emptyParametersAllowed).ShouldBeTrue(); + parameterizedSwitch.ShouldBe(CommandLineSwitches.ParameterizedSwitch.NoLogo); duplicateSwitchErrorMessage.ShouldBeNull(); } @@ -766,18 +766,18 @@ public void SetParameterlessSwitchTests() { CommandLineSwitches switches = new CommandLineSwitches(); - switches.SetParameterlessSwitch(CommandLineSwitches.ParameterlessSwitch.NoLogo, "/nologo"); + switches.SetParameterlessSwitch(CommandLineSwitches.ParameterlessSwitch.Help, "/help"); - Assert.Equal("/nologo", switches.GetParameterlessSwitchCommandLineArg(CommandLineSwitches.ParameterlessSwitch.NoLogo)); - Assert.True(switches.IsParameterlessSwitchSet(CommandLineSwitches.ParameterlessSwitch.NoLogo)); - Assert.True(switches[CommandLineSwitches.ParameterlessSwitch.NoLogo]); + Assert.Equal("/help", switches.GetParameterlessSwitchCommandLineArg(CommandLineSwitches.ParameterlessSwitch.Help)); + Assert.True(switches.IsParameterlessSwitchSet(CommandLineSwitches.ParameterlessSwitch.Help)); + Assert.True(switches[CommandLineSwitches.ParameterlessSwitch.Help]); // set it again - switches.SetParameterlessSwitch(CommandLineSwitches.ParameterlessSwitch.NoLogo, "-NOLOGO"); + switches.SetParameterlessSwitch(CommandLineSwitches.ParameterlessSwitch.Help, "-HELP"); - Assert.Equal("-NOLOGO", switches.GetParameterlessSwitchCommandLineArg(CommandLineSwitches.ParameterlessSwitch.NoLogo)); - Assert.True(switches.IsParameterlessSwitchSet(CommandLineSwitches.ParameterlessSwitch.NoLogo)); - Assert.True(switches[CommandLineSwitches.ParameterlessSwitch.NoLogo]); + Assert.Equal("-HELP", switches.GetParameterlessSwitchCommandLineArg(CommandLineSwitches.ParameterlessSwitch.Help)); + Assert.True(switches.IsParameterlessSwitchSet(CommandLineSwitches.ParameterlessSwitch.Help)); + Assert.True(switches[CommandLineSwitches.ParameterlessSwitch.Help]); // we didn't set this switch Assert.Null(switches.GetParameterlessSwitchCommandLineArg(CommandLineSwitches.ParameterlessSwitch.Version)); @@ -1472,6 +1472,43 @@ public void ProcessBooleanSwitchTest() Should.Throw(() => MSBuildApp.ProcessBooleanSwitch(new[] { "invalid" }, defaultValue: true, resourceName: "InvalidRestoreValue")); } + [Fact] + public void NoLogoParameterizedSwitchTest() + { + CommandLineSwitches switches = new CommandLineSwitches(); + + // Test that nologo is now identified as a parameterized switch + CommandLineSwitches.IsParameterizedSwitch("nologo", out CommandLineSwitches.ParameterizedSwitch parameterizedSwitch, out string duplicateSwitchErrorMessage, out bool multipleParametersAllowed, out string missingParametersErrorMessage, out bool unquoteParameters, out bool emptyParametersAllowed).ShouldBeTrue(); + parameterizedSwitch.ShouldBe(CommandLineSwitches.ParameterizedSwitch.NoLogo); + + // Test setting parameterized nologo switch with explicit true + switches.SetParameterizedSwitch(CommandLineSwitches.ParameterizedSwitch.NoLogo, "/nologo:true", "true", false, true, false); + switches.IsParameterizedSwitchSet(CommandLineSwitches.ParameterizedSwitch.NoLogo).ShouldBeTrue(); + switches[CommandLineSwitches.ParameterizedSwitch.NoLogo][0].ShouldBe("true"); + + // Test setting parameterized nologo switch with explicit false + switches = new CommandLineSwitches(); + switches.SetParameterizedSwitch(CommandLineSwitches.ParameterizedSwitch.NoLogo, "/nologo:false", "false", false, true, false); + switches.IsParameterizedSwitchSet(CommandLineSwitches.ParameterizedSwitch.NoLogo).ShouldBeTrue(); + switches[CommandLineSwitches.ParameterizedSwitch.NoLogo][0].ShouldBe("false"); + } + + [Fact] + public void NoLogoBooleanProcessingTest() + { + // Test ProcessBooleanSwitch behavior for nologo + // Default value should be true when no parameters are provided + MSBuildApp.ProcessBooleanSwitch(Array.Empty(), defaultValue: true, resourceName: "InvalidNoLogoValue").ShouldBeTrue(); + MSBuildApp.ProcessBooleanSwitch(Array.Empty(), defaultValue: false, resourceName: "InvalidNoLogoValue").ShouldBeFalse(); + + // Test with explicit true/false values + MSBuildApp.ProcessBooleanSwitch(new[] { "true" }, defaultValue: false, resourceName: "InvalidNoLogoValue").ShouldBeTrue(); + MSBuildApp.ProcessBooleanSwitch(new[] { "false" }, defaultValue: true, resourceName: "InvalidNoLogoValue").ShouldBeFalse(); + + // Test invalid value throws exception + Should.Throw(() => MSBuildApp.ProcessBooleanSwitch(new[] { "invalid" }, defaultValue: true, resourceName: "InvalidNoLogoValue")); + } + public static IEnumerable ProcessGraphBuildSwitchData() { var emptyOptions = new GraphBuildOptions(); diff --git a/src/MSBuild/CommandLineSwitches.cs b/src/MSBuild/CommandLineSwitches.cs index 66b529eb62f..5a9989e6645 100644 --- a/src/MSBuild/CommandLineSwitches.cs +++ b/src/MSBuild/CommandLineSwitches.cs @@ -33,7 +33,6 @@ internal enum ParameterlessSwitch Invalid = -1, Help = 0, Version, - NoLogo, NoAutoResponse, NoConsoleLogger, FileLogger, @@ -120,6 +119,7 @@ internal enum ParameterizedSwitch GetResultOutputFile, FeatureAvailability, MultiThreaded, + NoLogo, // This has to be kept as last enum value NumberOfParameterizedSwitches, } @@ -215,7 +215,6 @@ internal ParameterizedSwitchInfo( //---------------------------------------------------------------------------------------------------------------------------------------------------------- new ParameterlessSwitchInfo( ["help", "h", "?"], ParameterlessSwitch.Help, null, "HelpMessage_4_HelpSwitch"), new ParameterlessSwitchInfo( ["version", "ver"], ParameterlessSwitch.Version, null, "HelpMessage_6_VersionSwitch"), - new ParameterlessSwitchInfo( ["nologo"], ParameterlessSwitch.NoLogo, null, "HelpMessage_5_NoLogoSwitch"), new ParameterlessSwitchInfo( ["noautoresponse", "noautorsp"], ParameterlessSwitch.NoAutoResponse, null, "HelpMessage_8_NoAutoResponseSwitch"), new ParameterlessSwitchInfo( ["noconsolelogger", "noconlog"], ParameterlessSwitch.NoConsoleLogger, null, "HelpMessage_14_NoConsoleLoggerSwitch"), new ParameterlessSwitchInfo( ["filelogger", "fl"], ParameterlessSwitch.FileLogger, null, "HelpMessage_20_FileLoggerSwitch"), @@ -297,7 +296,8 @@ internal ParameterizedSwitchInfo( new ParameterizedSwitchInfo( ["getTargetResult"], ParameterizedSwitch.GetTargetResult, null, true, "MissingGetTargetResultError", true, false, "HelpMessage_45_GetTargetResultSwitch"), new ParameterizedSwitchInfo( ["getResultOutputFile"], ParameterizedSwitch.GetResultOutputFile, null, true, "MissingGetResultFileError", true, false, "HelpMessage_51_GetResultOutputFileSwitch"), new ParameterizedSwitchInfo( ["featureAvailability", "fa"], ParameterizedSwitch.FeatureAvailability, null, true, "MissingFeatureAvailabilityError", true, false, "HelpMessage_46_FeatureAvailabilitySwitch"), - new ParameterizedSwitchInfo( ["multithreaded", "mt"], ParameterizedSwitch.MultiThreaded, null, false, null, true, false, "HelpMessage_49_MultiThreadedSwitch") + new ParameterizedSwitchInfo( ["multithreaded", "mt"], ParameterizedSwitch.MultiThreaded, null, false, null, true, false, "HelpMessage_49_MultiThreadedSwitch"), + new ParameterizedSwitchInfo( ["nologo"], ParameterizedSwitch.NoLogo, null, false, null, true, false, "HelpMessage_5_NoLogoSwitch") }; /// diff --git a/src/MSBuild/Resources/Strings.resx b/src/MSBuild/Resources/Strings.resx index c48e2fb3e65..34cf3d9dd0e 100644 --- a/src/MSBuild/Resources/Strings.resx +++ b/src/MSBuild/Resources/Strings.resx @@ -216,7 +216,8 @@ - -noLogo Do not display the startup banner and copyright message. + -noLogo[:true|false] Do not display the startup banner and copyright message. + Specify -nologo:false to explicitly show the logo. LOCALIZATION: The following should not be localized: @@ -1468,6 +1469,15 @@ LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + + {StrBegin="MSBUILD : error MSB1071: "} + UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. + This error is shown when a user specifies a value for the nologo parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. + LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + MSBUILD : error MSB1056: Isolate projects value is not valid. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.cs.xlf b/src/MSBuild/Resources/xlf/Strings.cs.xlf index 3d284a65d69..b397262892b 100644 --- a/src/MSBuild/Resources/xlf/Strings.cs.xlf +++ b/src/MSBuild/Resources/xlf/Strings.cs.xlf @@ -302,6 +302,16 @@ UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. This error is shown when a user specifies a value for the lowPriority parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + + + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + + {StrBegin="MSBUILD : error MSB1071: "} + UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. + This error is shown when a user specifies a value for the nologo parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. + LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. @@ -632,9 +642,10 @@ Když se nastaví na MessageUponIsolationViolation (nebo jeho krátký - -noLogo Do not display the startup banner and copyright message. + -noLogo[:true|false] Do not display the startup banner and copyright message. + Specify -nologo:false to explicitly show the logo. - -noLogo Nezobrazí se úvodní nápis a zpráva o autorských právech. + -noLogo Nezobrazí se úvodní nápis a zpráva o autorských právech. LOCALIZATION: The following should not be localized: diff --git a/src/MSBuild/Resources/xlf/Strings.de.xlf b/src/MSBuild/Resources/xlf/Strings.de.xlf index 80bd4af2d8c..d87249f2d84 100644 --- a/src/MSBuild/Resources/xlf/Strings.de.xlf +++ b/src/MSBuild/Resources/xlf/Strings.de.xlf @@ -302,6 +302,16 @@ UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. This error is shown when a user specifies a value for the lowPriority parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + + + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + + {StrBegin="MSBUILD : error MSB1071: "} + UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. + This error is shown when a user specifies a value for the nologo parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. + LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. @@ -628,9 +638,10 @@ Dies ist ein restriktiverer Modus von MSBuild, da er erfordert, - -noLogo Do not display the startup banner and copyright message. + -noLogo[:true|false] Do not display the startup banner and copyright message. + Specify -nologo:false to explicitly show the logo. - -noLogo Zeigt kein Startbanner und keine Copyrightmeldung an. + -noLogo Zeigt kein Startbanner und keine Copyrightmeldung an. LOCALIZATION: The following should not be localized: diff --git a/src/MSBuild/Resources/xlf/Strings.es.xlf b/src/MSBuild/Resources/xlf/Strings.es.xlf index 4f89d571dd9..c7db42e0f63 100644 --- a/src/MSBuild/Resources/xlf/Strings.es.xlf +++ b/src/MSBuild/Resources/xlf/Strings.es.xlf @@ -301,6 +301,16 @@ Esta marca es experimental y puede que no funcione según lo previsto. UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. This error is shown when a user specifies a value for the lowPriority parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + + + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + + {StrBegin="MSBUILD : error MSB1071: "} + UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. + This error is shown when a user specifies a value for the nologo parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. + LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. @@ -627,9 +637,10 @@ Esta marca es experimental y puede que no funcione según lo previsto. - -noLogo Do not display the startup banner and copyright message. + -noLogo[:true|false] Do not display the startup banner and copyright message. + Specify -nologo:false to explicitly show the logo. - noLogo No mostrar la pancarta de inicio ni el mensaje de copyright. + noLogo No mostrar la pancarta de inicio ni el mensaje de copyright. LOCALIZATION: The following should not be localized: diff --git a/src/MSBuild/Resources/xlf/Strings.fr.xlf b/src/MSBuild/Resources/xlf/Strings.fr.xlf index 00cd4da7e61..3e18f74dcfc 100644 --- a/src/MSBuild/Resources/xlf/Strings.fr.xlf +++ b/src/MSBuild/Resources/xlf/Strings.fr.xlf @@ -302,6 +302,16 @@ futures UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. This error is shown when a user specifies a value for the lowPriority parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + + + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + + {StrBegin="MSBUILD : error MSB1071: "} + UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. + This error is shown when a user specifies a value for the nologo parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. + LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. @@ -628,9 +638,10 @@ Cet indicateur est expérimental et peut ne pas fonctionner comme prévu. - -noLogo Do not display the startup banner and copyright message. + -noLogo[:true|false] Do not display the startup banner and copyright message. + Specify -nologo:false to explicitly show the logo. - -noLogo Ne pas afficher la bannière de démarrage ni le message de copyright. + -noLogo Ne pas afficher la bannière de démarrage ni le message de copyright. LOCALIZATION: The following should not be localized: diff --git a/src/MSBuild/Resources/xlf/Strings.it.xlf b/src/MSBuild/Resources/xlf/Strings.it.xlf index d4b6bfaab00..5beff58d304 100644 --- a/src/MSBuild/Resources/xlf/Strings.it.xlf +++ b/src/MSBuild/Resources/xlf/Strings.it.xlf @@ -302,6 +302,16 @@ Questo flag è sperimentale e potrebbe non funzionare come previsto. UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. This error is shown when a user specifies a value for the lowPriority parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + + + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + + {StrBegin="MSBUILD : error MSB1071: "} + UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. + This error is shown when a user specifies a value for the nologo parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. + LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. @@ -633,9 +643,10 @@ Questo flag è sperimentale e potrebbe non funzionare come previsto. - -noLogo Do not display the startup banner and copyright message. + -noLogo[:true|false] Do not display the startup banner and copyright message. + Specify -nologo:false to explicitly show the logo. - -noLogo Evita la visualizzazione del messaggio di avvio e di + -noLogo Evita la visualizzazione del messaggio di avvio e di copyright. diff --git a/src/MSBuild/Resources/xlf/Strings.ja.xlf b/src/MSBuild/Resources/xlf/Strings.ja.xlf index 1cca02400b8..430b2e5b518 100644 --- a/src/MSBuild/Resources/xlf/Strings.ja.xlf +++ b/src/MSBuild/Resources/xlf/Strings.ja.xlf @@ -302,6 +302,16 @@ UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. This error is shown when a user specifies a value for the lowPriority parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + + + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + + {StrBegin="MSBUILD : error MSB1071: "} + UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. + This error is shown when a user specifies a value for the nologo parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. + LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. @@ -628,9 +638,10 @@ - -noLogo Do not display the startup banner and copyright message. + -noLogo[:true|false] Do not display the startup banner and copyright message. + Specify -nologo:false to explicitly show the logo. - -noLogo 著作権情報を表示しません。 + -noLogo 著作権情報を表示しません。 LOCALIZATION: The following should not be localized: diff --git a/src/MSBuild/Resources/xlf/Strings.ko.xlf b/src/MSBuild/Resources/xlf/Strings.ko.xlf index 6bdcb9e62d3..f7c5b073971 100644 --- a/src/MSBuild/Resources/xlf/Strings.ko.xlf +++ b/src/MSBuild/Resources/xlf/Strings.ko.xlf @@ -303,6 +303,16 @@ UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. This error is shown when a user specifies a value for the lowPriority parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + + + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + + {StrBegin="MSBUILD : error MSB1071: "} + UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. + This error is shown when a user specifies a value for the nologo parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. + LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. @@ -629,9 +639,10 @@ - -noLogo Do not display the startup banner and copyright message. + -noLogo[:true|false] Do not display the startup banner and copyright message. + Specify -nologo:false to explicitly show the logo. - -noLogo 시작 배너 및 저작권 메시지를 표시하지 않습니다. + -noLogo 시작 배너 및 저작권 메시지를 표시하지 않습니다. LOCALIZATION: The following should not be localized: diff --git a/src/MSBuild/Resources/xlf/Strings.pl.xlf b/src/MSBuild/Resources/xlf/Strings.pl.xlf index 3ab2e48dd99..c9e311bd847 100644 --- a/src/MSBuild/Resources/xlf/Strings.pl.xlf +++ b/src/MSBuild/Resources/xlf/Strings.pl.xlf @@ -301,6 +301,16 @@ Ta flaga jest eksperymentalna i może nie działać zgodnie z oczekiwaniami. UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. This error is shown when a user specifies a value for the lowPriority parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + + + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + + {StrBegin="MSBUILD : error MSB1071: "} + UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. + This error is shown when a user specifies a value for the nologo parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. + LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. @@ -632,9 +642,10 @@ Ta flaga jest eksperymentalna i może nie działać zgodnie z oczekiwaniami. - -noLogo Do not display the startup banner and copyright message. + -noLogo[:true|false] Do not display the startup banner and copyright message. + Specify -nologo:false to explicitly show the logo. - -nologo Nie wyświetla baneru początkowego ani komunikatu o prawach autorskich. + -nologo Nie wyświetla baneru początkowego ani komunikatu o prawach autorskich. LOCALIZATION: The following should not be localized: diff --git a/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf b/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf index 6e387e7a579..98a94fefe9a 100644 --- a/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf +++ b/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf @@ -301,6 +301,16 @@ UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. This error is shown when a user specifies a value for the lowPriority parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + + + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + + {StrBegin="MSBUILD : error MSB1071: "} + UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. + This error is shown when a user specifies a value for the nologo parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. + LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. @@ -628,9 +638,10 @@ arquivo de resposta. - -noLogo Do not display the startup banner and copyright message. + -noLogo[:true|false] Do not display the startup banner and copyright message. + Specify -nologo:false to explicitly show the logo. - -noLogo Não exibe a faixa de inicialização e a mensagem de direitos autorais. + -noLogo Não exibe a faixa de inicialização e a mensagem de direitos autorais. LOCALIZATION: The following should not be localized: diff --git a/src/MSBuild/Resources/xlf/Strings.ru.xlf b/src/MSBuild/Resources/xlf/Strings.ru.xlf index 1c7590a00bc..1b253cb06d7 100644 --- a/src/MSBuild/Resources/xlf/Strings.ru.xlf +++ b/src/MSBuild/Resources/xlf/Strings.ru.xlf @@ -301,6 +301,16 @@ UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. This error is shown when a user specifies a value for the lowPriority parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + + + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + + {StrBegin="MSBUILD : error MSB1071: "} + UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. + This error is shown when a user specifies a value for the nologo parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. + LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. @@ -626,9 +636,10 @@ - -noLogo Do not display the startup banner and copyright message. + -noLogo[:true|false] Do not display the startup banner and copyright message. + Specify -nologo:false to explicitly show the logo. - -noLogo Не отображать начальный заголовок и сообщение об авторском праве. + -noLogo Не отображать начальный заголовок и сообщение об авторском праве. LOCALIZATION: The following should not be localized: diff --git a/src/MSBuild/Resources/xlf/Strings.tr.xlf b/src/MSBuild/Resources/xlf/Strings.tr.xlf index d68b3cf4e26..166a0f25341 100644 --- a/src/MSBuild/Resources/xlf/Strings.tr.xlf +++ b/src/MSBuild/Resources/xlf/Strings.tr.xlf @@ -301,6 +301,16 @@ UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. This error is shown when a user specifies a value for the lowPriority parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + + + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + + {StrBegin="MSBUILD : error MSB1071: "} + UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. + This error is shown when a user specifies a value for the nologo parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. + LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. @@ -627,9 +637,10 @@ - -noLogo Do not display the startup banner and copyright message. + -noLogo[:true|false] Do not display the startup banner and copyright message. + Specify -nologo:false to explicitly show the logo. - -noLogo Başlangıç başlığını ve telif hakkı iletisini görüntüleme. + -noLogo Başlangıç başlığını ve telif hakkı iletisini görüntüleme. LOCALIZATION: The following should not be localized: diff --git a/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf b/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf index f82f301f5d1..f37ca6d3d68 100644 --- a/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf @@ -301,6 +301,16 @@ UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. This error is shown when a user specifies a value for the lowPriority parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + + + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + + {StrBegin="MSBUILD : error MSB1071: "} + UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. + This error is shown when a user specifies a value for the nologo parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. + LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. @@ -627,9 +637,10 @@ - -noLogo Do not display the startup banner and copyright message. + -noLogo[:true|false] Do not display the startup banner and copyright message. + Specify -nologo:false to explicitly show the logo. - -noLogo 不显示启动版权标志和版权消息。 + -noLogo 不显示启动版权标志和版权消息。 LOCALIZATION: The following should not be localized: diff --git a/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf b/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf index 21444ce978e..dc70955a75e 100644 --- a/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf @@ -302,6 +302,16 @@ UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. This error is shown when a user specifies a value for the lowPriority parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + + + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + MSBUILD : error MSB1071: NoLogo value is not valid. {0} + + {StrBegin="MSBUILD : error MSB1071: "} + UE: This message does not need in-line parameters because the exception takes care of displaying the invalid arg. + This error is shown when a user specifies a value for the nologo parameter that is not equivalent to Boolean.TrueString or Boolean.FalseString. + LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. @@ -628,9 +638,10 @@ - -noLogo Do not display the startup banner and copyright message. + -noLogo[:true|false] Do not display the startup banner and copyright message. + Specify -nologo:false to explicitly show the logo. - -noLogo 不顯示啟動橫幅及著作權訊息。 + -noLogo 不顯示啟動橫幅及著作權訊息。 LOCALIZATION: The following should not be localized: diff --git a/src/MSBuild/XMake.cs b/src/MSBuild/XMake.cs index b1e2f485a27..7bcaa45a432 100644 --- a/src/MSBuild/XMake.cs +++ b/src/MSBuild/XMake.cs @@ -2560,11 +2560,18 @@ private static bool ProcessCommandLineSwitches( bool useTerminalLogger = ProcessTerminalLoggerConfiguration(commandLineSwitches, out string aggregatedTerminalLoggerParameters); + // Process nologo switch early so it can be used in DisplayVersionMessageIfNeeded + bool noLogo = false; + if (commandLineSwitches.IsParameterizedSwitchSet(CommandLineSwitches.ParameterizedSwitch.NoLogo)) + { + noLogo = ProcessBooleanSwitch(commandLineSwitches[CommandLineSwitches.ParameterizedSwitch.NoLogo], defaultValue: true, resourceName: "InvalidNoLogoValue"); + } + // This is temporary until we can remove the need for the environment variable. // DO NOT use this environment variable for any new features as it will be removed without further notice. Environment.SetEnvironmentVariable("_MSBUILDTLENABLED", useTerminalLogger ? "1" : "0"); - DisplayVersionMessageIfNeeded(recursing, useTerminalLogger, commandLineSwitches); + DisplayVersionMessageIfNeeded(recursing, useTerminalLogger, noLogo, commandLineSwitches); // Idle priority would prevent the build from proceeding as the user does normal actions. // This switch is processed early to capture both the command line case (main node should @@ -4657,7 +4664,7 @@ private static void ThrowInvalidToolsVersionInitializationException(IEnumerable< /// /// Displays the application version message/logo. /// - private static void DisplayVersionMessageIfNeeded(bool recursing, bool useTerminalLogger, CommandLineSwitches commandLineSwitches) + private static void DisplayVersionMessageIfNeeded(bool recursing, bool useTerminalLogger, bool noLogo, CommandLineSwitches commandLineSwitches) { if (recursing) { @@ -4668,7 +4675,7 @@ private static void DisplayVersionMessageIfNeeded(bool recursing, bool useTermin // where it is not appropriate to show the versioning information (information querying mode that can be plugged into CLI scripts, // terminal logger mode, where we want to display only the most relevant info, while output is not meant for investigation). // NOTE: response files are not reflected in this check. So enabling TL in response file will lead to version message still being shown. - bool shouldShowLogo = !commandLineSwitches[CommandLineSwitches.ParameterlessSwitch.NoLogo] && + bool shouldShowLogo = !noLogo && !commandLineSwitches.IsParameterizedSwitchSet(CommandLineSwitches.ParameterizedSwitch.Preprocess) && !commandLineSwitches.IsParameterizedSwitchSet(CommandLineSwitches.ParameterizedSwitch.GetProperty) && !commandLineSwitches.IsParameterizedSwitchSet(CommandLineSwitches.ParameterizedSwitch.GetItem) &&