Replace legacy StyleCop(Plus) with StyleCopAnalyzers

Analyzers are enabled in the Debug configuration
only to avoid unnecessary overheads when compiling
normally.
This commit is contained in:
Paul Chote
2019-05-03 21:25:28 +00:00
committed by reaperrr
parent 353db73381
commit ba282865f1
20 changed files with 159 additions and 582 deletions

View File

@@ -11,6 +11,7 @@
<Platforms>x86</Platforms>
<PlatformTarget>x86</PlatformTarget>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<CodeAnalysisRuleSet>..\OpenRA.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<!-- Work around an issue where Rider does not detect files in the project root using the default glob -->
@@ -33,7 +34,15 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenRA.Game\OpenRA.Game.csproj" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
<AdditionalFiles Include="../stylecop.json" />
</ItemGroup>
<Target Name="DisableAnalyzers" BeforeTargets="CoreCompile" Condition="'$(Configuration)'=='Release'">
<!-- Disable code style analysis on Release builds to improve compile-time performance -->
<ItemGroup Condition="'$(Configuration)'=='Release'">
<Analyzer Remove="@(Analyzer)"/>
</ItemGroup>
</Target>
<ItemGroup>
<Content Include="OpenRA.Platforms.Default.dll.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>