<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <AssemblyName>DiscordChatExporter</AssemblyName>
    <ApplicationIcon>../favicon.ico</ApplicationIcon>
    <PublishTrimmed>true</PublishTrimmed>
    <CopyOutputSymbolsToPublishDirectory>false</CopyOutputSymbolsToPublishDirectory>
  </PropertyGroup>

  <PropertyGroup>
    <EncryptionSalt>HimalayanPinkSalt</EncryptionSalt>
  </PropertyGroup>

  <ItemGroup>
    <!-- Expose this property in code -->
    <ProjectProperty Include="EncryptionSalt" />
  </ItemGroup>

  <PropertyGroup>
    <PublishMacOSBundle>false</PublishMacOSBundle>
  </PropertyGroup>

  <ItemGroup>
    <AvaloniaResource Include="../favicon.ico" Link="favicon.ico" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="AsyncImageLoader.Avalonia" />
    <PackageReference Include="Avalonia" />
    <PackageReference Include="Avalonia.Desktop" />
    <PackageReference Include="Cogwheel" />
    <PackageReference Include="CommunityToolkit.Mvvm" />
    <PackageReference Include="CSharpier.MsBuild" PrivateAssets="all" />
    <PackageReference Include="Deorcify" PrivateAssets="all" />
    <PackageReference Include="DialogHost.Avalonia" />
    <PackageReference Include="Gress" />
    <PackageReference Include="Markdig" />
    <PackageReference Include="Material.Avalonia" />
    <PackageReference Include="Material.Icons.Avalonia" />
    <PackageReference Include="Microsoft.Extensions.DependencyInjection" />
    <PackageReference Include="Onova" />
    <PackageReference Include="PowerKit" PrivateAssets="all" />
    <PackageReference Include="ThisAssembly.Project" PrivateAssets="all" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="../DiscordChatExporter.Core/DiscordChatExporter.Core.csproj" />
  </ItemGroup>

  <Target Name="PublishMacOSBundle" AfterTargets="Publish" Condition="$(PublishMacOSBundle)">
    <Exec
      Command="dotnet run --file &quot;$(ProjectDir)PublishMacOSBundle.csx&quot; -- --publish-dir &quot;$(PublishDir)&quot; --icons-file &quot;$(ProjectDir)../favicon.icns&quot; --full-version $(Version) --short-version $(AssemblyVersion)"
      LogStandardErrorAsError="true"
    />
  </Target>
</Project>
