Skip to content

Commit 9c0757e

Browse files
committed
fixup! Ingest and import Windows Forms analyzer props
1 parent 0d8dd22 commit 9c0757e

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

eng/WindowsForms.targets

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project>
2+
3+
<!--
4+
This target *only* validates the content of Microsoft.Private.Winforms NuGet package
5+
to ensure we correctly import and reference props and targets.
6+
-->
7+
<Target Name="_EnsureWindowsFormsPackagingContent" BeforeTargets="IdentifyPackageAssets">
8+
<Error Text="Unable to resolve path to Microsoft.Private.Winforms NuGet package. Is %24(PkgMicrosoft_Private_Winforms) defined?"
9+
Condition="'$(_WinFormsNuGetPath)' == ''"/>
10+
11+
<ItemGroup>
12+
<_WinFormsContent Include="$(_WinFormsContentPath)" />
13+
</ItemGroup>
14+
15+
<Error Text="Microsoft.Private.Winforms NuGet package contains no content. Is this expected?"
16+
Condition="@(_WinFormsContent->Count()) == 0"/>
17+
</Target>
18+
19+
</Project>

packaging/Microsoft.NET.Sdk.WindowsDesktop/Microsoft.NET.Sdk.WindowsDesktop.ArchNeutral.csproj

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
23
<PropertyGroup>
34
<ProjectGuid>{440d06b8-e3de-4c0d-ad25-cd4f43d836e1}</ProjectGuid>
45
<TargetFramework>net6.0</TargetFramework>
@@ -27,6 +28,8 @@
2728
</ItemGroup>
2829

2930
<!-- Windows Forms specific -->
31+
<Import Project="$(RepositoryEngineeringDir)WindowsForms.targets" />
32+
3033
<PropertyGroup>
3134
<_WinFormsNuGetPath>$(PkgMicrosoft_Private_Winforms)</_WinFormsNuGetPath>
3235
<_WinFormsContentPath>$(_WinFormsNuGetPath)\sdk\dotnet-wpf\*</_WinFormsContentPath>
@@ -36,19 +39,4 @@
3639
<PackagingContent Include="$(_WinFormsContentPath)" SubFolder="root\targets" />
3740
</ItemGroup>
3841

39-
<!--
40-
This target *only* validates the content of Microsoft.Private.Winforms NuGet package
41-
to ensure we correctly import and reference props and targets.
42-
-->
43-
<Target Name="_EnsureWindowsFormsPackagingContent" BeforeTargets="IdentifyPackageAssets">
44-
<Error Text="Unable to resolve path to Microsoft.Private.Winforms NuGet package. Is %24(PkgMicrosoft_Private_Winforms) defined?"
45-
Condition="'$(_WinFormsNuGetPath)' == ''"/>
46-
47-
<ItemGroup>
48-
<_WinFormsContent Include="$(_WinFormsContentPath)" />
49-
</ItemGroup>
50-
51-
<Error Text="Microsoft.Private.Winforms NuGet package contains no content. Is this expected?"
52-
Condition="@(_WinFormsContent->Count()) == 0"/>
53-
</Target>
5442
</Project>

0 commit comments

Comments
 (0)