From 7ee3d7a42ccc8f74974b85e045901f2a5472e101 Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Sun, 5 Jan 2020 22:10:03 +0100 Subject: [PATCH 01/31] -targets switch (based on preprocess) --- .../CommandLineSwitches_Tests.cs | 25 +++++++++++++++++++ src/MSBuild/CommandLineSwitches.cs | 2 ++ 2 files changed, 27 insertions(+) diff --git a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs index 1377a3153bf..95d8888c777 100644 --- a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs +++ b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs @@ -731,6 +731,31 @@ public void PreprocessSwitchIdentificationTests() Assert.True(unquoteParameters); } + [Fact] + public void TargetsSwitchIdentificationTests() + { + CommandLineSwitches.ParameterizedSwitch parameterizedSwitch; + string duplicateSwitchErrorMessage; + bool multipleParametersAllowed; + string missingParametersErrorMessage; + bool unquoteParameters; + bool emptyParametersAllowed; + + Assert.True(CommandLineSwitches.IsParameterizedSwitch("targets", out parameterizedSwitch, out duplicateSwitchErrorMessage, out multipleParametersAllowed, out missingParametersErrorMessage, out unquoteParameters, out emptyParametersAllowed)); + Assert.Equal(CommandLineSwitches.ParameterizedSwitch.Targets, parameterizedSwitch); + Assert.Null(duplicateSwitchErrorMessage); + Assert.False(multipleParametersAllowed); + Assert.Null(missingParametersErrorMessage); + Assert.True(unquoteParameters); + + Assert.True(CommandLineSwitches.IsParameterizedSwitch("ts", out parameterizedSwitch, out duplicateSwitchErrorMessage, out multipleParametersAllowed, out missingParametersErrorMessage, out unquoteParameters, out emptyParametersAllowed)); + Assert.Equal(CommandLineSwitches.ParameterizedSwitch.Targets, parameterizedSwitch); + Assert.Null(duplicateSwitchErrorMessage); + Assert.False(multipleParametersAllowed); + Assert.Null(missingParametersErrorMessage); + Assert.True(unquoteParameters); + } + [Fact] public void IsolateProjectsSwitchIdentificationTests() { diff --git a/src/MSBuild/CommandLineSwitches.cs b/src/MSBuild/CommandLineSwitches.cs index 7737542607f..e986b475459 100644 --- a/src/MSBuild/CommandLineSwitches.cs +++ b/src/MSBuild/CommandLineSwitches.cs @@ -93,6 +93,7 @@ internal enum ParameterizedSwitch FileLoggerParameters9, NodeReuse, Preprocess, + Targets, WarningsAsErrors, WarningsAsMessages, BinaryLogger, @@ -261,6 +262,7 @@ bool emptyParametersAllowed new ParameterizedSwitchInfo( new string[] { "fileloggerparameters9", "flp9" }, ParameterizedSwitch.FileLoggerParameters9, null, false, "MissingFileLoggerParameterError", true, false ), new ParameterizedSwitchInfo( new string[] { "nodereuse", "nr" }, ParameterizedSwitch.NodeReuse, null, false, "MissingNodeReuseParameterError", true, false ), new ParameterizedSwitchInfo( new string[] { "preprocess", "pp" }, ParameterizedSwitch.Preprocess, null, false, null, true, false ), + new ParameterizedSwitchInfo( new string[] { "targets", "ts" }, ParameterizedSwitch.Targets, null, false, null, true, false ), new ParameterizedSwitchInfo( new string[] { "warnaserror", "err" }, ParameterizedSwitch.WarningsAsErrors, null, true, null, true, true ), new ParameterizedSwitchInfo( new string[] { "warnasmessage", "nowarn" }, ParameterizedSwitch.WarningsAsMessages, null, true, "MissingWarnAsMessageParameterError", true, false ), new ParameterizedSwitchInfo( new string[] { "binarylogger", "bl" }, ParameterizedSwitch.BinaryLogger, null, false, null, true, false ), From ebea32f381c1ac6b846b64aa2e2f162e5554b403 Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Sun, 5 Jan 2020 22:12:02 +0100 Subject: [PATCH 02/31] split else to two ifs --- src/MSBuild/XMake.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/MSBuild/XMake.cs b/src/MSBuild/XMake.cs index b23d903fe98..2ca4792fec9 100644 --- a/src/MSBuild/XMake.cs +++ b/src/MSBuild/XMake.cs @@ -1102,7 +1102,8 @@ string outputResultsCache projectCollection.UnloadProject(project); success = true; } - else + + if (!preprocessOnly) { BuildParameters parameters = new BuildParameters(projectCollection); From 587b84dd8b9d4e8f2fd8322e78ce79af300cd8ce Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Mon, 6 Jan 2020 08:57:53 +0100 Subject: [PATCH 03/31] targets switch WIP (calls preprocess for now) - TODO do we need new MSB error code or edit existing message? --- .../CommandLineSwitches_Tests.cs | 1 + src/MSBuild/Resources/Strings.resx | 4 ++ src/MSBuild/XMake.cs | 45 ++++++++++++++++++- 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs index 95d8888c777..64cb42f1e3e 100644 --- a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs +++ b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs @@ -1268,6 +1268,7 @@ public void InvalidToolsVersionErrors() 1, true, new StringWriter(), + new StringWriter(), false, warningsAsErrors: null, warningsAsMessages: null, diff --git a/src/MSBuild/Resources/Strings.resx b/src/MSBuild/Resources/Strings.resx index f6264dbc52f..4c55b58638f 100644 --- a/src/MSBuild/Resources/Strings.resx +++ b/src/MSBuild/Resources/Strings.resx @@ -1154,6 +1154,10 @@ Copyright (C) Microsoft Corporation. All rights reserved. MSBUILD : error MSB1047: File to preprocess to is not valid. {0} {StrBegin="MSBUILD : error MSB1047: "} + + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1021: Cannot create an instance of the logger. {0} diff --git a/src/MSBuild/XMake.cs b/src/MSBuild/XMake.cs index 2ca4792fec9..b1314fc52ef 100644 --- a/src/MSBuild/XMake.cs +++ b/src/MSBuild/XMake.cs @@ -555,6 +555,7 @@ string [] commandLine bool enableNodeReuse = false; #endif TextWriter preprocessWriter = null; + TextWriter targetsWriter = null; bool detailedSummary = false; ISet warningsAsErrors = null; ISet warningsAsMessages = null; @@ -588,6 +589,7 @@ string [] commandLine ref cpuCount, ref enableNodeReuse, ref preprocessWriter, + ref targetsWriter, ref detailedSummary, ref warningsAsErrors, ref warningsAsMessages, @@ -651,6 +653,7 @@ string [] commandLine cpuCount, enableNodeReuse, preprocessWriter, + targetsWriter, detailedSummary, warningsAsErrors, warningsAsMessages, @@ -959,6 +962,7 @@ internal static bool BuildProject int cpuCount, bool enableNodeReuse, TextWriter preprocessWriter, + TextWriter targetsWriter, bool detailedSummary, ISet warningsAsErrors, ISet warningsAsMessages, @@ -1056,6 +1060,7 @@ string outputResultsCache ToolsetDefinitionLocations toolsetDefinitionLocations = ToolsetDefinitionLocations.Default; bool preprocessOnly = preprocessWriter != null && !FileUtilities.IsSolutionFilename(projectFile); + bool targetsOnly = targetsWriter != null && !FileUtilities.IsSolutionFilename(projectFile); projectCollection = new ProjectCollection ( @@ -1103,7 +1108,17 @@ string outputResultsCache success = true; } - if (!preprocessOnly) + if (targetsOnly) + { + Project project = projectCollection.LoadProject(projectFile, globalProperties, toolsVersion); + + project.SaveLogicalProject(targetsWriter); + + projectCollection.UnloadProject(project); + success = true; + } + + if (!preprocessOnly && !targetsOnly) { BuildParameters parameters = new BuildParameters(projectCollection); @@ -2012,6 +2027,7 @@ private static bool ProcessCommandLineSwitches ref int cpuCount, ref bool enableNodeReuse, ref TextWriter preprocessWriter, + ref TextWriter targetsWriter, ref bool detailedSummary, ref ISet warningsAsErrors, ref ISet warningsAsMessages, @@ -2127,6 +2143,7 @@ bool recursing ref cpuCount, ref enableNodeReuse, ref preprocessWriter, + ref targetsWriter, ref detailedSummary, ref warningsAsErrors, ref warningsAsMessages, @@ -2170,6 +2187,13 @@ bool recursing preprocessWriter = ProcessPreprocessSwitch(commandLineSwitches[CommandLineSwitches.ParameterizedSwitch.Preprocess]); } + // determine what if any writer to print targets to + targetsWriter = null; + if (commandLineSwitches.IsParameterizedSwitchSet(CommandLineSwitches.ParameterizedSwitch.Targets)) + { + targetsWriter = ProcessTargetsSwitch(commandLineSwitches[CommandLineSwitches.ParameterizedSwitch.Targets]); + } + detailedSummary = commandLineSwitches.IsParameterlessSwitchSet(CommandLineSwitches.ParameterlessSwitch.DetailedSummary); warningsAsErrors = ProcessWarnAsErrorSwitch(commandLineSwitches); @@ -2333,6 +2357,25 @@ internal static TextWriter ProcessPreprocessSwitch(string[] parameters) return writer; } + internal static TextWriter ProcessTargetsSwitch(string[] parameters) + { + TextWriter writer = Console.Out; + + if (parameters.Length > 0) + { + try + { + writer = FileUtilities.OpenWrite(parameters[parameters.Length - 1], append: false); + } + catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) + { + CommandLineSwitchException.Throw("InvalidTargetsPath", parameters[parameters.Length - 1], ex.Message); + } + } + + return writer; + } + internal static ISet ProcessWarnAsErrorSwitch(CommandLineSwitches commandLineSwitches) { // TODO: Parse an environment variable as well? From 3797c648b603df7f1ffe4b373019fff1ad7131de Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Mon, 6 Jan 2020 09:17:04 +0100 Subject: [PATCH 04/31] print targets --- ref/Microsoft.Build/net/Microsoft.Build.cs | 1 + ref/Microsoft.Build/netstandard/Microsoft.Build.cs | 1 + src/Build/Definition/Project.cs | 5 +++++ src/MSBuild/XMake.cs | 2 +- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ref/Microsoft.Build/net/Microsoft.Build.cs b/ref/Microsoft.Build/net/Microsoft.Build.cs index 468e81171ba..89f0b331489 100644 --- a/ref/Microsoft.Build/net/Microsoft.Build.cs +++ b/ref/Microsoft.Build/net/Microsoft.Build.cs @@ -615,6 +615,7 @@ public Project(System.Xml.XmlReader xmlReader, System.Collections.Generic.IDicti public string GetPropertyValue(string name) { throw null; } public static string GetPropertyValueEscaped(Microsoft.Build.Evaluation.ProjectProperty property) { throw null; } public void MarkDirty() { } + public void PrintTargets(System.IO.TextWriter writer) { } public void ReevaluateIfNecessary() { } public void ReevaluateIfNecessary(Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) { } public bool RemoveGlobalProperty(string name) { throw null; } diff --git a/ref/Microsoft.Build/netstandard/Microsoft.Build.cs b/ref/Microsoft.Build/netstandard/Microsoft.Build.cs index 2c95428417c..4c99d69334e 100644 --- a/ref/Microsoft.Build/netstandard/Microsoft.Build.cs +++ b/ref/Microsoft.Build/netstandard/Microsoft.Build.cs @@ -615,6 +615,7 @@ public Project(System.Xml.XmlReader xmlReader, System.Collections.Generic.IDicti public string GetPropertyValue(string name) { throw null; } public static string GetPropertyValueEscaped(Microsoft.Build.Evaluation.ProjectProperty property) { throw null; } public void MarkDirty() { } + public void PrintTargets(System.IO.TextWriter writer) { } public void ReevaluateIfNecessary() { } public void ReevaluateIfNecessary(Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) { } public bool RemoveGlobalProperty(string name) { throw null; } diff --git a/src/Build/Definition/Project.cs b/src/Build/Definition/Project.cs index c78efde3e19..c3964994753 100644 --- a/src/Build/Definition/Project.cs +++ b/src/Build/Definition/Project.cs @@ -1417,6 +1417,11 @@ public void SaveLogicalProject(TextWriter writer) implementation.SaveLogicalProject(writer); } + public void PrintTargets(TextWriter writer) + { + writer.WriteLine(string.Join(Environment.NewLine, Targets.Keys)); + } + /// /// Starts a build using this project, building the default targets. /// Returns true on success, false on failure. diff --git a/src/MSBuild/XMake.cs b/src/MSBuild/XMake.cs index b1314fc52ef..5985974b13a 100644 --- a/src/MSBuild/XMake.cs +++ b/src/MSBuild/XMake.cs @@ -1112,7 +1112,7 @@ string outputResultsCache { Project project = projectCollection.LoadProject(projectFile, globalProperties, toolsVersion); - project.SaveLogicalProject(targetsWriter); + project.PrintTargets(targetsWriter); projectCollection.UnloadProject(project); success = true; From d38368671c8cbce1fcc6780c20cec57eb923da72 Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Mon, 6 Jan 2020 11:42:40 +0100 Subject: [PATCH 05/31] update autogenerated localization files --- src/MSBuild/Resources/xlf/Strings.cs.xlf | 5 +++++ src/MSBuild/Resources/xlf/Strings.de.xlf | 5 +++++ src/MSBuild/Resources/xlf/Strings.en.xlf | 5 +++++ src/MSBuild/Resources/xlf/Strings.es.xlf | 5 +++++ src/MSBuild/Resources/xlf/Strings.fr.xlf | 5 +++++ src/MSBuild/Resources/xlf/Strings.it.xlf | 5 +++++ src/MSBuild/Resources/xlf/Strings.ja.xlf | 5 +++++ src/MSBuild/Resources/xlf/Strings.ko.xlf | 5 +++++ src/MSBuild/Resources/xlf/Strings.pl.xlf | 5 +++++ src/MSBuild/Resources/xlf/Strings.pt-BR.xlf | 5 +++++ src/MSBuild/Resources/xlf/Strings.ru.xlf | 5 +++++ src/MSBuild/Resources/xlf/Strings.tr.xlf | 5 +++++ src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf | 5 +++++ src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf | 5 +++++ 14 files changed, 70 insertions(+) diff --git a/src/MSBuild/Resources/xlf/Strings.cs.xlf b/src/MSBuild/Resources/xlf/Strings.cs.xlf index 55ee7f162c7..6160eaae159 100644 --- a/src/MSBuild/Resources/xlf/Strings.cs.xlf +++ b/src/MSBuild/Resources/xlf/Strings.cs.xlf @@ -1010,6 +1010,11 @@ Copyright (C) Microsoft Corporation. Všechna práva vyhrazena. LOCALIZATION: {0} contains the invalid switch text. + + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: Hodnota ToolsVersion je neplatná. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.de.xlf b/src/MSBuild/Resources/xlf/Strings.de.xlf index 9a0e8175ed5..e47ee72287d 100644 --- a/src/MSBuild/Resources/xlf/Strings.de.xlf +++ b/src/MSBuild/Resources/xlf/Strings.de.xlf @@ -1002,6 +1002,11 @@ Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten. LOCALIZATION: {0} contains the invalid switch text. + + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: ToolsVersion ist nicht gültig. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.en.xlf b/src/MSBuild/Resources/xlf/Strings.en.xlf index d2b02f83643..7b5bfa7ceb3 100644 --- a/src/MSBuild/Resources/xlf/Strings.en.xlf +++ b/src/MSBuild/Resources/xlf/Strings.en.xlf @@ -1191,6 +1191,11 @@ Copyright (C) Microsoft Corporation. All rights reserved. LOCALIZATION: {0} contains the invalid switch text. + + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: ToolsVersion is not valid. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.es.xlf b/src/MSBuild/Resources/xlf/Strings.es.xlf index b3bd16dc61f..dc94334683e 100644 --- a/src/MSBuild/Resources/xlf/Strings.es.xlf +++ b/src/MSBuild/Resources/xlf/Strings.es.xlf @@ -1011,6 +1011,11 @@ Copyright (C) Microsoft Corporation. Todos los derechos reservados. LOCALIZATION: {0} contains the invalid switch text. + + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: El valor de ToolsVersion no es válido. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.fr.xlf b/src/MSBuild/Resources/xlf/Strings.fr.xlf index 66ad33ff55b..84e8a3cbb74 100644 --- a/src/MSBuild/Resources/xlf/Strings.fr.xlf +++ b/src/MSBuild/Resources/xlf/Strings.fr.xlf @@ -1003,6 +1003,11 @@ Copyright (C) Microsoft Corporation. Tous droits réservés. LOCALIZATION: {0} contains the invalid switch text. + + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: ToolsVersion n'est pas valide. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.it.xlf b/src/MSBuild/Resources/xlf/Strings.it.xlf index f07e1e72f15..2250c8bd3ba 100644 --- a/src/MSBuild/Resources/xlf/Strings.it.xlf +++ b/src/MSBuild/Resources/xlf/Strings.it.xlf @@ -1023,6 +1023,11 @@ Copyright (C) Microsoft Corporation. Tutti i diritti sono riservati. LOCALIZATION: {0} contains the invalid switch text. + + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: ToolsVersion non valido. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.ja.xlf b/src/MSBuild/Resources/xlf/Strings.ja.xlf index 08d074660fa..c8cfb97868a 100644 --- a/src/MSBuild/Resources/xlf/Strings.ja.xlf +++ b/src/MSBuild/Resources/xlf/Strings.ja.xlf @@ -1002,6 +1002,11 @@ Copyright (C) Microsoft Corporation.All rights reserved. LOCALIZATION: {0} contains the invalid switch text. + + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: ToolsVersion が無効です。{0} diff --git a/src/MSBuild/Resources/xlf/Strings.ko.xlf b/src/MSBuild/Resources/xlf/Strings.ko.xlf index 7a9e974a300..a3425922587 100644 --- a/src/MSBuild/Resources/xlf/Strings.ko.xlf +++ b/src/MSBuild/Resources/xlf/Strings.ko.xlf @@ -1002,6 +1002,11 @@ Copyright (C) Microsoft Corporation. All rights reserved. LOCALIZATION: {0} contains the invalid switch text. + + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: ToolsVersion이 잘못되었습니다. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.pl.xlf b/src/MSBuild/Resources/xlf/Strings.pl.xlf index 20e14e249ea..e152aa0b220 100644 --- a/src/MSBuild/Resources/xlf/Strings.pl.xlf +++ b/src/MSBuild/Resources/xlf/Strings.pl.xlf @@ -1015,6 +1015,11 @@ Copyright (C) Microsoft Corporation. Wszelkie prawa zastrzeżone. LOCALIZATION: {0} contains the invalid switch text. + + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: wartość ToolsVersion jest nieprawidłowa. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf b/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf index c2662353c95..d0663923ecc 100644 --- a/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf +++ b/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf @@ -1003,6 +1003,11 @@ isoladamente. LOCALIZATION: {0} contains the invalid switch text. + + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: ToolsVersion inválido. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.ru.xlf b/src/MSBuild/Resources/xlf/Strings.ru.xlf index 19e1b8317b4..320c48eb238 100644 --- a/src/MSBuild/Resources/xlf/Strings.ru.xlf +++ b/src/MSBuild/Resources/xlf/Strings.ru.xlf @@ -1002,6 +1002,11 @@ Copyright (C) Microsoft Corporation. All rights reserved. LOCALIZATION: {0} contains the invalid switch text. + + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: недопустимая версия ToolsVersion. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.tr.xlf b/src/MSBuild/Resources/xlf/Strings.tr.xlf index 2934b787256..01ceb2f5918 100644 --- a/src/MSBuild/Resources/xlf/Strings.tr.xlf +++ b/src/MSBuild/Resources/xlf/Strings.tr.xlf @@ -1006,6 +1006,11 @@ Telif Hakkı (C) Microsoft Corporation. Tüm hakları saklıdır. LOCALIZATION: {0} contains the invalid switch text. + + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: ToolsVersion geçerli değil. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf b/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf index 9cc5916e76c..7ac13e91466 100644 --- a/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf @@ -1002,6 +1002,11 @@ Copyright (C) Microsoft Corporation. All rights reserved. LOCALIZATION: {0} contains the invalid switch text. + + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: ToolsVersion 无效。{0} diff --git a/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf b/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf index 74dab4cf855..a854e720cd0 100644 --- a/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf @@ -1002,6 +1002,11 @@ Copyright (C) Microsoft Corporation. 著作權所有,並保留一切權利。 LOCALIZATION: {0} contains the invalid switch text. + + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + MSBUILD : error MSB1047: File to print targets to is not valid. {0} + {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: ToolsVersion 無效。{0} From 825069e3c91712451efa85caba76fb75b7524e8b Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Mon, 6 Jan 2020 12:50:14 +0100 Subject: [PATCH 06/31] help for -targets --- src/MSBuild/Resources/Strings.resx | 16 ++++++++++++++++ src/MSBuild/XMake.cs | 1 + 2 files changed, 17 insertions(+) diff --git a/src/MSBuild/Resources/Strings.resx b/src/MSBuild/Resources/Strings.resx index 4c55b58638f..ec22eaadb73 100644 --- a/src/MSBuild/Resources/Strings.resx +++ b/src/MSBuild/Resources/Strings.resx @@ -787,6 +787,22 @@ Copyright (C) Microsoft Corporation. All rights reserved. LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + + LOCALIZATION: "MSBuild" should not be localized. + LOCALIZATION: "-targets" and "-ts" should not be localized. + LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. + + MSBUILD : Configuration error MSB1043: The application could not start. {0} diff --git a/src/MSBuild/XMake.cs b/src/MSBuild/XMake.cs index 5985974b13a..dea55cd58d4 100644 --- a/src/MSBuild/XMake.cs +++ b/src/MSBuild/XMake.cs @@ -3706,6 +3706,7 @@ private static void ShowHelpMessage() Console.WriteLine(AssemblyResources.GetString("HelpMessage_24_NodeReuse")); #endif Console.WriteLine(AssemblyResources.GetString("HelpMessage_25_PreprocessSwitch")); + Console.WriteLine(AssemblyResources.GetString("HelpMessage_37_TargetsSwitch")); Console.WriteLine(AssemblyResources.GetString("HelpMessage_26_DetailedSummarySwitch")); Console.WriteLine(AssemblyResources.GetString("HelpMessage_31_RestoreSwitch")); From fb441875fb8837eac5fc73e7974c098d84be5c72 Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Mon, 6 Jan 2020 12:50:24 +0100 Subject: [PATCH 07/31] update autogenerated localization files --- src/MSBuild/Resources/xlf/Strings.cs.xlf | 25 +++++++++++++++++++ src/MSBuild/Resources/xlf/Strings.de.xlf | 25 +++++++++++++++++++ src/MSBuild/Resources/xlf/Strings.en.xlf | 25 +++++++++++++++++++ src/MSBuild/Resources/xlf/Strings.es.xlf | 25 +++++++++++++++++++ src/MSBuild/Resources/xlf/Strings.fr.xlf | 25 +++++++++++++++++++ src/MSBuild/Resources/xlf/Strings.it.xlf | 25 +++++++++++++++++++ src/MSBuild/Resources/xlf/Strings.ja.xlf | 25 +++++++++++++++++++ src/MSBuild/Resources/xlf/Strings.ko.xlf | 25 +++++++++++++++++++ src/MSBuild/Resources/xlf/Strings.pl.xlf | 25 +++++++++++++++++++ src/MSBuild/Resources/xlf/Strings.pt-BR.xlf | 25 +++++++++++++++++++ src/MSBuild/Resources/xlf/Strings.ru.xlf | 25 +++++++++++++++++++ src/MSBuild/Resources/xlf/Strings.tr.xlf | 25 +++++++++++++++++++ src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf | 25 +++++++++++++++++++ src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf | 25 +++++++++++++++++++ 14 files changed, 350 insertions(+) diff --git a/src/MSBuild/Resources/xlf/Strings.cs.xlf b/src/MSBuild/Resources/xlf/Strings.cs.xlf index 6160eaae159..e792d4deb89 100644 --- a/src/MSBuild/Resources/xlf/Strings.cs.xlf +++ b/src/MSBuild/Resources/xlf/Strings.cs.xlf @@ -171,6 +171,31 @@ Copyright (C) Microsoft Corporation. Všechna práva vyhrazena. LOCALIZATION: "MSBuild" should not be localized. LOCALIZATION: "-graphBuild" and "-graph" should not be localized. LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. + + + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + + LOCALIZATION: "MSBuild" should not be localized. + LOCALIZATION: "-targets" and "-ts" should not be localized. + LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. diff --git a/src/MSBuild/Resources/xlf/Strings.de.xlf b/src/MSBuild/Resources/xlf/Strings.de.xlf index e47ee72287d..a2f495a69a2 100644 --- a/src/MSBuild/Resources/xlf/Strings.de.xlf +++ b/src/MSBuild/Resources/xlf/Strings.de.xlf @@ -171,6 +171,31 @@ Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten. LOCALIZATION: "MSBuild" should not be localized. LOCALIZATION: "-graphBuild" and "-graph" should not be localized. LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. + + + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + + LOCALIZATION: "MSBuild" should not be localized. + LOCALIZATION: "-targets" and "-ts" should not be localized. + LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. diff --git a/src/MSBuild/Resources/xlf/Strings.en.xlf b/src/MSBuild/Resources/xlf/Strings.en.xlf index 7b5bfa7ceb3..c93d0b3a7b6 100644 --- a/src/MSBuild/Resources/xlf/Strings.en.xlf +++ b/src/MSBuild/Resources/xlf/Strings.en.xlf @@ -181,6 +181,31 @@ Copyright (C) Microsoft Corporation. All rights reserved. LOCALIZATION: "MSBuild" should not be localized. LOCALIZATION: "-graphBuild" and "-graph" should not be localized. LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. + + + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + + LOCALIZATION: "MSBuild" should not be localized. + LOCALIZATION: "-targets" and "-ts" should not be localized. + LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. diff --git a/src/MSBuild/Resources/xlf/Strings.es.xlf b/src/MSBuild/Resources/xlf/Strings.es.xlf index dc94334683e..7e63db76605 100644 --- a/src/MSBuild/Resources/xlf/Strings.es.xlf +++ b/src/MSBuild/Resources/xlf/Strings.es.xlf @@ -171,6 +171,31 @@ Copyright (C) Microsoft Corporation. Todos los derechos reservados. LOCALIZATION: "MSBuild" should not be localized. LOCALIZATION: "-graphBuild" and "-graph" should not be localized. LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. + + + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + + LOCALIZATION: "MSBuild" should not be localized. + LOCALIZATION: "-targets" and "-ts" should not be localized. + LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. diff --git a/src/MSBuild/Resources/xlf/Strings.fr.xlf b/src/MSBuild/Resources/xlf/Strings.fr.xlf index 84e8a3cbb74..46f21e927d6 100644 --- a/src/MSBuild/Resources/xlf/Strings.fr.xlf +++ b/src/MSBuild/Resources/xlf/Strings.fr.xlf @@ -171,6 +171,31 @@ Copyright (C) Microsoft Corporation. Tous droits réservés. LOCALIZATION: "MSBuild" should not be localized. LOCALIZATION: "-graphBuild" and "-graph" should not be localized. LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. + + + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + + LOCALIZATION: "MSBuild" should not be localized. + LOCALIZATION: "-targets" and "-ts" should not be localized. + LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. diff --git a/src/MSBuild/Resources/xlf/Strings.it.xlf b/src/MSBuild/Resources/xlf/Strings.it.xlf index 2250c8bd3ba..bd3223fcca0 100644 --- a/src/MSBuild/Resources/xlf/Strings.it.xlf +++ b/src/MSBuild/Resources/xlf/Strings.it.xlf @@ -178,6 +178,31 @@ Copyright (C) Microsoft Corporation. Tutti i diritti sono riservati. LOCALIZATION: "MSBuild" should not be localized. LOCALIZATION: "-graphBuild" and "-graph" should not be localized. LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. + + + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + + LOCALIZATION: "MSBuild" should not be localized. + LOCALIZATION: "-targets" and "-ts" should not be localized. + LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. diff --git a/src/MSBuild/Resources/xlf/Strings.ja.xlf b/src/MSBuild/Resources/xlf/Strings.ja.xlf index c8cfb97868a..ce85469290f 100644 --- a/src/MSBuild/Resources/xlf/Strings.ja.xlf +++ b/src/MSBuild/Resources/xlf/Strings.ja.xlf @@ -171,6 +171,31 @@ Copyright (C) Microsoft Corporation.All rights reserved. LOCALIZATION: "MSBuild" should not be localized. LOCALIZATION: "-graphBuild" and "-graph" should not be localized. LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. + + + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + + LOCALIZATION: "MSBuild" should not be localized. + LOCALIZATION: "-targets" and "-ts" should not be localized. + LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. diff --git a/src/MSBuild/Resources/xlf/Strings.ko.xlf b/src/MSBuild/Resources/xlf/Strings.ko.xlf index a3425922587..4e5461c4e11 100644 --- a/src/MSBuild/Resources/xlf/Strings.ko.xlf +++ b/src/MSBuild/Resources/xlf/Strings.ko.xlf @@ -171,6 +171,31 @@ Copyright (C) Microsoft Corporation. All rights reserved. LOCALIZATION: "MSBuild" should not be localized. LOCALIZATION: "-graphBuild" and "-graph" should not be localized. LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. + + + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + + LOCALIZATION: "MSBuild" should not be localized. + LOCALIZATION: "-targets" and "-ts" should not be localized. + LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. diff --git a/src/MSBuild/Resources/xlf/Strings.pl.xlf b/src/MSBuild/Resources/xlf/Strings.pl.xlf index e152aa0b220..ec28d3d76cb 100644 --- a/src/MSBuild/Resources/xlf/Strings.pl.xlf +++ b/src/MSBuild/Resources/xlf/Strings.pl.xlf @@ -178,6 +178,31 @@ Copyright (C) Microsoft Corporation. Wszelkie prawa zastrzeżone. LOCALIZATION: "MSBuild" should not be localized. LOCALIZATION: "-graphBuild" and "-graph" should not be localized. LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. + + + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + + LOCALIZATION: "MSBuild" should not be localized. + LOCALIZATION: "-targets" and "-ts" should not be localized. + LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. diff --git a/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf b/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf index d0663923ecc..d221690ceb5 100644 --- a/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf +++ b/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf @@ -172,6 +172,31 @@ isoladamente. LOCALIZATION: "MSBuild" should not be localized. LOCALIZATION: "-graphBuild" and "-graph" should not be localized. LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. + + + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + + LOCALIZATION: "MSBuild" should not be localized. + LOCALIZATION: "-targets" and "-ts" should not be localized. + LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. diff --git a/src/MSBuild/Resources/xlf/Strings.ru.xlf b/src/MSBuild/Resources/xlf/Strings.ru.xlf index 320c48eb238..b8b074e155e 100644 --- a/src/MSBuild/Resources/xlf/Strings.ru.xlf +++ b/src/MSBuild/Resources/xlf/Strings.ru.xlf @@ -170,6 +170,31 @@ Copyright (C) Microsoft Corporation. All rights reserved. LOCALIZATION: "MSBuild" should not be localized. LOCALIZATION: "-graphBuild" and "-graph" should not be localized. LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. + + + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + + LOCALIZATION: "MSBuild" should not be localized. + LOCALIZATION: "-targets" and "-ts" should not be localized. + LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. diff --git a/src/MSBuild/Resources/xlf/Strings.tr.xlf b/src/MSBuild/Resources/xlf/Strings.tr.xlf index 01ceb2f5918..11c62427970 100644 --- a/src/MSBuild/Resources/xlf/Strings.tr.xlf +++ b/src/MSBuild/Resources/xlf/Strings.tr.xlf @@ -171,6 +171,31 @@ Telif Hakkı (C) Microsoft Corporation. Tüm hakları saklıdır. LOCALIZATION: "MSBuild" should not be localized. LOCALIZATION: "-graphBuild" and "-graph" should not be localized. LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. + + + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + + LOCALIZATION: "MSBuild" should not be localized. + LOCALIZATION: "-targets" and "-ts" should not be localized. + LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. diff --git a/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf b/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf index 7ac13e91466..2d5de97a4e9 100644 --- a/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf @@ -171,6 +171,31 @@ Copyright (C) Microsoft Corporation. All rights reserved. LOCALIZATION: "MSBuild" should not be localized. LOCALIZATION: "-graphBuild" and "-graph" should not be localized. LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. + + + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + + LOCALIZATION: "MSBuild" should not be localized. + LOCALIZATION: "-targets" and "-ts" should not be localized. + LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. diff --git a/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf b/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf index a854e720cd0..967ee84c033 100644 --- a/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf @@ -171,6 +171,31 @@ Copyright (C) Microsoft Corporation. 著作權所有,並保留一切權利。 LOCALIZATION: "MSBuild" should not be localized. LOCALIZATION: "-graphBuild" and "-graph" should not be localized. LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. + + + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + -targets[:file] + Prints a list of available targets without executing the + actual build process. By default the output is written to + the console window. If the path to an output file + is provided that will be used instead. + (Short form: -ts) + Example: + -ts:out.txt + + + LOCALIZATION: "MSBuild" should not be localized. + LOCALIZATION: "-targets" and "-ts" should not be localized. + LOCALIZATION: None of the lines should be longer than a standard width console window, eg 80 chars. From 2c9ec9e1f90655b03a88bb3ca67527bd0f445eb8 Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Thu, 9 Jan 2020 11:43:54 +0100 Subject: [PATCH 08/31] fix PR comment: error message and number --- src/MSBuild/Resources/Strings.resx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MSBuild/Resources/Strings.resx b/src/MSBuild/Resources/Strings.resx index ec22eaadb73..105173217f5 100644 --- a/src/MSBuild/Resources/Strings.resx +++ b/src/MSBuild/Resources/Strings.resx @@ -1171,8 +1171,8 @@ Copyright (C) Microsoft Corporation. All rights reserved. {StrBegin="MSBUILD : error MSB1047: "} - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} @@ -1249,7 +1249,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. From 5f2bace0e5f75d90ed026d7103556b84797ddbfe Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Thu, 9 Jan 2020 11:44:04 +0100 Subject: [PATCH 09/31] update autogenerated localization files --- src/MSBuild/Resources/xlf/Strings.cs.xlf | 6 +++--- src/MSBuild/Resources/xlf/Strings.de.xlf | 6 +++--- src/MSBuild/Resources/xlf/Strings.en.xlf | 6 +++--- src/MSBuild/Resources/xlf/Strings.es.xlf | 6 +++--- src/MSBuild/Resources/xlf/Strings.fr.xlf | 6 +++--- src/MSBuild/Resources/xlf/Strings.it.xlf | 6 +++--- src/MSBuild/Resources/xlf/Strings.ja.xlf | 6 +++--- src/MSBuild/Resources/xlf/Strings.ko.xlf | 6 +++--- src/MSBuild/Resources/xlf/Strings.pl.xlf | 6 +++--- src/MSBuild/Resources/xlf/Strings.pt-BR.xlf | 6 +++--- src/MSBuild/Resources/xlf/Strings.ru.xlf | 6 +++--- src/MSBuild/Resources/xlf/Strings.tr.xlf | 6 +++--- src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf | 6 +++--- src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf | 6 +++--- 14 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/MSBuild/Resources/xlf/Strings.cs.xlf b/src/MSBuild/Resources/xlf/Strings.cs.xlf index e792d4deb89..50ef99633c6 100644 --- a/src/MSBuild/Resources/xlf/Strings.cs.xlf +++ b/src/MSBuild/Resources/xlf/Strings.cs.xlf @@ -1036,9 +1036,9 @@ Copyright (C) Microsoft Corporation. Všechna práva vyhrazena. - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} MSBUILD : error MSB1040: ToolsVersion is not valid. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.de.xlf b/src/MSBuild/Resources/xlf/Strings.de.xlf index a2f495a69a2..422fb0fdbe7 100644 --- a/src/MSBuild/Resources/xlf/Strings.de.xlf +++ b/src/MSBuild/Resources/xlf/Strings.de.xlf @@ -1028,9 +1028,9 @@ Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten. - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} MSBUILD : error MSB1040: ToolsVersion is not valid. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.en.xlf b/src/MSBuild/Resources/xlf/Strings.en.xlf index c93d0b3a7b6..f138bc75e71 100644 --- a/src/MSBuild/Resources/xlf/Strings.en.xlf +++ b/src/MSBuild/Resources/xlf/Strings.en.xlf @@ -1217,9 +1217,9 @@ Copyright (C) Microsoft Corporation. All rights reserved. - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} MSBUILD : error MSB1040: ToolsVersion is not valid. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.es.xlf b/src/MSBuild/Resources/xlf/Strings.es.xlf index 7e63db76605..b1dbd3932e0 100644 --- a/src/MSBuild/Resources/xlf/Strings.es.xlf +++ b/src/MSBuild/Resources/xlf/Strings.es.xlf @@ -1037,9 +1037,9 @@ Copyright (C) Microsoft Corporation. Todos los derechos reservados. - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} MSBUILD : error MSB1040: ToolsVersion is not valid. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.fr.xlf b/src/MSBuild/Resources/xlf/Strings.fr.xlf index 46f21e927d6..cfe9f7dd3ec 100644 --- a/src/MSBuild/Resources/xlf/Strings.fr.xlf +++ b/src/MSBuild/Resources/xlf/Strings.fr.xlf @@ -1029,9 +1029,9 @@ Copyright (C) Microsoft Corporation. Tous droits réservés. - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} MSBUILD : error MSB1040: ToolsVersion is not valid. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.it.xlf b/src/MSBuild/Resources/xlf/Strings.it.xlf index bd3223fcca0..5a4fcf6f728 100644 --- a/src/MSBuild/Resources/xlf/Strings.it.xlf +++ b/src/MSBuild/Resources/xlf/Strings.it.xlf @@ -1049,9 +1049,9 @@ Copyright (C) Microsoft Corporation. Tutti i diritti sono riservati. - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} MSBUILD : error MSB1040: ToolsVersion is not valid. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.ja.xlf b/src/MSBuild/Resources/xlf/Strings.ja.xlf index ce85469290f..049c4792c4d 100644 --- a/src/MSBuild/Resources/xlf/Strings.ja.xlf +++ b/src/MSBuild/Resources/xlf/Strings.ja.xlf @@ -1028,9 +1028,9 @@ Copyright (C) Microsoft Corporation.All rights reserved. - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} MSBUILD : error MSB1040: ToolsVersion is not valid. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.ko.xlf b/src/MSBuild/Resources/xlf/Strings.ko.xlf index 4e5461c4e11..058c60b9542 100644 --- a/src/MSBuild/Resources/xlf/Strings.ko.xlf +++ b/src/MSBuild/Resources/xlf/Strings.ko.xlf @@ -1028,9 +1028,9 @@ Copyright (C) Microsoft Corporation. All rights reserved. - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} MSBUILD : error MSB1040: ToolsVersion is not valid. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.pl.xlf b/src/MSBuild/Resources/xlf/Strings.pl.xlf index ec28d3d76cb..e31a67529a8 100644 --- a/src/MSBuild/Resources/xlf/Strings.pl.xlf +++ b/src/MSBuild/Resources/xlf/Strings.pl.xlf @@ -1041,9 +1041,9 @@ Copyright (C) Microsoft Corporation. Wszelkie prawa zastrzeżone. - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} MSBUILD : error MSB1040: ToolsVersion is not valid. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf b/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf index d221690ceb5..7b60eac0326 100644 --- a/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf +++ b/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf @@ -1029,9 +1029,9 @@ isoladamente. - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} MSBUILD : error MSB1040: ToolsVersion is not valid. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.ru.xlf b/src/MSBuild/Resources/xlf/Strings.ru.xlf index b8b074e155e..49aef39385b 100644 --- a/src/MSBuild/Resources/xlf/Strings.ru.xlf +++ b/src/MSBuild/Resources/xlf/Strings.ru.xlf @@ -1028,9 +1028,9 @@ Copyright (C) Microsoft Corporation. All rights reserved. - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} MSBUILD : error MSB1040: ToolsVersion is not valid. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.tr.xlf b/src/MSBuild/Resources/xlf/Strings.tr.xlf index 11c62427970..b270cf0a226 100644 --- a/src/MSBuild/Resources/xlf/Strings.tr.xlf +++ b/src/MSBuild/Resources/xlf/Strings.tr.xlf @@ -1032,9 +1032,9 @@ Telif Hakkı (C) Microsoft Corporation. Tüm hakları saklıdır. - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} MSBUILD : error MSB1040: ToolsVersion is not valid. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf b/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf index 2d5de97a4e9..821575c7e6d 100644 --- a/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf @@ -1028,9 +1028,9 @@ Copyright (C) Microsoft Corporation. All rights reserved. - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} MSBUILD : error MSB1040: ToolsVersion is not valid. {0} diff --git a/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf b/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf index 967ee84c033..fab81adba16 100644 --- a/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf @@ -1028,9 +1028,9 @@ Copyright (C) Microsoft Corporation. 著作權所有,並保留一切權利。 - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - MSBUILD : error MSB1047: File to print targets to is not valid. {0} - {StrBegin="MSBUILD : error MSB1047: "} + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} MSBUILD : error MSB1040: ToolsVersion is not valid. {0} From ea11ce4b7380c9b7c77ab4bdc3f50c52cf7f959c Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Thu, 9 Jan 2020 12:57:50 +0100 Subject: [PATCH 10/31] convert duplicated test code to parametrized test --- .../CommandLineSwitches_Tests.cs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs index 64cb42f1e3e..d2ed5b8769b 100644 --- a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs +++ b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs @@ -731,8 +731,10 @@ public void PreprocessSwitchIdentificationTests() Assert.True(unquoteParameters); } - [Fact] - public void TargetsSwitchIdentificationTests() + [Theory] + [InlineData("targets")] + [InlineData("ts")] + public void TargetsSwitchIdentificationTests(string @switch) { CommandLineSwitches.ParameterizedSwitch parameterizedSwitch; string duplicateSwitchErrorMessage; @@ -741,14 +743,7 @@ public void TargetsSwitchIdentificationTests() bool unquoteParameters; bool emptyParametersAllowed; - Assert.True(CommandLineSwitches.IsParameterizedSwitch("targets", out parameterizedSwitch, out duplicateSwitchErrorMessage, out multipleParametersAllowed, out missingParametersErrorMessage, out unquoteParameters, out emptyParametersAllowed)); - Assert.Equal(CommandLineSwitches.ParameterizedSwitch.Targets, parameterizedSwitch); - Assert.Null(duplicateSwitchErrorMessage); - Assert.False(multipleParametersAllowed); - Assert.Null(missingParametersErrorMessage); - Assert.True(unquoteParameters); - - Assert.True(CommandLineSwitches.IsParameterizedSwitch("ts", out parameterizedSwitch, out duplicateSwitchErrorMessage, out multipleParametersAllowed, out missingParametersErrorMessage, out unquoteParameters, out emptyParametersAllowed)); + Assert.True(CommandLineSwitches.IsParameterizedSwitch(@switch, out parameterizedSwitch, out duplicateSwitchErrorMessage, out multipleParametersAllowed, out missingParametersErrorMessage, out unquoteParameters, out emptyParametersAllowed)); Assert.Equal(CommandLineSwitches.ParameterizedSwitch.Targets, parameterizedSwitch); Assert.Null(duplicateSwitchErrorMessage); Assert.False(multipleParametersAllowed); From 18241d5dfd0eec07dff03fc241124d8c337c485f Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Thu, 9 Jan 2020 12:58:57 +0100 Subject: [PATCH 11/31] wrap parameters --- src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs index d2ed5b8769b..5b0f95f14be 100644 --- a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs +++ b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs @@ -743,7 +743,14 @@ public void TargetsSwitchIdentificationTests(string @switch) bool unquoteParameters; bool emptyParametersAllowed; - Assert.True(CommandLineSwitches.IsParameterizedSwitch(@switch, out parameterizedSwitch, out duplicateSwitchErrorMessage, out multipleParametersAllowed, out missingParametersErrorMessage, out unquoteParameters, out emptyParametersAllowed)); + Assert.True(CommandLineSwitches.IsParameterizedSwitch( + @switch, + out parameterizedSwitch, + out duplicateSwitchErrorMessage, + out multipleParametersAllowed, + out missingParametersErrorMessage, + out unquoteParameters, + out emptyParametersAllowed)); Assert.Equal(CommandLineSwitches.ParameterizedSwitch.Targets, parameterizedSwitch); Assert.Null(duplicateSwitchErrorMessage); Assert.False(multipleParametersAllowed); From e89762439d8ca4039f0e9e0d63ba5c27274e0b60 Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Thu, 9 Jan 2020 12:59:30 +0100 Subject: [PATCH 12/31] fix PR comment: inline out vars --- .../CommandLineSwitches_Tests.cs | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs index 5b0f95f14be..6920544b074 100644 --- a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs +++ b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs @@ -736,21 +736,14 @@ public void PreprocessSwitchIdentificationTests() [InlineData("ts")] public void TargetsSwitchIdentificationTests(string @switch) { - CommandLineSwitches.ParameterizedSwitch parameterizedSwitch; - string duplicateSwitchErrorMessage; - bool multipleParametersAllowed; - string missingParametersErrorMessage; - bool unquoteParameters; - bool emptyParametersAllowed; - Assert.True(CommandLineSwitches.IsParameterizedSwitch( @switch, - out parameterizedSwitch, - out duplicateSwitchErrorMessage, - out multipleParametersAllowed, - out missingParametersErrorMessage, - out unquoteParameters, - out emptyParametersAllowed)); + out var parameterizedSwitch, + out var duplicateSwitchErrorMessage, + out var multipleParametersAllowed, + out var missingParametersErrorMessage, + out var unquoteParameters, + out var emptyParametersAllowed)); Assert.Equal(CommandLineSwitches.ParameterizedSwitch.Targets, parameterizedSwitch); Assert.Null(duplicateSwitchErrorMessage); Assert.False(multipleParametersAllowed); From 85b4fe81cf7a97a87e4a1aee40d0223a27c0731c Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Thu, 9 Jan 2020 13:01:19 +0100 Subject: [PATCH 13/31] fix PR comment: use Shouldly --- src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs index 6920544b074..e06b81c19c2 100644 --- a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs +++ b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs @@ -736,19 +736,19 @@ public void PreprocessSwitchIdentificationTests() [InlineData("ts")] public void TargetsSwitchIdentificationTests(string @switch) { - Assert.True(CommandLineSwitches.IsParameterizedSwitch( + CommandLineSwitches.IsParameterizedSwitch( @switch, out var parameterizedSwitch, out var duplicateSwitchErrorMessage, out var multipleParametersAllowed, out var missingParametersErrorMessage, out var unquoteParameters, - out var emptyParametersAllowed)); - Assert.Equal(CommandLineSwitches.ParameterizedSwitch.Targets, parameterizedSwitch); - Assert.Null(duplicateSwitchErrorMessage); - Assert.False(multipleParametersAllowed); - Assert.Null(missingParametersErrorMessage); - Assert.True(unquoteParameters); + out var emptyParametersAllowed).ShouldBeTrue(); + parameterizedSwitch.ShouldBe(CommandLineSwitches.ParameterizedSwitch.Targets); + duplicateSwitchErrorMessage.ShouldBeNull(); + multipleParametersAllowed.ShouldBeFalse(); + missingParametersErrorMessage.ShouldBeNull(); + unquoteParameters.ShouldBeTrue(); } [Fact] From 4ce6130ea40c3a3be06ce0d525e337e532dae55b Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Thu, 9 Jan 2020 13:04:37 +0100 Subject: [PATCH 14/31] also assert emptyParametersAllowed - it was missing from original test --- src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs index e06b81c19c2..8e2077e54a6 100644 --- a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs +++ b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs @@ -749,6 +749,7 @@ public void TargetsSwitchIdentificationTests(string @switch) multipleParametersAllowed.ShouldBeFalse(); missingParametersErrorMessage.ShouldBeNull(); unquoteParameters.ShouldBeTrue(); + emptyParametersAllowed.ShouldBeFalse(); } [Fact] From a7d46bc4b5b09a7943a369cd60e6e34706e80f73 Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Thu, 9 Jan 2020 13:42:37 +0100 Subject: [PATCH 15/31] fix PR comment: add test for failure and filename --- .../CommandLineSwitches_Tests.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs index 8e2077e54a6..68845ff5b2f 100644 --- a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs +++ b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs @@ -752,6 +752,25 @@ public void TargetsSwitchIdentificationTests(string @switch) emptyParametersAllowed.ShouldBeFalse(); } + [Fact] + public void TargetsSwitchParameter() + { + CommandLineSwitches switches = new CommandLineSwitches(); + MSBuildApp.GatherCommandLineSwitches(new ArrayList() { "/targets:targets.txt" }, switches); + + switches.HaveErrors().ShouldBeFalse(); + switches[CommandLineSwitches.ParameterizedSwitch.Targets].ShouldBe(new[] { "targets.txt" }); + } + + [Fact] + public void TargetsSwitchDoesNotSupportMultipleOccurrences() + { + CommandLineSwitches switches = new CommandLineSwitches(); + MSBuildApp.GatherCommandLineSwitches(new ArrayList() { "/targets /targets" }, switches); + + switches.HaveErrors().ShouldBeTrue(); + } + [Fact] public void IsolateProjectsSwitchIdentificationTests() { From 75049d6e9fff8a800cf3622c9a5e92b61749354a Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Sun, 2 Feb 2020 17:55:00 +0100 Subject: [PATCH 16/31] Revert "fix PR comment: add test for failure and filename" This reverts commit a7d46bc4b5b09a7943a369cd60e6e34706e80f73. --- .../CommandLineSwitches_Tests.cs | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs index 68845ff5b2f..8e2077e54a6 100644 --- a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs +++ b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs @@ -752,25 +752,6 @@ public void TargetsSwitchIdentificationTests(string @switch) emptyParametersAllowed.ShouldBeFalse(); } - [Fact] - public void TargetsSwitchParameter() - { - CommandLineSwitches switches = new CommandLineSwitches(); - MSBuildApp.GatherCommandLineSwitches(new ArrayList() { "/targets:targets.txt" }, switches); - - switches.HaveErrors().ShouldBeFalse(); - switches[CommandLineSwitches.ParameterizedSwitch.Targets].ShouldBe(new[] { "targets.txt" }); - } - - [Fact] - public void TargetsSwitchDoesNotSupportMultipleOccurrences() - { - CommandLineSwitches switches = new CommandLineSwitches(); - MSBuildApp.GatherCommandLineSwitches(new ArrayList() { "/targets /targets" }, switches); - - switches.HaveErrors().ShouldBeTrue(); - } - [Fact] public void IsolateProjectsSwitchIdentificationTests() { From f9d33f5a5a9c1aa3c0722ecbec1614b666f0930e Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Sun, 2 Feb 2020 17:55:53 +0100 Subject: [PATCH 17/31] Revert "also assert emptyParametersAllowed" This reverts commit 4ce6130ea40c3a3be06ce0d525e337e532dae55b. --- src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs index 8e2077e54a6..e06b81c19c2 100644 --- a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs +++ b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs @@ -749,7 +749,6 @@ public void TargetsSwitchIdentificationTests(string @switch) multipleParametersAllowed.ShouldBeFalse(); missingParametersErrorMessage.ShouldBeNull(); unquoteParameters.ShouldBeTrue(); - emptyParametersAllowed.ShouldBeFalse(); } [Fact] From 123897afab138f380de795dcc861db2a7b641459 Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Sun, 2 Feb 2020 17:56:15 +0100 Subject: [PATCH 18/31] Revert "fix PR comment: use Shouldly" This reverts commit 85b4fe81cf7a97a87e4a1aee40d0223a27c0731c. --- src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs index e06b81c19c2..6920544b074 100644 --- a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs +++ b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs @@ -736,19 +736,19 @@ public void PreprocessSwitchIdentificationTests() [InlineData("ts")] public void TargetsSwitchIdentificationTests(string @switch) { - CommandLineSwitches.IsParameterizedSwitch( + Assert.True(CommandLineSwitches.IsParameterizedSwitch( @switch, out var parameterizedSwitch, out var duplicateSwitchErrorMessage, out var multipleParametersAllowed, out var missingParametersErrorMessage, out var unquoteParameters, - out var emptyParametersAllowed).ShouldBeTrue(); - parameterizedSwitch.ShouldBe(CommandLineSwitches.ParameterizedSwitch.Targets); - duplicateSwitchErrorMessage.ShouldBeNull(); - multipleParametersAllowed.ShouldBeFalse(); - missingParametersErrorMessage.ShouldBeNull(); - unquoteParameters.ShouldBeTrue(); + out var emptyParametersAllowed)); + Assert.Equal(CommandLineSwitches.ParameterizedSwitch.Targets, parameterizedSwitch); + Assert.Null(duplicateSwitchErrorMessage); + Assert.False(multipleParametersAllowed); + Assert.Null(missingParametersErrorMessage); + Assert.True(unquoteParameters); } [Fact] From c435a1e59539752e5e58b59e6418b0e20af38c04 Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Sun, 2 Feb 2020 17:56:37 +0100 Subject: [PATCH 19/31] Revert "fix PR comment: inline out vars" This reverts commit e89762439d8ca4039f0e9e0d63ba5c27274e0b60. --- .../CommandLineSwitches_Tests.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs index 6920544b074..5b0f95f14be 100644 --- a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs +++ b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs @@ -736,14 +736,21 @@ public void PreprocessSwitchIdentificationTests() [InlineData("ts")] public void TargetsSwitchIdentificationTests(string @switch) { + CommandLineSwitches.ParameterizedSwitch parameterizedSwitch; + string duplicateSwitchErrorMessage; + bool multipleParametersAllowed; + string missingParametersErrorMessage; + bool unquoteParameters; + bool emptyParametersAllowed; + Assert.True(CommandLineSwitches.IsParameterizedSwitch( @switch, - out var parameterizedSwitch, - out var duplicateSwitchErrorMessage, - out var multipleParametersAllowed, - out var missingParametersErrorMessage, - out var unquoteParameters, - out var emptyParametersAllowed)); + out parameterizedSwitch, + out duplicateSwitchErrorMessage, + out multipleParametersAllowed, + out missingParametersErrorMessage, + out unquoteParameters, + out emptyParametersAllowed)); Assert.Equal(CommandLineSwitches.ParameterizedSwitch.Targets, parameterizedSwitch); Assert.Null(duplicateSwitchErrorMessage); Assert.False(multipleParametersAllowed); From 1278bcbee517118d732f2b438319bfaef0275442 Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Sun, 2 Feb 2020 17:58:09 +0100 Subject: [PATCH 20/31] Revert "wrap parameters" This reverts commit 18241d5dfd0eec07dff03fc241124d8c337c485f. --- src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs index 5b0f95f14be..d2ed5b8769b 100644 --- a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs +++ b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs @@ -743,14 +743,7 @@ public void TargetsSwitchIdentificationTests(string @switch) bool unquoteParameters; bool emptyParametersAllowed; - Assert.True(CommandLineSwitches.IsParameterizedSwitch( - @switch, - out parameterizedSwitch, - out duplicateSwitchErrorMessage, - out multipleParametersAllowed, - out missingParametersErrorMessage, - out unquoteParameters, - out emptyParametersAllowed)); + Assert.True(CommandLineSwitches.IsParameterizedSwitch(@switch, out parameterizedSwitch, out duplicateSwitchErrorMessage, out multipleParametersAllowed, out missingParametersErrorMessage, out unquoteParameters, out emptyParametersAllowed)); Assert.Equal(CommandLineSwitches.ParameterizedSwitch.Targets, parameterizedSwitch); Assert.Null(duplicateSwitchErrorMessage); Assert.False(multipleParametersAllowed); From 2846f5e7b5f7bd48095ec835b3574df1f85f8c21 Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Sun, 2 Feb 2020 17:58:35 +0100 Subject: [PATCH 21/31] Revert "convert duplicated test code to parametrized test" This reverts commit ea11ce4b7380c9b7c77ab4bdc3f50c52cf7f959c. --- .../CommandLineSwitches_Tests.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs index d2ed5b8769b..64cb42f1e3e 100644 --- a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs +++ b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs @@ -731,10 +731,8 @@ public void PreprocessSwitchIdentificationTests() Assert.True(unquoteParameters); } - [Theory] - [InlineData("targets")] - [InlineData("ts")] - public void TargetsSwitchIdentificationTests(string @switch) + [Fact] + public void TargetsSwitchIdentificationTests() { CommandLineSwitches.ParameterizedSwitch parameterizedSwitch; string duplicateSwitchErrorMessage; @@ -743,7 +741,14 @@ public void TargetsSwitchIdentificationTests(string @switch) bool unquoteParameters; bool emptyParametersAllowed; - Assert.True(CommandLineSwitches.IsParameterizedSwitch(@switch, out parameterizedSwitch, out duplicateSwitchErrorMessage, out multipleParametersAllowed, out missingParametersErrorMessage, out unquoteParameters, out emptyParametersAllowed)); + Assert.True(CommandLineSwitches.IsParameterizedSwitch("targets", out parameterizedSwitch, out duplicateSwitchErrorMessage, out multipleParametersAllowed, out missingParametersErrorMessage, out unquoteParameters, out emptyParametersAllowed)); + Assert.Equal(CommandLineSwitches.ParameterizedSwitch.Targets, parameterizedSwitch); + Assert.Null(duplicateSwitchErrorMessage); + Assert.False(multipleParametersAllowed); + Assert.Null(missingParametersErrorMessage); + Assert.True(unquoteParameters); + + Assert.True(CommandLineSwitches.IsParameterizedSwitch("ts", out parameterizedSwitch, out duplicateSwitchErrorMessage, out multipleParametersAllowed, out missingParametersErrorMessage, out unquoteParameters, out emptyParametersAllowed)); Assert.Equal(CommandLineSwitches.ParameterizedSwitch.Targets, parameterizedSwitch); Assert.Null(duplicateSwitchErrorMessage); Assert.False(multipleParametersAllowed); From 756840f02f87680abc069c503d1c15dc2b0bef18 Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Sun, 2 Feb 2020 18:02:45 +0100 Subject: [PATCH 22/31] revert test code from commit "-targets switch (based on preprocess)" --- .../CommandLineSwitches_Tests.cs | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs index 64cb42f1e3e..29931444d46 100644 --- a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs +++ b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs @@ -731,31 +731,6 @@ public void PreprocessSwitchIdentificationTests() Assert.True(unquoteParameters); } - [Fact] - public void TargetsSwitchIdentificationTests() - { - CommandLineSwitches.ParameterizedSwitch parameterizedSwitch; - string duplicateSwitchErrorMessage; - bool multipleParametersAllowed; - string missingParametersErrorMessage; - bool unquoteParameters; - bool emptyParametersAllowed; - - Assert.True(CommandLineSwitches.IsParameterizedSwitch("targets", out parameterizedSwitch, out duplicateSwitchErrorMessage, out multipleParametersAllowed, out missingParametersErrorMessage, out unquoteParameters, out emptyParametersAllowed)); - Assert.Equal(CommandLineSwitches.ParameterizedSwitch.Targets, parameterizedSwitch); - Assert.Null(duplicateSwitchErrorMessage); - Assert.False(multipleParametersAllowed); - Assert.Null(missingParametersErrorMessage); - Assert.True(unquoteParameters); - - Assert.True(CommandLineSwitches.IsParameterizedSwitch("ts", out parameterizedSwitch, out duplicateSwitchErrorMessage, out multipleParametersAllowed, out missingParametersErrorMessage, out unquoteParameters, out emptyParametersAllowed)); - Assert.Equal(CommandLineSwitches.ParameterizedSwitch.Targets, parameterizedSwitch); - Assert.Null(duplicateSwitchErrorMessage); - Assert.False(multipleParametersAllowed); - Assert.Null(missingParametersErrorMessage); - Assert.True(unquoteParameters); - } - [Fact] public void IsolateProjectsSwitchIdentificationTests() { From 610a4f166604f0a4fbbd2aec2dd11fc0fb92f247 Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Sun, 2 Feb 2020 18:09:15 +0100 Subject: [PATCH 23/31] readd reverted targets switch tests --- .../CommandLineSwitches_Tests.cs | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs index 4996cd7cc45..de11124f2d9 100644 --- a/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs +++ b/src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs @@ -422,6 +422,47 @@ public void PreprocessSwitchIdentificationTests(string preprocess) unquoteParameters.ShouldBeTrue(); } + [Theory] + [InlineData("targets")] + [InlineData("tArGeTs")] + [InlineData("ts")] + public void TargetsSwitchIdentificationTests(string @switch) + { + CommandLineSwitches.IsParameterizedSwitch( + @switch, + out var parameterizedSwitch, + out var duplicateSwitchErrorMessage, + out var multipleParametersAllowed, + out var missingParametersErrorMessage, + out var unquoteParameters, + out var emptyParametersAllowed).ShouldBeTrue(); + parameterizedSwitch.ShouldBe(CommandLineSwitches.ParameterizedSwitch.Targets); + duplicateSwitchErrorMessage.ShouldBeNull(); + multipleParametersAllowed.ShouldBeFalse(); + missingParametersErrorMessage.ShouldBeNull(); + unquoteParameters.ShouldBeTrue(); + emptyParametersAllowed.ShouldBeFalse(); + } + + [Fact] + public void TargetsSwitchParameter() + { + CommandLineSwitches switches = new CommandLineSwitches(); + MSBuildApp.GatherCommandLineSwitches(new ArrayList() { "/targets:targets.txt" }, switches); + + switches.HaveErrors().ShouldBeFalse(); + switches[CommandLineSwitches.ParameterizedSwitch.Targets].ShouldBe(new[] { "targets.txt" }); + } + + [Fact] + public void TargetsSwitchDoesNotSupportMultipleOccurrences() + { + CommandLineSwitches switches = new CommandLineSwitches(); + MSBuildApp.GatherCommandLineSwitches(new ArrayList() { "/targets /targets" }, switches); + + switches.HaveErrors().ShouldBeTrue(); + } + [Theory] [InlineData("isolate")] [InlineData("ISOLATE")] From 9feb411bfd2001c4a47f17d58150022f4a88daee Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Sun, 2 Feb 2020 18:16:19 +0100 Subject: [PATCH 24/31] replace call to project.PrintTargets with a copy --- src/MSBuild/XMake.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MSBuild/XMake.cs b/src/MSBuild/XMake.cs index 1680296dd96..7d643f2e420 100644 --- a/src/MSBuild/XMake.cs +++ b/src/MSBuild/XMake.cs @@ -1112,7 +1112,7 @@ string outputResultsCache { Project project = projectCollection.LoadProject(projectFile, globalProperties, toolsVersion); - project.PrintTargets(targetsWriter); + targetsWriter.WriteLine(string.Join(Environment.NewLine, project.Targets.Keys)); projectCollection.UnloadProject(project); success = true; From 435ace8cd4124b615608afd246c8b0e730139465 Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Sun, 2 Feb 2020 18:16:37 +0100 Subject: [PATCH 25/31] remove PrintTargets from Project --- ref/Microsoft.Build/net/Microsoft.Build.cs | 1 - ref/Microsoft.Build/netstandard/Microsoft.Build.cs | 1 - src/Build/Definition/Project.cs | 5 ----- 3 files changed, 7 deletions(-) diff --git a/ref/Microsoft.Build/net/Microsoft.Build.cs b/ref/Microsoft.Build/net/Microsoft.Build.cs index 4efc2c2a9d4..f47b211ceb4 100644 --- a/ref/Microsoft.Build/net/Microsoft.Build.cs +++ b/ref/Microsoft.Build/net/Microsoft.Build.cs @@ -615,7 +615,6 @@ public Project(System.Xml.XmlReader xmlReader, System.Collections.Generic.IDicti public string GetPropertyValue(string name) { throw null; } public static string GetPropertyValueEscaped(Microsoft.Build.Evaluation.ProjectProperty property) { throw null; } public void MarkDirty() { } - public void PrintTargets(System.IO.TextWriter writer) { } public void ReevaluateIfNecessary() { } public void ReevaluateIfNecessary(Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) { } public bool RemoveGlobalProperty(string name) { throw null; } diff --git a/ref/Microsoft.Build/netstandard/Microsoft.Build.cs b/ref/Microsoft.Build/netstandard/Microsoft.Build.cs index 287be1139eb..bf01a486b2f 100644 --- a/ref/Microsoft.Build/netstandard/Microsoft.Build.cs +++ b/ref/Microsoft.Build/netstandard/Microsoft.Build.cs @@ -615,7 +615,6 @@ public Project(System.Xml.XmlReader xmlReader, System.Collections.Generic.IDicti public string GetPropertyValue(string name) { throw null; } public static string GetPropertyValueEscaped(Microsoft.Build.Evaluation.ProjectProperty property) { throw null; } public void MarkDirty() { } - public void PrintTargets(System.IO.TextWriter writer) { } public void ReevaluateIfNecessary() { } public void ReevaluateIfNecessary(Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) { } public bool RemoveGlobalProperty(string name) { throw null; } diff --git a/src/Build/Definition/Project.cs b/src/Build/Definition/Project.cs index 1f904f39007..c6e666f0c6d 100644 --- a/src/Build/Definition/Project.cs +++ b/src/Build/Definition/Project.cs @@ -1417,11 +1417,6 @@ public void SaveLogicalProject(TextWriter writer) implementation.SaveLogicalProject(writer); } - public void PrintTargets(TextWriter writer) - { - writer.WriteLine(string.Join(Environment.NewLine, Targets.Keys)); - } - /// /// Starts a build using this project, building the default targets. /// Returns true on success, false on failure. From 3a8c58585f33adef4bf8546e78bd3eaadfb34953 Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Sun, 2 Feb 2020 19:37:32 +0100 Subject: [PATCH 26/31] rename resource key to match message --- src/MSBuild/Resources/Strings.resx | 2 +- src/MSBuild/XMake.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MSBuild/Resources/Strings.resx b/src/MSBuild/Resources/Strings.resx index 105173217f5..56e147e274f 100644 --- a/src/MSBuild/Resources/Strings.resx +++ b/src/MSBuild/Resources/Strings.resx @@ -1170,7 +1170,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. MSBUILD : error MSB1047: File to preprocess to is not valid. {0} {StrBegin="MSBUILD : error MSB1047: "} - + MSBUILD : error MSB1059: Targets could not be printed. {0} {StrBegin="MSBUILD : error MSB1059: "} diff --git a/src/MSBuild/XMake.cs b/src/MSBuild/XMake.cs index 7d643f2e420..af266275e71 100644 --- a/src/MSBuild/XMake.cs +++ b/src/MSBuild/XMake.cs @@ -2369,7 +2369,7 @@ internal static TextWriter ProcessTargetsSwitch(string[] parameters) } catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) { - CommandLineSwitchException.Throw("InvalidTargetsPath", parameters[parameters.Length - 1], ex.Message); + CommandLineSwitchException.Throw("TargetsCouldNotBePrinted", parameters[parameters.Length - 1], ex.Message); } } From 31c5b187eb12e40e2e7092fb79cd1f3241ea20ad Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Sun, 2 Feb 2020 19:38:12 +0100 Subject: [PATCH 27/31] update autogenerated localization files --- src/MSBuild/Resources/xlf/Strings.cs.xlf | 10 +++++----- src/MSBuild/Resources/xlf/Strings.de.xlf | 10 +++++----- src/MSBuild/Resources/xlf/Strings.en.xlf | 10 +++++----- src/MSBuild/Resources/xlf/Strings.es.xlf | 10 +++++----- src/MSBuild/Resources/xlf/Strings.fr.xlf | 10 +++++----- src/MSBuild/Resources/xlf/Strings.it.xlf | 10 +++++----- src/MSBuild/Resources/xlf/Strings.ja.xlf | 10 +++++----- src/MSBuild/Resources/xlf/Strings.ko.xlf | 10 +++++----- src/MSBuild/Resources/xlf/Strings.pl.xlf | 10 +++++----- src/MSBuild/Resources/xlf/Strings.pt-BR.xlf | 10 +++++----- src/MSBuild/Resources/xlf/Strings.ru.xlf | 10 +++++----- src/MSBuild/Resources/xlf/Strings.tr.xlf | 10 +++++----- src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf | 10 +++++----- src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf | 10 +++++----- 14 files changed, 70 insertions(+), 70 deletions(-) diff --git a/src/MSBuild/Resources/xlf/Strings.cs.xlf b/src/MSBuild/Resources/xlf/Strings.cs.xlf index 50ef99633c6..fd5167f363c 100644 --- a/src/MSBuild/Resources/xlf/Strings.cs.xlf +++ b/src/MSBuild/Resources/xlf/Strings.cs.xlf @@ -1035,11 +1035,6 @@ Copyright (C) Microsoft Corporation. Všechna práva vyhrazena. LOCALIZATION: {0} contains the invalid switch text. - - MSBUILD : error MSB1059: Targets could not be printed. {0} - MSBUILD : error MSB1059: Targets could not be printed. {0} - {StrBegin="MSBUILD : error MSB1059: "} - MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: Hodnota ToolsVersion je neplatná. {0} @@ -1252,6 +1247,11 @@ Copyright (C) Microsoft Corporation. Všechna práva vyhrazena. that an explicit schema file was passed and existed when the command line parameters were checked but was deleted from disk before this check was made. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} + MSBUILD : error MSB1002: This switch does not take any parameters. MSBUILD : error MSB1002: Pro tento přepínač se nepoužívají žádné parametry. diff --git a/src/MSBuild/Resources/xlf/Strings.de.xlf b/src/MSBuild/Resources/xlf/Strings.de.xlf index 422fb0fdbe7..d9be5d97971 100644 --- a/src/MSBuild/Resources/xlf/Strings.de.xlf +++ b/src/MSBuild/Resources/xlf/Strings.de.xlf @@ -1027,11 +1027,6 @@ Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten. LOCALIZATION: {0} contains the invalid switch text. - - MSBUILD : error MSB1059: Targets could not be printed. {0} - MSBUILD : error MSB1059: Targets could not be printed. {0} - {StrBegin="MSBUILD : error MSB1059: "} - MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: ToolsVersion ist nicht gültig. {0} @@ -1244,6 +1239,11 @@ Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten. that an explicit schema file was passed and existed when the command line parameters were checked but was deleted from disk before this check was made. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} + MSBUILD : error MSB1002: This switch does not take any parameters. MSBUILD : error MSB1002: Der Schalter erlaubt keine Parameter. diff --git a/src/MSBuild/Resources/xlf/Strings.en.xlf b/src/MSBuild/Resources/xlf/Strings.en.xlf index f138bc75e71..44bf57741f8 100644 --- a/src/MSBuild/Resources/xlf/Strings.en.xlf +++ b/src/MSBuild/Resources/xlf/Strings.en.xlf @@ -1216,11 +1216,6 @@ Copyright (C) Microsoft Corporation. All rights reserved. LOCALIZATION: {0} contains the invalid switch text. - - MSBUILD : error MSB1059: Targets could not be printed. {0} - MSBUILD : error MSB1059: Targets could not be printed. {0} - {StrBegin="MSBUILD : error MSB1059: "} - MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: ToolsVersion is not valid. {0} @@ -1433,6 +1428,11 @@ Copyright (C) Microsoft Corporation. All rights reserved. that an explicit schema file was passed and existed when the command line parameters were checked but was deleted from disk before this check was made. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} + MSBUILD : error MSB1002: This switch does not take any parameters. MSBUILD : error MSB1002: This switch does not take any parameters. diff --git a/src/MSBuild/Resources/xlf/Strings.es.xlf b/src/MSBuild/Resources/xlf/Strings.es.xlf index b1dbd3932e0..460eaaaf06b 100644 --- a/src/MSBuild/Resources/xlf/Strings.es.xlf +++ b/src/MSBuild/Resources/xlf/Strings.es.xlf @@ -1036,11 +1036,6 @@ Copyright (C) Microsoft Corporation. Todos los derechos reservados. LOCALIZATION: {0} contains the invalid switch text. - - MSBUILD : error MSB1059: Targets could not be printed. {0} - MSBUILD : error MSB1059: Targets could not be printed. {0} - {StrBegin="MSBUILD : error MSB1059: "} - MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: El valor de ToolsVersion no es válido. {0} @@ -1253,6 +1248,11 @@ Copyright (C) Microsoft Corporation. Todos los derechos reservados. that an explicit schema file was passed and existed when the command line parameters were checked but was deleted from disk before this check was made. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} + MSBUILD : error MSB1002: This switch does not take any parameters. MSBUILD : error MSB1002: Este modificador no tiene ningún parámetro. diff --git a/src/MSBuild/Resources/xlf/Strings.fr.xlf b/src/MSBuild/Resources/xlf/Strings.fr.xlf index cfe9f7dd3ec..f92afe930d0 100644 --- a/src/MSBuild/Resources/xlf/Strings.fr.xlf +++ b/src/MSBuild/Resources/xlf/Strings.fr.xlf @@ -1028,11 +1028,6 @@ Copyright (C) Microsoft Corporation. Tous droits réservés. LOCALIZATION: {0} contains the invalid switch text. - - MSBUILD : error MSB1059: Targets could not be printed. {0} - MSBUILD : error MSB1059: Targets could not be printed. {0} - {StrBegin="MSBUILD : error MSB1059: "} - MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: ToolsVersion n'est pas valide. {0} @@ -1245,6 +1240,11 @@ Copyright (C) Microsoft Corporation. Tous droits réservés. that an explicit schema file was passed and existed when the command line parameters were checked but was deleted from disk before this check was made. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} + MSBUILD : error MSB1002: This switch does not take any parameters. MSBUILD : error MSB1002: Ce commutateur n'accepte aucun paramètre. diff --git a/src/MSBuild/Resources/xlf/Strings.it.xlf b/src/MSBuild/Resources/xlf/Strings.it.xlf index 5a4fcf6f728..1f61c378ae5 100644 --- a/src/MSBuild/Resources/xlf/Strings.it.xlf +++ b/src/MSBuild/Resources/xlf/Strings.it.xlf @@ -1048,11 +1048,6 @@ Copyright (C) Microsoft Corporation. Tutti i diritti sono riservati. LOCALIZATION: {0} contains the invalid switch text. - - MSBUILD : error MSB1059: Targets could not be printed. {0} - MSBUILD : error MSB1059: Targets could not be printed. {0} - {StrBegin="MSBUILD : error MSB1059: "} - MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: ToolsVersion non valido. {0} @@ -1265,6 +1260,11 @@ Copyright (C) Microsoft Corporation. Tutti i diritti sono riservati. that an explicit schema file was passed and existed when the command line parameters were checked but was deleted from disk before this check was made. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} + MSBUILD : error MSB1002: This switch does not take any parameters. MSBUILD : error MSB1002: questa opzione non accetta parametri. diff --git a/src/MSBuild/Resources/xlf/Strings.ja.xlf b/src/MSBuild/Resources/xlf/Strings.ja.xlf index 049c4792c4d..e0011239c1b 100644 --- a/src/MSBuild/Resources/xlf/Strings.ja.xlf +++ b/src/MSBuild/Resources/xlf/Strings.ja.xlf @@ -1027,11 +1027,6 @@ Copyright (C) Microsoft Corporation.All rights reserved. LOCALIZATION: {0} contains the invalid switch text. - - MSBUILD : error MSB1059: Targets could not be printed. {0} - MSBUILD : error MSB1059: Targets could not be printed. {0} - {StrBegin="MSBUILD : error MSB1059: "} - MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: ToolsVersion が無効です。{0} @@ -1244,6 +1239,11 @@ Copyright (C) Microsoft Corporation.All rights reserved. that an explicit schema file was passed and existed when the command line parameters were checked but was deleted from disk before this check was made. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} + MSBUILD : error MSB1002: This switch does not take any parameters. MSBUILD : error MSB1002: このスイッチにはパラメーターを指定できません。 diff --git a/src/MSBuild/Resources/xlf/Strings.ko.xlf b/src/MSBuild/Resources/xlf/Strings.ko.xlf index 058c60b9542..83f84776265 100644 --- a/src/MSBuild/Resources/xlf/Strings.ko.xlf +++ b/src/MSBuild/Resources/xlf/Strings.ko.xlf @@ -1027,11 +1027,6 @@ Copyright (C) Microsoft Corporation. All rights reserved. LOCALIZATION: {0} contains the invalid switch text. - - MSBUILD : error MSB1059: Targets could not be printed. {0} - MSBUILD : error MSB1059: Targets could not be printed. {0} - {StrBegin="MSBUILD : error MSB1059: "} - MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: ToolsVersion이 잘못되었습니다. {0} @@ -1244,6 +1239,11 @@ Copyright (C) Microsoft Corporation. All rights reserved. that an explicit schema file was passed and existed when the command line parameters were checked but was deleted from disk before this check was made. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} + MSBUILD : error MSB1002: This switch does not take any parameters. MSBUILD : error MSB1002: 이 스위치에는 매개 변수를 지정할 수 없습니다. diff --git a/src/MSBuild/Resources/xlf/Strings.pl.xlf b/src/MSBuild/Resources/xlf/Strings.pl.xlf index e31a67529a8..ea179d5db4d 100644 --- a/src/MSBuild/Resources/xlf/Strings.pl.xlf +++ b/src/MSBuild/Resources/xlf/Strings.pl.xlf @@ -1040,11 +1040,6 @@ Copyright (C) Microsoft Corporation. Wszelkie prawa zastrzeżone. LOCALIZATION: {0} contains the invalid switch text. - - MSBUILD : error MSB1059: Targets could not be printed. {0} - MSBUILD : error MSB1059: Targets could not be printed. {0} - {StrBegin="MSBUILD : error MSB1059: "} - MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: wartość ToolsVersion jest nieprawidłowa. {0} @@ -1257,6 +1252,11 @@ Copyright (C) Microsoft Corporation. Wszelkie prawa zastrzeżone. that an explicit schema file was passed and existed when the command line parameters were checked but was deleted from disk before this check was made. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} + MSBUILD : error MSB1002: This switch does not take any parameters. MSBUILD : error MSB1002: ten przełącznik nie ma żadnych parametrów. diff --git a/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf b/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf index 7b60eac0326..69fefac16d2 100644 --- a/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf +++ b/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf @@ -1028,11 +1028,6 @@ isoladamente. LOCALIZATION: {0} contains the invalid switch text. - - MSBUILD : error MSB1059: Targets could not be printed. {0} - MSBUILD : error MSB1059: Targets could not be printed. {0} - {StrBegin="MSBUILD : error MSB1059: "} - MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: ToolsVersion inválido. {0} @@ -1245,6 +1240,11 @@ isoladamente. that an explicit schema file was passed and existed when the command line parameters were checked but was deleted from disk before this check was made. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} + MSBUILD : error MSB1002: This switch does not take any parameters. MSBUILD : error MSB1002: Esta opção não aceita parâmetros. diff --git a/src/MSBuild/Resources/xlf/Strings.ru.xlf b/src/MSBuild/Resources/xlf/Strings.ru.xlf index 49aef39385b..bb45e9181b8 100644 --- a/src/MSBuild/Resources/xlf/Strings.ru.xlf +++ b/src/MSBuild/Resources/xlf/Strings.ru.xlf @@ -1027,11 +1027,6 @@ Copyright (C) Microsoft Corporation. All rights reserved. LOCALIZATION: {0} contains the invalid switch text. - - MSBUILD : error MSB1059: Targets could not be printed. {0} - MSBUILD : error MSB1059: Targets could not be printed. {0} - {StrBegin="MSBUILD : error MSB1059: "} - MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: недопустимая версия ToolsVersion. {0} @@ -1244,6 +1239,11 @@ Copyright (C) Microsoft Corporation. All rights reserved. that an explicit schema file was passed and existed when the command line parameters were checked but was deleted from disk before this check was made. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} + MSBUILD : error MSB1002: This switch does not take any parameters. MSBUILD : error MSB1002: у этого ключа нет параметров. diff --git a/src/MSBuild/Resources/xlf/Strings.tr.xlf b/src/MSBuild/Resources/xlf/Strings.tr.xlf index b270cf0a226..0b99ac73128 100644 --- a/src/MSBuild/Resources/xlf/Strings.tr.xlf +++ b/src/MSBuild/Resources/xlf/Strings.tr.xlf @@ -1031,11 +1031,6 @@ Telif Hakkı (C) Microsoft Corporation. Tüm hakları saklıdır. LOCALIZATION: {0} contains the invalid switch text. - - MSBUILD : error MSB1059: Targets could not be printed. {0} - MSBUILD : error MSB1059: Targets could not be printed. {0} - {StrBegin="MSBUILD : error MSB1059: "} - MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: ToolsVersion geçerli değil. {0} @@ -1248,6 +1243,11 @@ Telif Hakkı (C) Microsoft Corporation. Tüm hakları saklıdır. that an explicit schema file was passed and existed when the command line parameters were checked but was deleted from disk before this check was made. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} + MSBUILD : error MSB1002: This switch does not take any parameters. MSBUILD : error MSB1002: Bu anahtar parametreyle kullanılmaz. diff --git a/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf b/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf index 821575c7e6d..b5267300e6e 100644 --- a/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf @@ -1027,11 +1027,6 @@ Copyright (C) Microsoft Corporation. All rights reserved. LOCALIZATION: {0} contains the invalid switch text. - - MSBUILD : error MSB1059: Targets could not be printed. {0} - MSBUILD : error MSB1059: Targets could not be printed. {0} - {StrBegin="MSBUILD : error MSB1059: "} - MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: ToolsVersion 无效。{0} @@ -1244,6 +1239,11 @@ Copyright (C) Microsoft Corporation. All rights reserved. that an explicit schema file was passed and existed when the command line parameters were checked but was deleted from disk before this check was made. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} + MSBUILD : error MSB1002: This switch does not take any parameters. MSBUILD : error MSB1002: 此开关不采用任何参数。 diff --git a/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf b/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf index fab81adba16..45b0a2ffd93 100644 --- a/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf @@ -1027,11 +1027,6 @@ Copyright (C) Microsoft Corporation. 著作權所有,並保留一切權利。 LOCALIZATION: {0} contains the invalid switch text. - - MSBUILD : error MSB1059: Targets could not be printed. {0} - MSBUILD : error MSB1059: Targets could not be printed. {0} - {StrBegin="MSBUILD : error MSB1059: "} - MSBUILD : error MSB1040: ToolsVersion is not valid. {0} MSBUILD : error MSB1040: ToolsVersion 無效。{0} @@ -1244,6 +1239,11 @@ Copyright (C) Microsoft Corporation. 著作權所有,並保留一切權利。 that an explicit schema file was passed and existed when the command line parameters were checked but was deleted from disk before this check was made. LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:" should not be localized. + + MSBUILD : error MSB1059: Targets could not be printed. {0} + MSBUILD : error MSB1059: Targets could not be printed. {0} + {StrBegin="MSBUILD : error MSB1059: "} + MSBUILD : error MSB1002: This switch does not take any parameters. MSBUILD : error MSB1002: 這個參數不使用任何參數。 From 26742e9c18545502930663616e1dd3001ce50e7f Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Sun, 2 Feb 2020 19:39:20 +0100 Subject: [PATCH 28/31] add error handling for print targets --- src/MSBuild/XMake.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/MSBuild/XMake.cs b/src/MSBuild/XMake.cs index af266275e71..a461337a22d 100644 --- a/src/MSBuild/XMake.cs +++ b/src/MSBuild/XMake.cs @@ -1110,12 +1110,21 @@ string outputResultsCache if (targetsOnly) { - Project project = projectCollection.LoadProject(projectFile, globalProperties, toolsVersion); + try + { + Project project = projectCollection.LoadProject(projectFile, globalProperties, toolsVersion); - targetsWriter.WriteLine(string.Join(Environment.NewLine, project.Targets.Keys)); + targetsWriter.WriteLine(string.Join(Environment.NewLine, project.Targets.Keys)); - projectCollection.UnloadProject(project); - success = true; + projectCollection.UnloadProject(project); + success = true; + } + catch (Exception ex) + { + var message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword("TargetsCouldNotBePrinted", ex.Message); + Console.Error.WriteLine(message); + success = false; + } } if (!preprocessOnly && !targetsOnly) From 9fec2f6be4be2e1afb31eedc388bf7caa2f5dca5 Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Sun, 2 Feb 2020 19:43:42 +0100 Subject: [PATCH 29/31] extract method PrintTargets --- src/MSBuild/XMake.cs | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/MSBuild/XMake.cs b/src/MSBuild/XMake.cs index a461337a22d..906046bcc86 100644 --- a/src/MSBuild/XMake.cs +++ b/src/MSBuild/XMake.cs @@ -1110,21 +1110,7 @@ string outputResultsCache if (targetsOnly) { - try - { - Project project = projectCollection.LoadProject(projectFile, globalProperties, toolsVersion); - - targetsWriter.WriteLine(string.Join(Environment.NewLine, project.Targets.Keys)); - - projectCollection.UnloadProject(project); - success = true; - } - catch (Exception ex) - { - var message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword("TargetsCouldNotBePrinted", ex.Message); - Console.Error.WriteLine(message); - success = false; - } + success = PrintTargets(projectFile, toolsVersion, globalProperties, targetsWriter, projectCollection); } if (!preprocessOnly && !targetsOnly) @@ -1317,6 +1303,25 @@ string outputResultsCache return success; } + private static bool PrintTargets(string projectFile, string toolsVersion, Dictionary globalProperties, TextWriter targetsWriter, ProjectCollection projectCollection) + { + try + { + Project project = projectCollection.LoadProject(projectFile, globalProperties, toolsVersion); + + targetsWriter.WriteLine(string.Join(Environment.NewLine, project.Targets.Keys)); + + projectCollection.UnloadProject(project); + return true; + } + catch (Exception ex) + { + var message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword("TargetsCouldNotBePrinted", ex.Message); + Console.Error.WriteLine(message); + return false; + } + } + private static (BuildResultCode result, Exception exception) ExecuteBuild(BuildManager buildManager, BuildRequestData request) { BuildSubmission submission; From a5f3a023fc277ac12a4b1d919585c7c185c4dc3f Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Wed, 12 Feb 2020 23:02:03 +0100 Subject: [PATCH 30/31] preserve stack trace for easier debug --- src/MSBuild/XMake.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MSBuild/XMake.cs b/src/MSBuild/XMake.cs index a49582ca16c..00b47b2eba9 100644 --- a/src/MSBuild/XMake.cs +++ b/src/MSBuild/XMake.cs @@ -1316,7 +1316,7 @@ private static bool PrintTargets(string projectFile, string toolsVersion, Dictio } catch (Exception ex) { - var message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword("TargetsCouldNotBePrinted", ex.Message); + var message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword("TargetsCouldNotBePrinted", ex); Console.Error.WriteLine(message); return false; } From af52500e435a9461b7343cfb74a5352d9885a1e3 Mon Sep 17 00:00:00 2001 From: Szali Szali Date: Wed, 12 Feb 2020 23:04:11 +0100 Subject: [PATCH 31/31] write targets in a loop --- src/MSBuild/XMake.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/MSBuild/XMake.cs b/src/MSBuild/XMake.cs index 00b47b2eba9..eb2fd268eb6 100644 --- a/src/MSBuild/XMake.cs +++ b/src/MSBuild/XMake.cs @@ -1309,7 +1309,10 @@ private static bool PrintTargets(string projectFile, string toolsVersion, Dictio { Project project = projectCollection.LoadProject(projectFile, globalProperties, toolsVersion); - targetsWriter.WriteLine(string.Join(Environment.NewLine, project.Targets.Keys)); + foreach (string target in project.Targets.Keys) + { + targetsWriter.WriteLine(target); + } projectCollection.UnloadProject(project); return true;