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

  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net8.0-windows10.0.17763.0</TargetFramework>
    <SupportedOSPlatformVersion>10.0.17763.0</SupportedOSPlatformVersion>
    <WindowsSdkPackageVersion>10.0.17763.41</WindowsSdkPackageVersion>
    <UseWPF>true</UseWPF>
    <Nullable>enable</Nullable>
    <LangVersion>latest</LangVersion>
    <ImplicitUsings>enable</ImplicitUsings>
    <ApplicationIcon></ApplicationIcon>
    <AssemblyName>PSLauncher</AssemblyName>
    <RootNamespace>PSLauncher.App</RootNamespace>
    <Version>0.5.0</Version>
    <AssemblyVersion>0.5.0.0</AssemblyVersion>
    <FileVersion>0.5.0.0</FileVersion>

    <!-- Single-file self-contained publish profile (used by `dotnet publish`) -->
    <PublishSingleFile>true</PublishSingleFile>
    <SelfContained>true</SelfContained>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
    <EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
    <PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
    <PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.1" />
    <PackageReference Include="Markdig" Version="0.37.0" />
    <PackageReference Include="Markdig.Wpf" Version="0.5.0.1" />
    <PackageReference Include="Serilog" Version="4.0.2" />
    <PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0" />
    <PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
    <PackageReference Include="Serilog.Sinks.Debug" Version="3.0.0" />
    <PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.3" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\PSLauncher.Core\PSLauncher.Core.csproj" />
    <ProjectReference Include="..\PSLauncher.Models\PSLauncher.Models.csproj" />
  </ItemGroup>

  <ItemGroup>
    <Resource Include="Resources\Background.png" />
    <Resource Include="Resources\pirulen.otf" />
  </ItemGroup>

  <!-- Après chaque `dotnet publish -c Release`, copie le single-file exe à la racine du repo
       (C:\ASTERION\GIT\PS_Launcher\PSLauncher.exe) pour avoir un binaire prêt à tester
       sans aller chercher dans bin\Release\... -->
  <Target Name="CopyPublishedToRepoRoot" AfterTargets="Publish"
          Condition=" '$(Configuration)' == 'Release' ">
    <PropertyGroup>
      <RepoRoot>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\..\'))</RepoRoot>
    </PropertyGroup>
    <Copy SourceFiles="$(PublishDir)$(AssemblyName).exe"
          DestinationFolder="$(RepoRoot)"
          SkipUnchangedFiles="false"
          OverwriteReadOnlyFiles="true" />
    <Message Importance="high" Text="Copied $(AssemblyName).exe to $(RepoRoot)" />
  </Target>

</Project>
