Skip to content

Commit

Permalink
Show warning when attributes are explicitly requested for an unsuppor…
Browse files Browse the repository at this point in the history
…ted language
  • Loading branch information
jnm2 committed Jul 30, 2020
1 parent 9c943a2 commit edf05ca
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion IDisposableAnalyzers/build/IDisposableAnalyzers.targets
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@
<IncludeOwnershipAttributes Condition="'$(IncludeOwnershipAttributes)' == '' and Exists($(OwnershipAttributesPath))">true</IncludeOwnershipAttributes>
</PropertyGroup>

<ItemGroup Condition="'$(IncludeOwnershipAttributes)' == 'true'">
<ItemGroup Condition="'$(IncludeOwnershipAttributes)' == 'true' and Exists($(OwnershipAttributesPath))">
<Compile Include="$(OwnershipAttributesPath)" Visible="false" />

<!-- Workaround for https://github.com/dotnet/wpf/issues/810 -->
<_GeneratedCodeFiles Include="$(OwnershipAttributesPath)" Visible="false" Condition="'$(UseWPF)' == 'true'" />
</ItemGroup>

<Target Name="OwnershipAttributesRequestedForUnsupportedLanguage"
Condition="'$(IncludeOwnershipAttributes)' == 'true' and !Exists($(OwnershipAttributesPath))"
BeforeTargets="Compile">

<Warning Code="IDISP0026" Text="The project specifies &lt;IncludeOwnershipAttributes&gt;true&lt;/IncludeOwnershipAttributes&gt;, but including attributes in this language is not yet supported." />
</Target>

</Project>

0 comments on commit edf05ca

Please sign in to comment.