<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFrameworks>$(ResolverTargetFramework);net472</TargetFrameworks>
    <TargetFrameworks Condition=" '$([MSBuild]::IsOSPlatform(`Windows`))' == 'false' ">$(ResolverTargetFramework)</TargetFrameworks>

    <PlatformTarget>AnyCPU</PlatformTarget>
    <RuntimeIdentifiers Condition="$([MSBuild]::IsOSPlatform(`Windows`))">win-x86;win-x64</RuntimeIdentifiers>
    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
    <StrongNameKeyId>MicrosoftAspNetCore</StrongNameKeyId>

    <Nullable>Enable</Nullable>
    <IsPackable>true</IsPackable>

    <UseSystemTextJson Condition="'$(TargetFramework)'!='netstandard2.0' And '$(TargetFramework)'!='net472'">True</UseSystemTextJson>
    <DefineConstants Condition="'$(UseSystemTextJson)'=='True'">$(DefineConstants);USE_SYSTEM_TEXT_JSON</DefineConstants>
  </PropertyGroup>

  <ItemGroup>
    <EmbeddedResource Update="**\*.resx" GenerateSource="true" Namespace="Microsoft.NET.Sdk.Localization" />
    <Compile Include="..\Microsoft.DotNet.MSBuildSdkResolver\FXVersion.cs" />
    <Compile Include="$(RepoRoot)src\Common\EnvironmentVariableNames.cs" LinkBase="Common" />
    <Compile Include="$(RepoRoot)src\Common\WorkloadFileBasedInstall.cs" LinkBase="Common" />
    <Compile Include="$(RepoRoot)src\Cli\dotnet\commands\dotnet-workload\InstallStateContents.cs" LinkBase="Cli"/>
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="System.Text.Json" Condition="'$(UseSystemTextJson)'=='True'" />
    <PackageReference Include="Newtonsoft.Json" Condition="'$(UseSystemTextJson)'!='True'" />
    <PackageReference Include="Microsoft.Deployment.DotNet.Releases" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
    <Reference Include="System" />
    <Reference Include="System.Core" />
  </ItemGroup>

</Project>
