<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net5.0</TargetFramework>
    <Nullable>enable</Nullable>
    <AssemblyName>DiscordHistoryTracker</AssemblyName>
    <RootNamespace>DHT.Desktop</RootNamespace>
    <PackageId>DiscordHistoryTracker</PackageId>
    <Authors>chylex</Authors>
    <Company>DiscordHistoryTracker</Company>
    <Product>DiscordHistoryTracker</Product>
    <ApplicationIcon>./Resources/icon.ico</ApplicationIcon>
    <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
    <SatelliteResourceLanguages>en</SatelliteResourceLanguages>
    <GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
    <GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
    <GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>none</DebugType>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Avalonia" Version="0.10.13" />
    <PackageReference Include="Avalonia.Desktop" Version="0.10.13" />
    <PackageReference Include="Avalonia.Diagnostics" Version="0.10.13" Condition=" '$(Configuration)' == 'Debug' " />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\Server\Server.csproj" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="..\Version.cs" Link="Version.cs" />
  </ItemGroup>
  <ItemGroup>
    <AvaloniaResource Include="Resources/icon.ico" />
    <EmbeddedResource Include="../Resources/Tracker/bootstrap.js">
      <LogicalName>Tracker\%(RecursiveDir)%(Filename)%(Extension)</LogicalName>
      <Link>Resources/Tracker/%(RecursiveDir)%(Filename)%(Extension)</Link>
      <Visible>false</Visible>
    </EmbeddedResource>
    <EmbeddedResource Include="../Resources/Tracker/scripts/**" Condition=" '$(Configuration)' == 'Debug' ">
      <LogicalName>Tracker\scripts\%(RecursiveDir)%(Filename)%(Extension)</LogicalName>
      <Link>Resources/Tracker/scripts/%(RecursiveDir)%(Filename)%(Extension)</Link>
      <Visible>false</Visible>
    </EmbeddedResource>
    <EmbeddedResource Include="$(ProjectDir)bin/.res/scripts/**" Condition=" '$(Configuration)' == 'Release' ">
      <LogicalName>Tracker\scripts\%(RecursiveDir)%(Filename)%(Extension)</LogicalName>
      <Link>Resources/Tracker/scripts/%(RecursiveDir)%(Filename)%(Extension)</Link>
      <Visible>false</Visible>
    </EmbeddedResource>
    <EmbeddedResource Include="../Resources/Tracker/styles/**">
      <LogicalName>Tracker\styles\%(RecursiveDir)%(Filename)%(Extension)</LogicalName>
      <Link>Resources/Tracker/styles/%(RecursiveDir)%(Filename)%(Extension)</Link>
      <Visible>false</Visible>
    </EmbeddedResource>
    <EmbeddedResource Include="../Resources/Viewer/**">
      <LogicalName>Viewer\%(RecursiveDir)%(Filename)%(Extension)</LogicalName>
      <Link>Resources/Viewer/%(RecursiveDir)%(Filename)%(Extension)</Link>
      <Visible>false</Visible>
    </EmbeddedResource>
  </ItemGroup>
  <Target Name="MinifyResources" BeforeTargets="PrepareForBuild" Condition=" '$(Configuration)' == 'Release' ">
    <ItemGroup>
      <UpToDateCheckInput Include="$(ProjectDir)../Resources/Tracker/scripts/**" Visible="false" />
    </ItemGroup>
    <RemoveDir Directories="$(ProjectDir)bin/.res/scripts" />
    <Exec Command="$(ProjectDir)../Resources/minify.py" WorkingDirectory="$(ProjectDir)../Resources" IgnoreExitCode="false" />
  </Target>
</Project>
