<Project Sdk="Microsoft.NET.Sdk">
  <Import Project="..\..\..\Version.props" />
  
  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net8.0-windows10.0.20348.0</TargetFramework>
    <TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
    <SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
    <RootNamespace>Hosts</RootNamespace>
    <ApplicationManifest>app.manifest</ApplicationManifest>
    <RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
    <UseWinUI>true</UseWinUI>
    <EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
    <WindowsPackageType>None</WindowsPackageType>
    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
    <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
    <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
    <OutputPath>..\..\..\..\$(Platform)\$(Configuration)\WinUI3Apps</OutputPath>
    <RootNamespace>Hosts</RootNamespace>
    <AssemblyName>PowerToys.Hosts</AssemblyName>
    <DefineConstants>DISABLE_XAML_GENERATED_MAIN,TRACE</DefineConstants>
    <ApplicationIcon>Assets/Hosts/Hosts.ico</ApplicationIcon>
    <SelfContained>true</SelfContained>
    <!-- MRT from windows app sdk will search for a pri file with the same name of the module before defaulting to resources.pri -->
    <ProjectPriFileName>PowerToys.Hosts.pri</ProjectPriFileName>
  </PropertyGroup>

  <ItemGroup>
    <Page Remove="HostsXAML\App.xaml" />
  </ItemGroup>
  <ItemGroup>
    <ApplicationDefinition Include="HostsXAML\App.xaml" />
  </ItemGroup>

  <!-- SelfContained=true requires RuntimeIdentifier to be set -->
  <PropertyGroup Condition="'$(Platform)'=='x64'">
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Platform)'=='ARM64'">
    <RuntimeIdentifier>win-arm64</RuntimeIdentifier>
  </PropertyGroup>

  <!-- See https://learn.microsoft.com/windows/apps/develop/platform/csharp-winrt/net-projection-from-cppwinrt-component for more info -->
  <PropertyGroup>
    <CsWinRTIncludes>PowerToys.GPOWrapper</CsWinRTIncludes>
    <CsWinRTGeneratedFilesDir>$(OutDir)</CsWinRTGeneratedFilesDir>
    <ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
  </PropertyGroup>
  <ItemGroup>
    <None Remove="Assets\Hosts\AppList.scale-100.png" />
    <None Remove="Assets\Hosts\AppList.scale-125.png" />
    <None Remove="Assets\Hosts\AppList.scale-150.png" />
    <None Remove="Assets\Hosts\AppList.scale-200.png" />
    <None Remove="Assets\Hosts\AppList.scale-400.png" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Windows.CsWinRT" />
    <PackageReference Include="CommunityToolkit.Mvvm" />
    <PackageReference Include="CommunityToolkit.WinUI.Converters" />
    <PackageReference Include="CommunityToolkit.WinUI.Extensions" />
    <PackageReference Include="CommunityToolkit.WinUI.Collections" />
    <PackageReference Include="Microsoft.Extensions.Hosting" />
    <PackageReference Include="Microsoft.WindowsAppSDK" />
    <PackageReference Include="Microsoft.Windows.SDK.BuildTools" />
    <PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" />
    <PackageReference Include="System.IO.Abstractions" />
    <PackageReference Include="WinUIEx" />
    <Manifest Include="$(ApplicationManifest)" />
  </ItemGroup>

  <ItemGroup Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnablePreviewMsixTooling)'=='true'">
    <ProjectCapability Include="Msix" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\..\..\common\GPOWrapper\GPOWrapper.vcxproj" />
    <ProjectReference Include="..\..\..\common\interop\PowerToys.Interop.vcxproj" />
    <ProjectReference Include="..\..\..\common\Common.UI\Common.UI.csproj" />
    <ProjectReference Include="..\..\..\settings-ui\Settings.UI.Library\Settings.UI.Library.csproj" />
  </ItemGroup>

</Project>
