<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>
    <RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
    <OutputPath>..\..\..\..\$(Platform)\$(Configuration)</OutputPath>
    <Nullable>enable</Nullable>
    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
    <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
    <UseWindowsForms>true</UseWindowsForms>
    <!--Per documentation: https://learn.microsoft.com/dotnet/core/compatibility/windows-forms/5.0/automatically-infer-winexe-output-type#outputtype-set-to-winexe-for-wpf-and-winforms-apps -->
    <DisableWinExeOutputInference>true</DisableWinExeOutputInference>
    <AssemblyName>PowerToys.Awake</AssemblyName>
    <Version>$(Version).0</Version>
    <ApplicationIcon>Assets\Awake\Awake.ico</ApplicationIcon>
    <PackageProjectUrl>https://awake.den.dev</PackageProjectUrl>
    <RepositoryUrl>https://github.com/microsoft/powertoys</RepositoryUrl>
    <SelfContained>true</SelfContained>
    <GenerateAssemblyInfo>true</GenerateAssemblyInfo>
  </PropertyGroup>

  <!-- 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>

  <PropertyGroup Condition="'$(Configuration)'=='Debug'">
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <DebugType>full</DebugType>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <Optimize>false</Optimize>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)'=='Release'">
    <DefineConstants>TRACE;RELEASE</DefineConstants>
    <Optimize>true</Optimize>
    <DebugType>pdbonly</DebugType>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" />

  <ItemGroup>
    <None Remove="Assets\Awake\Awake.ico" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Windows.CsWinRT" />
    <PackageReference Include="System.CommandLine" />
    <PackageReference Include="System.Reactive" />
    <PackageReference Include="System.Runtime.Caching" />
  </ItemGroup>

  <ItemGroup>
    <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" />
  </ItemGroup>

  <ItemGroup>
    <Compile Update="Program.cs">
      <CopyToOutputDirectory>Never</CopyToOutputDirectory>
    </Compile>
    <Compile Update="Properties\Resources.Designer.cs">
      <DesignTime>True</DesignTime>
      <AutoGen>True</AutoGen>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
  </ItemGroup>

  <ItemGroup>
    <Content Include="Assets\Awake\Awake.ico">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>

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

  <ItemGroup>
    <PackageReference Update="Microsoft.CodeAnalysis.NetAnalyzers">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
  </ItemGroup>
</Project>
