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

  <!-- This project is built and run as part of the VMR and by sdk-diff-tests.yml and vmr-license-scan.yml. -->

  <PropertyGroup>
    <TargetFramework>$(NetCurrent)</TargetFramework>
    <DefaultExcludesInProjectFolder>$(DefaultExcludesInProjectFolder);assets/**/*</DefaultExcludesInProjectFolder>
    <SmokeTestConsoleVerbosity Condition="'$(SmokeTestConsoleVerbosity)' == ''">normal</SmokeTestConsoleVerbosity>
    <VSTestLogger>console%3bverbosity=$(SmokeTestConsoleVerbosity);trx%3bLogFileName=$(MSBuildProjectName).trx</VSTestLogger>
    <!-- Multiple loggers are specified so that results are captured in trx and pipelines can fail with AzDO pipeline warnings
         Workaround https://github.com/dotnet/source-build/issues/4003 by disabling VSTestUseMSBuildOutput -->
    <VSTestUseMSBuildOutput>false</VSTestUseMSBuildOutput>
  </PropertyGroup>

  <ItemGroup>
    <ProjectReference Include="..\TestUtilities\TestUtilities.csproj" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" />
    <PackageReference Include="Newtonsoft.Json" />
  </ItemGroup>

  <ItemGroup>
    <Content Include="assets/**"
             CopyToOutputDirectory="Always" />
  </ItemGroup>

  <Target Name="SetRuntimeConfigOptions"
          DependsOnTargets="DetermineSourceBuiltSdkVersion"
          BeforeTargets="_GenerateRuntimeConfigurationFilesInputCache">
    <ItemGroup Condition="'$(SourceBuiltArtifactsPath)' == ''">
      <SourceBuiltArtifactsItem Include="$(ArtifactsAssetsDir)$(SourceBuiltArtifactsTarballName).*$(ArchiveExtension)" />
    </ItemGroup>

    <PropertyGroup>
      <SourceBuiltArtifactsPath Condition="'$(SourceBuiltArtifactsPath)' == ''">%(SourceBuiltArtifactsItem.Identity)</SourceBuiltArtifactsPath>
    </PropertyGroup>

    <ItemGroup>
      <!-- Required values -->
      <RuntimeHostConfigurationOption Include="$(MSBuildProjectName).LogsDirectory">
        <Value>$(ArtifactsTestResultsDir)</Value>
      </RuntimeHostConfigurationOption>
      <RuntimeHostConfigurationOption Include="$(MSBuildProjectName).DotNetDirectory">
        <Value>$(TargetDir)extracted-sdk</Value>
      </RuntimeHostConfigurationOption>
      <RuntimeHostConfigurationOption Include="$(MSBuildProjectName).TargetRid">
        <Value>$(TargetRid)</Value>
      </RuntimeHostConfigurationOption>
      <RuntimeHostConfigurationOption Include="$(MSBuildProjectName).PortableRid">
        <Value>$(PortableRid)</Value>
      </RuntimeHostConfigurationOption>

      <!-- Optional values -->
      <RuntimeHostConfigurationOption Include="$(MSBuildProjectName).CustomPackagesPath">
        <Value>$(SmokeTestsCustomSourceBuiltPackagesPath)</Value>
      </RuntimeHostConfigurationOption>
      <RuntimeHostConfigurationOption Include="$(MSBuildProjectName).ExcludeOmniSharpTests">
        <Value>$(SmokeTestsExcludeOmniSharpTests)</Value>
      </RuntimeHostConfigurationOption>
      <RuntimeHostConfigurationOption Include="$(MSBuildProjectName).IncludeArtifactsSizeTests">
        <Value>$(SmokeTestsIncludeArtifactsSizeTests)</Value>
      </RuntimeHostConfigurationOption>
      <RuntimeHostConfigurationOption Include="$(MSBuildProjectName).LicenseScanPath">
        <Value>$(SmokeTestsLicenseScanPath)</Value>
      </RuntimeHostConfigurationOption>
      <RuntimeHostConfigurationOption Include="$(MSBuildProjectName).MsftSdkTarballPath">
        <Value>$(MsftSdkTarballPath)</Value>
      </RuntimeHostConfigurationOption>      
      <RuntimeHostConfigurationOption Include="$(MSBuildProjectName).PoisonReportPath"
                                      Condition="'$(EnablePoison)' == 'true'">
        <Value>$(PoisonUsageReportFile)</Value>
      </RuntimeHostConfigurationOption>
      <RuntimeHostConfigurationOption Include="$(MSBuildProjectName).PrereqsPath">
        <Value>$(SmokeTestsPrereqsPath)</Value>
      </RuntimeHostConfigurationOption>
      <RuntimeHostConfigurationOption Include="$(MSBuildProjectName).SdkTarballPath">
        <Value>$(SdkTarballPath)</Value>
      </RuntimeHostConfigurationOption>
      <RuntimeHostConfigurationOption Include="$(MSBuildProjectName).SourceBuiltArtifactsPath">
        <Value>$(SourceBuiltArtifactsPath)</Value>
      </RuntimeHostConfigurationOption>
      <RuntimeHostConfigurationOption Include="$(MSBuildProjectName).WarnOnLicenseScanDiffs">
        <Value>$(SmokeTestsWarnOnLicenseScanDiffs)</Value>
      </RuntimeHostConfigurationOption>
      <RuntimeHostConfigurationOption Include="$(MSBuildProjectName).WarnOnSdkContentDiffs">
        <Value>$(SmokeTestsWarnOnSdkContentDiffs)</Value>
      </RuntimeHostConfigurationOption>
    </ItemGroup>
  </Target>

</Project>
