<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <AssemblyName>Microsoft.VisualStudio.TestPlatform.ObjectModel</AssemblyName>
    <TargetFrameworks>$(TestHostMinimumTargetFrameworks);$(ExtensionTargetFrameworks)</TargetFrameworks>
    <!-- Suppress warning that is caused by Nuget.Frameworks code that we copy. -->
    <NoWarn>$(NoWarn);SYSLIB0051</NoWarn>
  </PropertyGroup>

  <PropertyGroup>
    <IsPackable Condition="'$(DotNetBuildSourceOnly)' != 'true'">true</IsPackable>
    <NuspecFile>Microsoft.TestPlatform.ObjectModel.nuspec</NuspecFile>
    <NuspecBasePath>$(OutputPath)</NuspecBasePath>
    <PackageId>Microsoft.TestPlatform.ObjectModel</PackageId>
    <PackageTags>vstest visual-studio unittest testplatform mstest microsoft test testing</PackageTags>
    <PackageDescription>
      The Microsoft Test Platform Object Model.
    </PackageDescription>
  </PropertyGroup>

  <ItemGroup>
    <ProjectReference Include="..\Microsoft.TestPlatform.CoreUtilities\Microsoft.TestPlatform.CoreUtilities.csproj" />
  </ItemGroup>

  <ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '$(NetFrameworkMinimum)'))">
    <Reference Include="System.Xml" />
    <Reference Include="System.Runtime.Serialization" />
    <Reference Include="System.Runtime" />
    <Reference Include="System.IO" />
    <Reference Include="System" />
    <Reference Include="Microsoft.CSharp" />
  </ItemGroup>

  <ItemGroup>
    <!-- net48 includes tuple, we need to reference it in previous versions but only on .net framework. -->
    <PackageReference Include="System.ValueTuple" Version="4.5.0" 
        Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net48')) != 'true' and '$(TargetFrameworkIdentifier)' == '.NETFramework'" />
    <PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataVersion)" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
  </ItemGroup>

  <ItemGroup>
    <None Include="Resources\CommonResources.tt">
      <Generator>TextTemplatingFileGenerator</Generator>
      <LastGenOutput>Resources\CommonResources.resx</LastGenOutput>
    </None>
  </ItemGroup>
  <ItemGroup>
    <Compile Update="Resources\CommonResources.Designer.cs">
      <DesignTime>True</DesignTime>
      <AutoGen>True</AutoGen>
      <DependentUpon>CommonResources.resx</DependentUpon>
    </Compile>
    <Compile Update="Resources\Resources.Designer.cs">
      <DesignTime>True</DesignTime>
      <AutoGen>True</AutoGen>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Update="Resources\CommonResources.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <DependentUpon>Resources\CommonResources.tt</DependentUpon>
      <LastGenOutput>CommonResources.Designer.cs</LastGenOutput>
    </EmbeddedResource>
    <EmbeddedResource Update="Resources\Resources.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
    </EmbeddedResource>
  </ItemGroup>
  <PropertyGroup Label="Configuration">
    <RootNamespace>Microsoft.VisualStudio.TestPlatform.ObjectModel</RootNamespace>
  </PropertyGroup>

  <ItemGroup>
    <!-- API that is common to all frameworks that we build for. -->
    <AdditionalFiles Include="PublicAPI/PublicAPI.Shipped.txt" />
    <AdditionalFiles Include="PublicAPI/PublicAPI.Unshipped.txt" />
    <AdditionalFiles Include="PublicAPI\net\PublicAPI.Shipped.txt" />
    <AdditionalFiles Include="PublicAPI\net\PublicAPI.Unshipped.txt" />
    <!-- Framework specific API -->
    <AdditionalFiles Include="PublicAPI/$(TargetFramework)/PublicAPI.Shipped.txt" />
    <AdditionalFiles Include="PublicAPI/$(TargetFramework)/PublicAPI.Unshipped.txt" />
  </ItemGroup>

</Project>