<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <!-- 
    We should be using $(BuildToolsTaskDir) for this, however we are currently forcing that property to 
    always be net45 (because we use Mono to run our tests and Mono needs to load the net45 version)
-->
  <PropertyGroup>
    <CodeAnalyzerDir Condition="'$(CodeAnalyzerDir)'=='' and '$(OSEnvironment)'=='Windows_NT'">$(ToolsDir)net45/analyzers/</CodeAnalyzerDir>
    <CodeAnalyzerDir Condition="'$(CodeAnalyzerDir)'=='' and '$(OSEnvironment)'!='Windows_NT'">$(ToolsDir)analyzers/</CodeAnalyzerDir>
  </PropertyGroup>
  
  <ItemGroup Condition="'$(EnableDotnetAnalyzers)' == 'true'">
    <!-- Enable the Microsoft.Dotnet.CodeAnalysis.dll analyzer --> 
    <Analyzer Include="$(CodeAnalyzerDir)Microsoft.DotNet.CodeAnalysis.dll"/>

    <AdditionalFiles Include="$(MSBuildProjectDirectory)/*.analyzerdata" />
    <AdditionalFiles Include="$(MSBuildProjectDirectory)/*.analyzerdata.$(Platform)" />
  </ItemGroup>

  <PropertyGroup Condition="'$(EnableDotnetAnalyzers)' == 'true'">
    <CodeAnalysisRuleSet Condition="'$(CodeAnalysisRuleSet)'==''">$(MSBuildThisFileDirectory)Microsoft.DotNet.CodeAnalysis.ruleset</CodeAnalysisRuleSet>
  </PropertyGroup>
</Project>