aboutsummaryrefslogtreecommitdiff
path: root/src/Directory.csproj.targets
blob: ed041bb84cc4a8cc1361faaeac875fdf1c87b218 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->

<Project>
  <PropertyGroup>
    <CreateDocumentation Condition=" '$(CreateDocumentationFile)'!='true' ">false</CreateDocumentation>
    <DocumentationFile Condition=" '$(CreateDocumentationFile)'=='true' ">$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
    <DefineConstants Condition=" '$(Configuration)'=='Debug' ">$(DefineConstants);DEBUG</DefineConstants>
  </PropertyGroup>

  <PropertyGroup Condition=" '$(IsWixTestProject)'=='true' OR '$(IsWixMSTestProject)'=='true' ">
    <RollForward>Major</RollForward>
    <IsPackable>false</IsPackable>
    <SignOutput>false</SignOutput>
  </PropertyGroup>


  <PropertyGroup Condition=" '$(IsWixMSTestProject)' == 'true' ">
    <!-- Force a .NET v6-compatible package. -->
    <MicrosoftTestingExtensionsCodeCoverageVersion>17.11.5</MicrosoftTestingExtensionsCodeCoverageVersion>
    <TestingPlatformShowTestsFailure>true</TestingPlatformShowTestsFailure>
  </PropertyGroup>

  <Target Name="RunWixTests" AfterTargets="Build" Condition=" '$(IsWixMSTestProject)' == 'true' AND '$(SuppressWixTests)' != 'true' ">
    <Delete Files="$(TestResultsFolder)$(MSBuildProjectName).trx" />

    <Exec 
      Command="$(TargetPath.Replace('.dll', '.exe')) --results-directory $(TestResultsFolder) --report-trx --report-trx-filename $(MSBuildProjectName).trx --no-progress --settings $([MSBuild]::GetPathOfFileAbove('wix.runsettings'))" 
      UseCommandProcessor="false" 
      CustomErrorRegularExpression="  Test method .+ threw exception:" />
  </Target>   


  <ItemGroup Condition=" '$(IsWixTestProject)'=='true' ">
    <PackageReference Include="Microsoft.NET.Test.Sdk" />
    <PackageReference Include="xunit" />
    <PackageReference Include="xunit.runner.visualstudio" PrivateAssets="All" />
  </ItemGroup>


  <ItemGroup Condition=" '$(IsWixTestProject)'!='true' ">
    <PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
  </ItemGroup>
</Project>