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

  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net6.0-windows</TargetFramework>
    <Nullable>enable</Nullable>
    <UseWPF>true</UseWPF>
    <UseWindowsForms>True</UseWindowsForms>
    <ApplicationIcon>Bloxstrap.ico</ApplicationIcon>
    <Version>2.8.0</Version>
    <FileVersion>2.8.0</FileVersion>
    <ApplicationManifest>app.manifest</ApplicationManifest>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
  </PropertyGroup>
    
  <ItemGroup>
    <Resource Include="Bloxstrap.ico" />
    <Resource Include="Resources\Fonts\NotoSansThai-VariableFont_wdth,wght.ttf" />
    <Resource Include="Resources\Fonts\Rubik-VariableFont_wght.ttf" />
    <Resource Include="Resources\BootstrapperStyles\ByfronDialog\ByfronLogoDark.jpg" />
    <Resource Include="Resources\BootstrapperStyles\ByfronDialog\ByfronLogoLight.jpg" />
    <Resource Include="Resources\BootstrapperStyles\ByfronDialog\Matt.png" />
    <Resource Include="Resources\MessageBox\Error.png" />
    <Resource Include="Resources\MessageBox\Information.png" />
    <Resource Include="Resources\MessageBox\Question.png" />
    <Resource Include="Resources\MessageBox\Warning.png" />
  </ItemGroup>

  <ItemGroup>
    <EmbeddedResource Include="Resources\Icon2008.ico" />
    <EmbeddedResource Include="Resources\Icon2011.ico" />
    <EmbeddedResource Include="Resources\Icon2017.ico" />
    <EmbeddedResource Include="Resources\Icon2019.ico" />
    <EmbeddedResource Include="Resources\Icon2022.ico" />
    <EmbeddedResource Include="Resources\IconBloxstrap.ico" />
    <EmbeddedResource Include="Resources\IconEarly2015.ico" />
    <EmbeddedResource Include="Resources\IconLate2015.ico" />
    <EmbeddedResource Include="Resources\Mods\Cursor\From2006\ArrowCursor.png" />
    <EmbeddedResource Include="Resources\Mods\Cursor\From2006\ArrowFarCursor.png" />
    <EmbeddedResource Include="Resources\Mods\Cursor\From2013\ArrowCursor.png" />
    <EmbeddedResource Include="Resources\Mods\Cursor\From2013\ArrowFarCursor.png" />
    <EmbeddedResource Include="Resources\Mods\Sounds\OldDeath.ogg" />
    <EmbeddedResource Include="Resources\Mods\Sounds\OldGetUp.mp3" />
    <EmbeddedResource Include="Resources\Mods\Sounds\OldJump.mp3" />
    <EmbeddedResource Include="Resources\Mods\Sounds\OldWalk.mp3" />
    <EmbeddedResource Include="Resources\Mods\Sounds\Empty.mp3" />
    <EmbeddedResource Include="Resources\Mods\OldAvatarBackground.rbxl" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
    <PackageReference Include="DiscordRichPresence" Version="1.2.1.24" />
    <PackageReference Include="Markdig" Version="0.37.0" />
    <PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.106">
      <!--<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>-->
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
    <PackageReference Include="securifybv.ShellLink" Version="0.1.0" />
    <PackageReference Include="SharpZipLib" Version="1.4.2" />
    <PackageReference Include="System.Resources.ResourceManager" Version="4.3.0" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\wpfui\src\Wpf.Ui\Wpf.Ui.csproj" />
  </ItemGroup>

  <ItemGroup>
    <AssemblyAttribute Include="Bloxstrap.Models.Attributes.BuildMetadataAttribute">
      <_Parameter1>$([System.DateTime]::UtcNow.ToString("s"))Z</_Parameter1>
      <_Parameter2>$(COMPUTERNAME)\$(USERNAME)</_Parameter2>
      <_Parameter3>$(CommitHash)</_Parameter3>
      <_Parameter4>$(CommitRef)</_Parameter4>
    </AssemblyAttribute>
  </ItemGroup>

  <ItemGroup>
    <AdditionalFiles Include="NativeMethods.txt" />

    <!-- Provide the path to the winmds used as input into the analyzer. -->
    <CompilerVisibleProperty Include="CsWin32InputMetadataPaths" />
    <CompilerVisibleProperty Include="CsWin32InputDocPaths" />
  </ItemGroup>

  <Target Name="AssembleCsWin32InputPaths" BeforeTargets="GenerateMSBuildEditorConfigFileCore">
    <!-- Roslyn only allows source generators to see msbuild properties, to lift msbuild items into semicolon-delimited properties. -->
    <PropertyGroup>
      <CsWin32InputMetadataPaths>@(ProjectionMetadataWinmd->'%(FullPath)','|')</CsWin32InputMetadataPaths>
      <CsWin32InputDocPaths>@(ProjectionDocs->'%(FullPath)','|')</CsWin32InputDocPaths>
    </PropertyGroup>
  </Target>

  <Target Name="FixMds" BeforeTargets="CoreCompile" Condition="'@(ProjectionMetadataWinmd)'==''">
    <ItemGroup>
      <ProjectionMetadataWinmd Include="$(UserProfile)\.nuget\packages\microsoft.windows.sdk.win32metadata\55.0.45-preview\Windows.Win32.winmd" />
    </ItemGroup>
  </Target>

  <ItemGroup>
    <Compile Update="Resources\Strings.Designer.cs">
      <DesignTime>True</DesignTime>
      <AutoGen>True</AutoGen>
      <DependentUpon>Strings.resx</DependentUpon>
    </Compile>
  </ItemGroup>

  <ItemGroup>
    <EmbeddedResource Update="Resources\Strings.resx">
      <Generator>PublicResXFileCodeGenerator</Generator>
      <LastGenOutput>Strings.Designer.cs</LastGenOutput>
    </EmbeddedResource>
  </ItemGroup>

</Project>
