From fe4fde95dee67b8925ff9b22a3d157d1c02e1d7b Mon Sep 17 00:00:00 2001 From: Forgind Date: Mon, 11 Apr 2022 08:44:09 -0700 Subject: [PATCH] Remove opt in for new schema for CombineTargetFrameworkInfoProperties (#6928) * Remove opt in for new schema For CombineTargetFrameworkInfoProperties, we had hit an issue in which a TF could be invalid as an XML root. We changed the schema to let us escape it, then opted into the new schema in the SDK. This removes the option to not opt into the new schema. It's hopefully still ok to do this; though it would have been better to get it into 17.0, I don't think anyone other than the SDK is using this, so I don't think it should matter. * Update src/Tasks/Microsoft.Common.CurrentVersion.targets * Put back attribute * Put in change wave * Update src/Tasks/CombineTargetFrameworkInfoProperties.cs --- src/Framework/ChangeWaves.cs | 3 ++- src/Tasks/CombineTargetFrameworkInfoProperties.cs | 3 ++- src/Tasks/Microsoft.Common.CurrentVersion.targets | 7 +------ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Framework/ChangeWaves.cs b/src/Framework/ChangeWaves.cs index 3ebe0b75ef8..fdaee783af5 100644 --- a/src/Framework/ChangeWaves.cs +++ b/src/Framework/ChangeWaves.cs @@ -26,7 +26,8 @@ internal class ChangeWaves { internal static readonly Version Wave16_10 = new Version(16, 10); internal static readonly Version Wave17_0 = new Version(17, 0); - internal static readonly Version[] AllWaves = { Wave16_10, Wave17_0 }; + internal static readonly Version Wave17_2 = new Version(17, 2); + internal static readonly Version[] AllWaves = { Wave16_10, Wave17_0, Wave17_2 }; /// /// Special value indicating that all features behind all Change Waves should be enabled. diff --git a/src/Tasks/CombineTargetFrameworkInfoProperties.cs b/src/Tasks/CombineTargetFrameworkInfoProperties.cs index 4108feb5246..8171601f284 100644 --- a/src/Tasks/CombineTargetFrameworkInfoProperties.cs +++ b/src/Tasks/CombineTargetFrameworkInfoProperties.cs @@ -39,7 +39,8 @@ public override bool Execute() { if (PropertiesAndValues != null) { - XElement root = UseAttributeForTargetFrameworkInfoPropertyNames ? + // When removing the change wave, also remove UseAttributeForTargetFrameworkInfoPropertyNames. + XElement root = ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_2) || UseAttributeForTargetFrameworkInfoPropertyNames ? new("TargetFramework", new XAttribute("Name", EscapingUtilities.Escape(RootElementName))) : new(RootElementName); diff --git a/src/Tasks/Microsoft.Common.CurrentVersion.targets b/src/Tasks/Microsoft.Common.CurrentVersion.targets index 688da12288b..3410e8d85b4 100644 --- a/src/Tasks/Microsoft.Common.CurrentVersion.targets +++ b/src/Tasks/Microsoft.Common.CurrentVersion.targets @@ -1906,14 +1906,9 @@ Copyright (C) Microsoft Corporation. All rights reserved. - - <_UseAttributeForTargetFrameworkInfoPropertyNames Condition="'$(_UseAttributeForTargetFrameworkInfoPropertyNames)' == ''">false - - + PropertiesAndValues="@(_AdditionalTargetFrameworkInfoPropertyWithValue)">