Skip to content

Commit

Permalink
Add deprecation warnings for legacy properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Oren Novotny committed Nov 27, 2018
1 parent 22b9d65 commit e5a8b39
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Source/MSBuild.Sdk.Extras/Build/ExtrasShim.targets
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
</PropertyGroup>

<PropertyGroup>
<!-- Gather use of old props for deprecation -->
<_ExtrasEnableWpfProjectSetupWarning Condition="'$(ExtrasEnableWpfProjectSetup)' != ''">true</_ExtrasEnableWpfProjectSetupWarning>
<_ExtrasEnableWinFormsProjectSetupWarning Condition="'$(ExtrasEnableWinFormsProjectSetup)' != ''">true</_ExtrasEnableWinFormsProjectSetupWarning>

<!-- Set SDK Settings based on Extras and vice-versa -->
<UseWpf Condition="'$(UseWpf)' == '' and '$(ExtrasEnableWpfProjectSetup)' == 'true' ">true</UseWpf>
<UseWindowsForms Condition="'$(UseWindowsForms)' == '' and '$(ExtrasEnableWinFormsProjectSetup)' == 'true' ">true</UseWindowsForms>
Expand All @@ -38,6 +42,8 @@
<_SdkObsoleteProperty Include="EnableDefaultWpfItems" Replacement="ExtrasEnableDefaultWpfItems" Condition="'$(EnableDefaultWpfItems)' != ''"/>
<_SdkObsoleteProperty Include="EnableDefaultSettingsItems" Replacement="ExtrasEnableDefaultSettingsItems" Condition="'$(EnableDefaultSettingsItems)' != ''"/>
<_SdkObsoleteProperty Include="EnableEmbeddedResourceGenerator" Replacement="ExtrasEnableEmbeddedResourceCodeGenerator" Condition="'$(EnableEmbeddedResourceGenerator)' != ''"/>
<_SdkObsoleteProperty Include="ExtrasEnableWpfProjectSetup" Replacement="UseWpf" Condition="'$(_ExtrasEnableWpfProjectSetupWarning)' == 'true'"/>
<_SdkObsoleteProperty Include="ExtrasEnableWinFormsProjectSetup" Replacement="UseWindowsForms" Condition="'$(_ExtrasEnableWinFormsProjectSetupWarning)' == 'true'"/>
</ItemGroup>

<Warning Text="The property '%(_SdkObsoleteProperty.Identity)' is deprecated and will be removed in the future. Please use '%(_SdkObsoleteProperty.Replacement)' instead."
Expand Down

0 comments on commit e5a8b39

Please sign in to comment.