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

  <PropertyGroup>
    
    <TargetFrameworks>net472;net6.0-windows</TargetFrameworks>
    <RootNamespace>Microsoft.Terminal.Wpf</RootNamespace>
    <AssemblyName>Microsoft.Terminal.Wpf</AssemblyName>
    <UseWpf>true</UseWpf>

    <RepoBinPath>$(MSBuildThisFileDirectory)..\..\..\bin\</RepoBinPath>
    <IntermediateOutputPath>$(RepoBinPath)..\obj\$(Platform)\$(Configuration)\$(MSBuildProjectName)</IntermediateOutputPath>
    <OutputPath>$(RepoBinPath)$(Platform)\$(Configuration)\$(MSBuildProjectName)</OutputPath>
    <BeforePack>CollectNativePackContents</BeforePack>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
    <Version>0.1</Version>
  </PropertyGroup>
  
  <PropertyGroup Condition="'$(WindowsTerminalOfficialBuild)'=='true'">
    <SignAssembly>true</SignAssembly>
    <DelaySign>true</DelaySign>
    <AssemblyOriginatorKeyFile>..\..\..\build\config\272MSSharedLibSN2048.snk</AssemblyOriginatorKeyFile>
  </PropertyGroup>

  <ItemGroup>
    <AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json">
      <Visible>true</Visible>
      <Link>stylecop.json</Link>
    </AdditionalFiles>
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
  </ItemGroup>

  <!-- Install an empty one for CSPROJ projects as they don't PGO. -->
  <Target Name="MergePGOCounts" />

  <Target Name="CollectNativePackContents">
    <ItemGroup>
      <None Include="$(RepoBinPath)\Win32\$(Configuration)\Microsoft.Terminal.Control\Microsoft.Terminal.Control.dll">
        <Pack>true</Pack>
        <PackagePath>runtimes\win-x86\native\</PackagePath>
      </None>
      <None Include="$(RepoBinPath)\x64\$(Configuration)\Microsoft.Terminal.Control\Microsoft.Terminal.Control.dll">
        <Pack>true</Pack>
        <PackagePath>runtimes\win-x64\native\</PackagePath>
      </None>
      <None Include="$(RepoBinPath)\ARM64\$(Configuration)\Microsoft.Terminal.Control\Microsoft.Terminal.Control.dll">
        <Pack>true</Pack>
        <PackagePath>runtimes\win-arm64\native\</PackagePath>
      </None>

      <None Include="$(RepoBinPath)\Win32\$(Configuration)\Microsoft.Terminal.Control\Microsoft.Terminal.Control.pdb">
        <Pack>true</Pack>
        <PackagePath>runtimes\win-x86\native\</PackagePath>
      </None>
      <None Include="$(RepoBinPath)\x64\$(Configuration)\Microsoft.Terminal.Control\Microsoft.Terminal.Control.pdb">
        <Pack>true</Pack>
        <PackagePath>runtimes\win-x64\native\</PackagePath>
      </None>
      <None Include="$(RepoBinPath)\ARM64\$(Configuration)\Microsoft.Terminal.Control\Microsoft.Terminal.Control.pdb">
        <Pack>true</Pack>
        <PackagePath>runtimes\win-arm64\native\</PackagePath>
      </None>
    </ItemGroup>
  </Target>

</Project>
