<Project Sdk="Microsoft.NET.Sdk">
  <Import Project="..\..\..\Version.props" />

  <PropertyGroup>
    <AssemblyTitle>PowerToys.MeasureTool</AssemblyTitle>
    <AssemblyDescription>PowerToys MeasureTool</AssemblyDescription>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net8.0-windows10.0.20348.0</TargetFramework>
    <TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
    <OutputPath>..\..\..\..\$(Platform)\$(Configuration)\WinUI3Apps</OutputPath>
    <RootNamespace>PowerToys.MeasureToolUI</RootNamespace>
    <AssemblyName>PowerToys.MeasureToolUI</AssemblyName>
    <ApplicationManifest>app.manifest</ApplicationManifest>
    <Platforms>x86;x64;arm64</Platforms>
    <RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
    <UseWinUI>true</UseWinUI>
    <GenerateSatelliteAssembliesForCore>true</GenerateSatelliteAssembliesForCore>    
    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
    <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
    <EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
    <WindowsPackageType>None</WindowsPackageType>
    <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
    <SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
    <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.MeasureToolUI.pri</ProjectPriFileName>
  </PropertyGroup>

  <ItemGroup>
    <Page Remove="MeasureToolXAML\App.xaml" />
  </ItemGroup>
  <ItemGroup>
    <ApplicationDefinition Include="MeasureToolXAML\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.MeasureToolCore;PowerToys.GPOWrapper</CsWinRTIncludes>
    <CsWinRTGeneratedFilesDir>$(OutDir)</CsWinRTGeneratedFilesDir>
    <ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
  </PropertyGroup>

  <PropertyGroup>
    <NoWarn>0436</NoWarn>
  </PropertyGroup>

  <ItemGroup>
    <Content Include="Assets\MeasureTool\SplashScreen.scale-200.png" />
    <Content Include="Assets\MeasureTool\LockScreenLogo.scale-200.png" />
    <Content Include="Assets\MeasureTool\Square150x150Logo.scale-200.png" />
    <Content Include="Assets\MeasureTool\Square44x44Logo.scale-200.png" />
    <Content Include="Assets\MeasureTool\Square44x44Logo.targetsize-24_altform-unplated.png" />
    <Content Include="Assets\MeasureTool\StoreLogo.png" />
    <Content Include="Assets\MeasureTool\Wide310x150Logo.scale-200.png" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Windows.CsWinRT" />
    <PackageReference Include="Microsoft.WindowsAppSDK" />
    <PackageReference Include="Microsoft.Windows.SDK.BuildTools" />
    <PackageReference Include="WinUIEx" />
    <Manifest Include="$(ApplicationManifest)" />
  </ItemGroup>

  <!-- Defining the "Msix" ProjectCapability here allows the Single-project MSIX Packaging
       Tools extension to be activated for this project even if the Windows App SDK Nuget
       package has not yet been restored -->
  <ItemGroup Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnablePreviewMsixTooling)'=='true'">
    <ProjectCapability Include="Msix" />
  </ItemGroup>
  <ItemGroup>
    <!-- HACK: Common.UI is referenced, even if it is not used, to force dll versions to be the same as in other projects that use it. It's still unclear why this is the case, but this is need for flattening the install directory. -->
 	  <ProjectReference Include="..\..\..\common\Common.UI\Common.UI.csproj" />
    <ProjectReference Include="..\..\..\common\GPOWrapper\GPOWrapper.vcxproj" />
    <ProjectReference Include="..\..\..\common\interop\PowerToys.Interop.vcxproj" />
    <ProjectReference Include="..\..\..\common\ManagedCommon\ManagedCommon.csproj" />
    <ProjectReference Include="..\..\..\settings-ui\Settings.UI.Library\Settings.UI.Library.csproj" />
    <ProjectReference Include="..\MeasureToolCore\PowerToys.MeasureToolCore.vcxproj" />
  </ItemGroup>
</Project>
