From 7293897fe6e7394a40f1d624ac95d0ecd1466430 Mon Sep 17 00:00:00 2001 From: Jan Krivanek Date: Fri, 17 Jan 2025 17:42:21 +0100 Subject: [PATCH 1/2] Adjust embeddedresource culture warning --- src/BuildCheck.UnitTests/EndToEndTests.cs | 2 +- src/Tasks/AssignCulture.cs | 7 ++++++- src/Tasks/Microsoft.Common.CurrentVersion.targets | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/BuildCheck.UnitTests/EndToEndTests.cs b/src/BuildCheck.UnitTests/EndToEndTests.cs index 7a77cf746a1..0b30b8d3a75 100644 --- a/src/BuildCheck.UnitTests/EndToEndTests.cs +++ b/src/BuildCheck.UnitTests/EndToEndTests.cs @@ -169,7 +169,7 @@ private EmbedResourceTestOutput RunEmbeddedResourceTest(string resourceXmlToAdd, _env.SetCurrentDirectory(Path.Combine(workFolder.Path, entryProjectName)); - string output = RunnerUtilities.ExecBootstrapedMSBuild("-check -restore /p:RespectCulture=" + (respectCulture ? "True" : "\"\""), out bool success); + string output = RunnerUtilities.ExecBootstrapedMSBuild("-check -restore /p:WarnOnCultureOverwritten=True /p:RespectCulture=" + (respectCulture ? "True" : "\"\""), out bool success); _env.Output.WriteLine(output); _env.Output.WriteLine("========================="); success.ShouldBeTrue(); diff --git a/src/Tasks/AssignCulture.cs b/src/Tasks/AssignCulture.cs index c5b39e5675c..4c3af84873a 100644 --- a/src/Tasks/AssignCulture.cs +++ b/src/Tasks/AssignCulture.cs @@ -48,6 +48,11 @@ public class AssignCulture : TaskExtension /// public bool RespectAlreadyAssignedItemCulture { get; set; } = false; + /// + /// If the flag set to 'true' the task will log a warning when the culture metadata is overwritten by the task. + /// + public bool WarnOnCultureOverwritten { get; set; } = false; + /// /// This outgoing list of files is exactly the same as the incoming Files /// list except that an attribute name "Culture" will have been added if @@ -160,7 +165,7 @@ public override bool Execute() ConversionUtilities.ValidBooleanFalse(AssignedFiles[i].GetMetadata(ItemMetadataNames.withCulture))); // The culture was explicitly specified, but not opted in via 'RespectAlreadyAssignedItemCulture' and different will be used - if (ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_14) && + if (WarnOnCultureOverwritten && !string.IsNullOrEmpty(existingCulture) && !MSBuildNameIgnoreCaseComparer.Default.Equals(existingCulture, info.culture)) { diff --git a/src/Tasks/Microsoft.Common.CurrentVersion.targets b/src/Tasks/Microsoft.Common.CurrentVersion.targets index 2e40e7cd86c..34456290060 100644 --- a/src/Tasks/Microsoft.Common.CurrentVersion.targets +++ b/src/Tasks/Microsoft.Common.CurrentVersion.targets @@ -3269,6 +3269,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. false + false @@ -3288,7 +3289,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. - + From 0a33c137082d6fe6844b81ad24de4cc37dde0926 Mon Sep 17 00:00:00 2001 From: Jan Krivanek Date: Wed, 22 Jan 2025 12:18:14 +0100 Subject: [PATCH 2/2] Bump version --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 0218d8075b5..12f9c409ae9 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -2,7 +2,7 @@ - 17.13.8 + 17.13.9 release 17.12.6 15.1.0.0