Skip to content

Commit

Permalink
Resolve trim warnings for the SourceGenerator project by not referenc…
Browse files Browse the repository at this point in the history
…ing the Polyfill package
  • Loading branch information
sveinungf committed Nov 25, 2023
1 parent 7cff36e commit 0a73774
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
</PropertyGroup>

<ItemGroup Condition="'$(MSBuildProjectName)' != 'SpreadCheetah.SourceGenerator.CSharp8Test'">
<ItemGroup Condition="'$(MSBuildProjectName)' != 'SpreadCheetah.SourceGenerator' And '$(MSBuildProjectName)' != 'SpreadCheetah.SourceGenerator.CSharp8Test'">
<PackageReference Include="Polyfill">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#if NETSTANDARD2_0
namespace System.Diagnostics.CodeAnalysis;

[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
internal sealed class NotNullWhenAttribute : Attribute
{
public bool ReturnValue { get; }

public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue;
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<PublishTrimmed>true</PublishTrimmed>
<TrimmerSingleWarn>false</TrimmerSingleWarn>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 0a73774

Please sign in to comment.