Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ingest and import Windows Forms analyzer props #4605

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions eng/WindowsForms.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project>

<!--
This target *only* validates the content of Microsoft.Private.Winforms NuGet package
to ensure we correctly import and reference props and targets.
-->
<Target Name="_EnsureWindowsFormsPackagingContent" BeforeTargets="IdentifyPackageAssets">
<Error Text="Unable to resolve path to Microsoft.Private.Winforms NuGet package. Is %24(PkgMicrosoft_Private_Winforms) defined?"
Condition="'$(_WinFormsNuGetPath)' == ''"/>

<ItemGroup>
<_WinFormsContent Include="$(_WinFormsContentPath)" />
</ItemGroup>

<Error Text="Microsoft.Private.Winforms NuGet package contains no content. Is this expected?"
Condition="@(_WinFormsContent->Count()) == 0"/>
</Target>

</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<ProjectGuid>{440d06b8-e3de-4c0d-ad25-cd4f43d836e1}</ProjectGuid>
<TargetFramework>net6.0</TargetFramework>
Expand All @@ -25,4 +26,17 @@
<PackagingContent Include="targets\*" SubFolder="root\targets" />
<PackagingContent Include="useSharedDesignerContext.txt" SubFolder="root" />
</ItemGroup>

<!-- Windows Forms specific -->
<Import Project="$(RepositoryEngineeringDir)WindowsForms.targets" />

<PropertyGroup>
<_WinFormsNuGetPath>$(PkgMicrosoft_Private_Winforms)</_WinFormsNuGetPath>
<_WinFormsContentPath>$(_WinFormsNuGetPath)\sdk\dotnet-wpf\*</_WinFormsContentPath>
</PropertyGroup>

<ItemGroup>
<PackagingContent Include="$(_WinFormsContentPath)" SubFolder="root\targets" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,7 @@
<SupportedTargetFramework Remove="@(_UnsupportedNETCoreAppTargetFramework);@(_UnsupportedNETStandardTargetFramework);@(_UnsupportedNETFrameworkTargetFramework)" />
</ItemGroup>

<!-- Import Windows Forms specific props -->
<Import Project="System.Windows.Forms.Analyzers.props" />

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,7 @@
<!-- Import WPF Build logic only when we don't import NETFX's WinFX targets -->
<Import Project="Microsoft.WinFX.targets" Condition="'$(ImportFrameworkWinFXTargets)' != 'true'"/>

<!-- Import Windows Forms specific targets -->
<Import Project="System.Windows.Forms.Analyzers.targets" />

</Project>