<Project>

  <PropertyGroup>
    <RepositoryDirectory>$(MSBuildThisFileDirectory)</RepositoryDirectory>
    <BuildToolsDirectory>$(RepositoryDirectory)build\</BuildToolsDirectory>
  </PropertyGroup>

  <Import Project="$(BuildToolsDirectory)Windows.Toolkit.Common.props" />

  <Choose>
    <When Condition="$(IsCoreProject)">
      <PropertyGroup>
        <GenerateDocumentationFile>true</GenerateDocumentationFile>
        <PackageOutputPath>$(RepositoryDirectory)bin\nupkg</PackageOutputPath>
        <GenerateLibraryLayout Condition="$(IsUwpProject)">true</GenerateLibraryLayout>
        <!--<TreatWarningsAsErrors Condition="'$(Configuration)' == 'Release'">true</TreatWarningsAsErrors>-->
      </PropertyGroup>
    </When>
    <Otherwise>
      <PropertyGroup>
        <IsPackable>false</IsPackable>
        <IsPublishable>false</IsPublishable>
        <NoWarn>$(NoWarn);CS8002;SA0001</NoWarn>
      </PropertyGroup>
    </Otherwise>
  </Choose>

  <Choose>
    <When Condition="$(IsUwpProject)">
      <PropertyGroup>
        <!-- Code CS8002 is a warning for strong named -> non-strong-named reference. This is valid for platforms other than .NET Framework (and is needed for the UWP targets. -->
        <NoWarn>$(NoWarn);CS8002</NoWarn>
        <!-- For including default @(Page) and @(Resource) items via 'MSBuild.Sdk.Extras' Sdk package. Also provides up to date check and file nesting -->
        <ExtrasEnableDefaultXamlItems>true</ExtrasEnableDefaultXamlItems>
      </PropertyGroup>
    </When>
  </Choose>
    
  <ItemGroup>
    <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
  </ItemGroup>
    
  <ItemGroup>
    <PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="All" />
  </ItemGroup>

  <Choose>
    <When Condition="!$(IsSampleProject) and '$(SourceLinkEnabled)' != 'false'">
      <PropertyGroup>
        <!-- Declare that the Repository URL can be published to NuSpec -->
        <PublishRepositoryUrl>true</PublishRepositoryUrl>
        <!-- Embed source files that are not tracked by the source control manager to the PDB -->
        <EmbedUntrackedSources>true</EmbedUntrackedSources>
        <!-- Include PDB in the built .nupkg -->
        <AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
      </PropertyGroup>
      <ItemGroup>
        <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
      </ItemGroup>
    </When>
  </Choose>

</Project>