<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>EnvironmentVariables</RootNamespace>
    <ApplicationManifest>app.manifest</ApplicationManifest>
    <RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
    <UseWinUI>true</UseWinUI>
    <EnableMsixTooling>true</EnableMsixTooling>
    <EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
    <WindowsPackageType>None</WindowsPackageType>
    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
    <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
    <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
    <OutputPath>..\..\..\..\$(Platform)\$(Configuration)\WinUI3Apps</OutputPath>
    <AssemblyName>PowerToys.EnvironmentVariables</AssemblyName>
    <DefineConstants>DISABLE_XAML_GENERATED_MAIN,TRACE</DefineConstants>
    <ApplicationIcon>Assets/EnvironmentVariables/EnvironmentVariables.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.EnvironmentVariables.pri</ProjectPriFileName>
  </PropertyGroup>

  <ItemGroup>
    <Compile Remove="Styles\**" />
    <EmbeddedResource Remove="Styles\**" />
    <None Remove="Styles\**" />
    <Page Remove="Styles\**" />
  </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="EnvironmentVariablesXAML\Views\MainPage.xaml" />
  </ItemGroup>

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

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

  <ItemGroup>
    <PackageReference Include="Microsoft.Windows.CsWinRT" />
    <PackageReference Include="Microsoft.Extensions.Hosting" />
    <PackageReference Include="Microsoft.WindowsAppSDK" />
    <PackageReference Include="Microsoft.Windows.SDK.BuildTools" />
    <PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" />
    <PackageReference Include="CommunityToolkit.Mvvm" />
    <PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" />
    <PackageReference Include="CommunityToolkit.WinUI.Controls.Segmented" />
    <PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" />
    <PackageReference Include="CommunityToolkit.WinUI.Converters" />
    <PackageReference Include="CommunityToolkit.WinUI.Controls.Sizers" />
    <PackageReference Include="WinUIEx" />
    <Manifest Include="$(ApplicationManifest)" />
  </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" />
  </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 '$(EnableMsixTooling)'=='true'">
    <ProjectCapability Include="Msix" />
  </ItemGroup>
  <ItemGroup>
    <Page Update="EnvironmentVariablesXAML\Views\MainPage.xaml">
      <Generator>MSBuild:Compile</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <PRIResource Remove="Styles\**" />
  </ItemGroup>
</Project>
