Skip to content

Commit a9da442

Browse files
committed
Re-enable polysharp with some types excluded
1 parent 97fa829 commit a9da442

1 file changed

Lines changed: 25 additions & 4 deletions

File tree

src/Oxide.Common.csproj

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
3-
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
4-
<Import Project="..\netfx.props" />
3+
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk"/>
4+
<Import Project="..\netfx.props"/>
55
<PropertyGroup>
66
<Version>2.0.0</Version>
77
<Authors>Oxide Team and Contributors</Authors>
@@ -17,14 +17,35 @@
1717
<RootNamespace>$(MSBuildProjectName.Replace(" ", "_").Replace(".Common", ""))</RootNamespace>
1818
<PackageId>Oxide.Common</PackageId>
1919
<LangVersion>Latest</LangVersion>
20+
<PolySharpUsePublicAccessibilityForGeneratedTypes>True</PolySharpUsePublicAccessibilityForGeneratedTypes>
21+
<PolySharpIncludeRuntimeSupportedAttributes>True</PolySharpIncludeRuntimeSupportedAttributes>
22+
</PropertyGroup>
23+
<PropertyGroup Condition="'$(TargetFramework)' == 'net48'">
24+
<PolySharpExcludeGeneratedTypes>
25+
System.Diagnostics.CodeAnalysis.AllowNullAttribute;
26+
System.Diagnostics.CodeAnalysis.DisallowNullAttribute;
27+
System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute;
28+
System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute;
29+
System.Diagnostics.CodeAnalysis.MaybeNullAttribute;
30+
System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute;
31+
System.Diagnostics.CodeAnalysis.NotNullAttribute;
32+
System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute;
33+
System.Diagnostics.CodeAnalysis.NotNullWhenAttribute;
34+
System.Range;
35+
System.Index;
36+
</PolySharpExcludeGeneratedTypes>
2037
</PropertyGroup>
2138
<ItemGroup>
2239
<PackageReference Include="Oxide.References" Version="2.0.*">
2340
<PrivateAssets>contentfiles;analyzers;build</PrivateAssets>
2441
</PackageReference>
25-
<None Include="..\resources\icon.png" Pack="true" PackagePath="\" />
42+
<None Include="..\resources\icon.png" Pack="true" PackagePath="\"/>
43+
<PackageReference Include="PolySharp" Version="1.15.0">
44+
<PrivateAssets>all</PrivateAssets>
45+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
46+
</PackageReference>
2647
</ItemGroup>
27-
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
48+
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk"/>
2849
<Target Name="ChangeAliasesOfStrongNameAssemblies" BeforeTargets="FindReferenceAssembliesForReferences;ResolveReferences">
2950
<ItemGroup>
3051
<ReferencePath Condition="'%(FileName)' == 'Oxide.References'">

0 commit comments

Comments
 (0)