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

  <PropertyGroup>
    <AssemblyName>LiteNetLib</AssemblyName>
    <RootNamespace>LiteNetLib</RootNamespace>
    <TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0;net5.0;netcoreapp3.1;netstandard2.0;netstandard2.1</TargetFrameworks>
    <TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net471;net6.0;net5.0;netstandard2.0;netstandard2.1;netcoreapp3.1</TargetFrameworks>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
    <OutputType>Library</OutputType>
    <LangVersion>7.3</LangVersion>

    <GenerateDocumentationFile>true</GenerateDocumentationFile>
    <NoWarn>1701;1702;1705;1591</NoWarn>
    <PackageVersion>1.2.0</PackageVersion>
    <Title>Lite reliable UDP library for Mono and .NET </Title>
    <IsTrimmable>true</IsTrimmable>
    <EnableTrimAnalyzer>true</EnableTrimAnalyzer>
    <AssemblyVersion>1.2.0</AssemblyVersion>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)'=='Debug'">
    <DefineConstants>TRACE;DEBUG</DefineConstants>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)'=='Release'">
    <DefineConstants>TRACE</DefineConstants>
  </PropertyGroup>

  <PropertyGroup>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <DefineConstants>$(DefineConstants);LITENETLIB_UNSAFE</DefineConstants>
    <PackageTags>udp reliable-udp network</PackageTags>
    <PackageReleaseNotes>https://github.com/RevenantX/LiteNetLib/releases/tag/v1.2.0</PackageReleaseNotes>
    <RepositoryType>git</RepositoryType>
    <RepositoryUrl>https://github.com/RevenantX/LiteNetLib</RepositoryUrl>
    <PackageProjectUrl>https://github.com/RevenantX/LiteNetLib</PackageProjectUrl>
    <PackageLicenseExpression>MIT</PackageLicenseExpression>
    <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
    <Version>1.1.0</Version>
    <Authors>Ruslan Pyrch</Authors>
    <Copyright>Copyright 2023 Ruslan Pyrch</Copyright>
    <Description>Lite reliable UDP library for .NET, Mono, and .NET Core</Description>
    <PackageIcon>LNL.png</PackageIcon>
    <PackageReadmeFile>README.md</PackageReadmeFile>
    <TargetFrameworks>net5.0;net6.0;net7.0;net8.0;netstandard2.0;netstandard2.1;net471</TargetFrameworks>
  </PropertyGroup>

  <Target Name="UpdateUnityDLLS" AfterTargets="CopyFilesToOutputDirectory" Condition=" '$(TargetFramework)' == 'net471' and '$(Configuration)' == 'Release' ">
    <ItemGroup>
      <LibraryRelease Include="$(TargetDir)LiteNetLib.dll;$(TargetDir)LiteNetLib.pdb;$(TargetDir)LiteNetLib.xml" />
    </ItemGroup>
    <Copy SourceFiles="@(LibraryRelease)" DestinationFolder="..\LiteNetLibSampleUnity\Assets" />
  </Target>

  <ItemGroup>
    <None Include="..\LNL.png">
      <Pack>True</Pack>
      <PackagePath>\</PackagePath>
    </None>
    <None Include="..\README.md">
      <Pack>True</Pack>
      <PackagePath>\</PackagePath>
    </None>
  </ItemGroup>

</Project>