<Project>

    <ItemGroup Label="InstrumentationTargetItems">

      <InstrumentationTarget
        Include="StackExchange.Redis"
        Condition="!$(SkippedInstrumentations.Contains('StackExchange.Redis')) AND !$(TargetFramework.StartsWith('net4'))"
        TargetNuGetPackageVersionRange="[2.6.122, 3.0.0)"
        InstrumentationNuGetPackageId="OpenTelemetry.Instrumentation.StackExchangeRedis"
        InstrumentationNuGetPackageVersion="1.12.0-beta.1" />

    </ItemGroup>

  <UsingTask
    TaskName="CheckForInstrumentationPackages"
    AssemblyFile="$(MSBuildThisFileDirectory)netstandard2.0\OpenTelemetry.AutoInstrumentation.BuildTasks.dll" />

  <Target Condition="'$(DisableCheckForInstrumentationPackagesTarget)' != 'true'"
    Name="CheckForInstrumentationPackagesTarget"
    AfterTargets="ResolvePackageAssets">

    <CheckForInstrumentationPackages
      InstrumentationTargetItems="@(InstrumentationTarget)"
      RuntimeCopyLocalItems="@(RuntimeCopyLocalItems)"
      UseVerboseLog="$(UseVerboseLog)" />
  </Target>

 <Target Name="VerifyIfRuntimeIdSpecified" BeforeTargets="Publish" Condition="'$(RuntimeIdentifier)' == '' AND $(DisableAutoInstrumentationCheckForRuntimeIdentifier) != 'true'">
   <ItemGroup>
    <Lines Include="RuntimeIdentifier (RID) is not set. Consider setting it to avoid copying native libraries for all of the platforms supported by the OpenTelemetry.AutoInstrumentation package." />
    <Lines Include="See the docs at https://opentelemetry.io/docs/zero-code/net/nuget-packages/#using-the-nuget-packages for details." />
    <Lines Include="In order to suppress this warning, set DisableAutoInstrumentationCheckForRuntimeIdentifier property to true." />
   </ItemGroup>
   <Warning Text="@(Lines, ' ')">
   </Warning>
 </Target>

</Project>
