-
Notifications
You must be signed in to change notification settings - Fork 42
/
ExtrasShim.targets
54 lines (43 loc) · 4.21 KB
/
ExtrasShim.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<Project InitialTargets="_WarnWhenUsingObsoleteProperties" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ExtrasEmbeddedResourceGeneratedCodeIsPublic Condition="'$(EmbeddedResourceGeneratorVisibilityIsInternal)' == 'true'">false</ExtrasEmbeddedResourceGeneratedCodeIsPublic>
<ExtrasEmbeddedResourceGeneratedCodeIsPublic Condition="'$(EmbeddedResourceGeneratorVisibilityIsInternal)' == 'false'">true</ExtrasEmbeddedResourceGeneratedCodeIsPublic>
</PropertyGroup>
<PropertyGroup>
<ExtrasIgnoreOldSdkWarning>$(SuppressWarnIfOldSdkPack)</ExtrasIgnoreOldSdkWarning>
<ExtrasEnableDefaultWpfItems Condition="'$(EnableDefaultWpfItems)' != ''">$(EnableDefaultWpfItems)</ExtrasEnableDefaultWpfItems>
<ExtrasEnableDefaultSettingsItems Condition="'$(EnableDefaultSettingsItems)' != ''">$(EnableDefaultSettingsItems)</ExtrasEnableDefaultSettingsItems>
<ExtrasEnableEmbeddedResourceCodeGenerator Condition="'$(EnableEmbeddedResourceGenerator)' != ''">$(EnableEmbeddedResourceGenerator)</ExtrasEnableEmbeddedResourceCodeGenerator>
</PropertyGroup>
<PropertyGroup>
<DisableImplicitFrameworkReferences Condition=" '$(ExtrasImplicitPlatformPackageDisabled)' != '' and ('$(_SdkShortFrameworkIdentifier)' == 'uap' OR '$(_SdkShortFrameworkIdentifier)' == 'tizen') ">$(ExtrasImplicitPlatformPackageDisabled)</DisableImplicitFrameworkReferences>
</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>
<!-- Until there's a discreet property for this, default based on Wpf/WinForms -->
<ExtrasUseWindowsDesktopApp Condition="'$(UseWpf)' == 'true' or '$(UseWindowsForms)' == 'true'">true</ExtrasUseWindowsDesktopApp>
<ExtrasUseWindowsDesktopApp Condition="'$(ExtrasUseWindowsDesktopApp)' == '' ">false</ExtrasUseWindowsDesktopApp>
</PropertyGroup>
<Target
Name="_WarnWhenUsingObsoleteProperties"
BeforeTargets="_CheckForInvalidConfigurationAndPlatform"
Condition="'$(_IgnoreObsoletePropertyWarnings)' != 'true'">
<ItemGroup>
<_SdkObsoleteProperty Include="SuppressWarnIfOldSdkPack" Replacement="ExtrasIgnoreOldSdkWarning" Condition="'$(SuppressWarnIfOldSdkPack)' != ''"/>
<_SdkObsoleteProperty Include="ExtrasImplicitPlatformPackageDisabled" Replacement="DisableImplicitFrameworkReferences (with TargetFramework condition)" Condition="'$(ExtrasImplicitPlatformPackageDisabled)' != ''"/>
<_SdkObsoleteProperty Include="EmbeddedResourceGeneratorVisibilityIsInternal" Replacement="ExtrasEmbeddedResourceGeneratedCodeIsPublic" Condition="'$(EmbeddedResourceGeneratorVisibilityIsInternal)' != ''"/>
<_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."
Condition="'%(_SdkObsoleteProperty.Replacement)' != ''"/>
</Target>
</Project>