Make Roslyn Analyzers opt-in at compile-time (resolves #1813)
They are still run by the IDE at design-time. To opt-in, set the MSBuild property MachineRunAnalyzersDuringBuild. From the command-line, you can do this by adding `/p:MachineRunAnalyzersDuringBuild=true`.
This commit is contained in:
parent
551a7e2893
commit
215de3c0c0
|
@ -8,8 +8,8 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" PrivateAssets="All" />
|
||||
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.113"
|
||||
Condition=" '$(MachineRunAnalyzersDuringBuild)' != '' " />
|
||||
<Compile Include="$(SolutionDir)Version/svnrev.cs" />
|
||||
<Compile Include="$(SolutionDir)Version/VersionInfo.cs" />
|
||||
<Compile Remove="Extensions/BinaryReaderExtensions.cs" />
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
<LangVersion>8.0</LangVersion>
|
||||
<OutputPath>$(SolutionDir)output/dll</OutputPath>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<RunAnalyzersDuringBuild Condition=" '$(MachineRunAnalyzersDuringBuild)' == '' ">false</RunAnalyzersDuringBuild>
|
||||
<RunCodeAnalysis>false</RunCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
@ -21,6 +23,5 @@
|
|||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<AdditionalFiles Include="$(SolutionDir).stylecop.json" />
|
||||
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.113" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -14,7 +14,7 @@ for /f "usebackq tokens=*" %%A in (`vswhere -version "[16.0,17.0)" -requires Mic
|
|||
IF "%MSBUILDPATH%"=="" GOTO MISSINGMSBUILD
|
||||
|
||||
nuget restore ..\BizHawk.sln
|
||||
call "%MSBUILDPATH%" ..\BizHawk.sln /p:Configuration=Release /p:Platform="Any Cpu" /t:rebuild
|
||||
call "%MSBUILDPATH%" ..\BizHawk.sln "/p:Configuration=Release;Platform=AnyCPU;MachineRunAnalyzersDuringBuild=true" /t:rebuild
|
||||
|
||||
@if errorlevel 1 goto MSBUILDFAILED
|
||||
|
||||
|
|
Loading…
Reference in New Issue