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

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
    <PackageId>RaidMax.IW4MAdmin.Application</PackageId>
    <Version>2020.0.0.0</Version>
    <Authors>RaidMax</Authors>
    <Company>Forever None</Company>
    <Product>IW4MAdmin</Product>
    <Description>IW4MAdmin is a complete server administration tool for IW4x and most Call of Duty® dedicated servers</Description>
    <Copyright>2020</Copyright>
    <PackageLicenseUrl>https://github.com/RaidMax/IW4M-Admin/blob/master/LICENSE</PackageLicenseUrl>
    <PackageProjectUrl>https://raidmax.org/IW4MAdmin</PackageProjectUrl>
    <RepositoryUrl>https://github.com/RaidMax/IW4M-Admin</RepositoryUrl>
    <PackageIconUrl>https://raidmax.org/IW4MAdmin/img/iw4adminicon-3.png</PackageIconUrl>
    <ApplicationIcon />
    <AssemblyName>IW4MAdmin</AssemblyName>
    <Configurations>Debug;Release;Prerelease</Configurations>
    <Win32Resource />
    <RootNamespace>IW4MAdmin.Application</RootNamespace>
    <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Jint" Version="3.0.0-beta-1632" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.10">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.10" />
    <PackageReference Include="RestEase" Version="1.5.1" />
    <PackageReference Include="System.Text.Encoding.CodePages" Version="5.0.0" />
  </ItemGroup>

  <PropertyGroup>
    <ServerGarbageCollection>false</ServerGarbageCollection>
    <ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
    <TieredCompilation>true</TieredCompilation>
    <LangVersion>Latest</LangVersion>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|AnyCPU'">
    <ErrorReport>none</ErrorReport>
    <DebugType>full</DebugType>
    <DebugSymbols>true</DebugSymbols>
  </PropertyGroup>

  <ItemGroup>
    <ProjectReference Include="..\SharedLibraryCore\SharedLibraryCore.csproj">
      <Private>true</Private>
    </ProjectReference>
    <ProjectReference Include="..\WebfrontCore\WebfrontCore.csproj" />
  </ItemGroup>

  <ItemGroup>
    <None Update="DefaultSettings.json">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Configuration\LoggingConfiguration.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
  </ItemGroup>

  <Target Name="PreBuild" BeforeTargets="PreBuildEvent">
    <Exec Command="if $(ConfigurationName) == Debug call $(ProjectDir)BuildScripts\PreBuild.bat $(ProjectDir)..\ $(ProjectDir) $(TargetDir) $(OutDir)" />
  </Target>

  <Target Name="PostBuild" AfterTargets="PostBuildEvent">
    <GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
      <Output TaskParameter="Assemblies" ItemName="CurrentAssembly" />
    </GetAssemblyIdentity>
    <Exec Command="if $(ConfigurationName) == Debug call $(ProjectDir)BuildScripts\PostBuild.bat $(ProjectDir)..\ $(ProjectDir) $(TargetDir) $(OutDir) %25(CurrentAssembly.Version)" />
  </Target>

  <Target Name="PostPublish" AfterTargets="Publish">
    <Exec Command="if $(ConfigurationName) == Debug call $(ProjectDir)BuildScripts\PostPublish.bat $(ProjectDir)..\ $(ProjectDir) $(TargetDir) $(ConfigurationName)" />
  </Target>
</Project>
