Skip to content

Commit

Permalink
Remove opt in for new schema for CombineTargetFrameworkInfoProperties (
Browse files Browse the repository at this point in the history
…#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
  • Loading branch information
Forgind authored Apr 11, 2022
1 parent 4ec1bbd commit fe4fde9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/Framework/ChangeWaves.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

/// <summary>
/// Special value indicating that all features behind all Change Waves should be enabled.
Expand Down
3 changes: 2 additions & 1 deletion src/Tasks/CombineTargetFrameworkInfoProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
7 changes: 1 addition & 6 deletions src/Tasks/Microsoft.Common.CurrentVersion.targets
Original file line number Diff line number Diff line change
Expand Up @@ -1906,14 +1906,9 @@ Copyright (C) Microsoft Corporation. All rights reserved.
</_AdditionalTargetFrameworkInfoPropertyWithValue>
</ItemGroup>

<PropertyGroup>
<_UseAttributeForTargetFrameworkInfoPropertyNames Condition="'$(_UseAttributeForTargetFrameworkInfoPropertyNames)' == ''">false</_UseAttributeForTargetFrameworkInfoPropertyNames>
</PropertyGroup>

<CombineTargetFrameworkInfoProperties
RootElementName="$(TargetFramework)"
PropertiesAndValues="@(_AdditionalTargetFrameworkInfoPropertyWithValue)"
UseAttributeForTargetFrameworkInfoPropertyNames="$(_UseAttributeForTargetFrameworkInfoPropertyNames)">
PropertiesAndValues="@(_AdditionalTargetFrameworkInfoPropertyWithValue)">
<Output TaskParameter="Result"
PropertyName="_AdditionalTargetFrameworkInfoProperties"/>
</CombineTargetFrameworkInfoProperties>
Expand Down

0 comments on commit fe4fde9

Please sign in to comment.