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

  <PropertyGroup>
    <TargetFrameworks>net6.0;net461</TargetFrameworks>
    <ApplicationIcon>jackett.ico</ApplicationIcon>
    <OutputType>Exe</OutputType>
    <NoWarn></NoWarn>
    <ServerGarbageCollection>false</ServerGarbageCollection>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net6.0|AnyCPU'">
    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
    <WarningsAsErrors />
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0|AnyCPU'">
    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
    <WarningsAsErrors />
  </PropertyGroup>

  <Choose>
    <When Condition="'$(TargetFramework)' != 'net461' and $(RuntimeIdentifier.Contains('win')) == 'false'">
      <PropertyGroup>
        <AssemblyName>jackett</AssemblyName>
      </PropertyGroup>
    </When>
    <Otherwise>
      <PropertyGroup>
        <AssemblyName>JackettConsole</AssemblyName>
      </PropertyGroup>
    </Otherwise>
  </Choose>

  <!-- Conditionally obtain references for the .NET 6.0 target -->
  <ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.0" />
    <PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0" />
    <PackageReference Include="System.Security.Cryptography.ProtectedData" Version="6.0.0" />
  </ItemGroup>

  <!-- Conditionally obtain references for the .NET461 target -->
  <ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
    <PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.ResponseCompression" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Rewrite" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
    <PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.8" />
    <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Autofac" Version="6.3.0" />
    <PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.2.0" />
    <PackageReference Include="AutoMapper" Version="10.1.1" />
    <PackageReference Include="CommandLineParser" Version="2.8.0" />
	<PackageReference Include="Mono.Posix" Version="7.1.0-final.1.21458.1" />
    <PackageReference Include="NLog" Version="4.7.12" />
    <PackageReference Include="NLog.Web.AspNetCore" Version="4.14.0" />
    <PackageReference Include="System.ServiceProcess.ServiceController" Version="6.0.0" />
    <PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\Jackett.Common\Jackett.Common.csproj" />
  </ItemGroup>

  <ItemGroup>
    <Content Include="..\..\README.md">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="..\..\LICENSE">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
  </ItemGroup>

</Project>
