Browse Source

Add coverlet workaround from docs

pull/1574/head
James Jackson-South 6 years ago
parent
commit
617b758357
  1. 4
      .github/workflows/build-and-test.yml
  2. 15
      src/Directory.Build.targets

4
.github/workflows/build-and-test.yml

@ -55,7 +55,7 @@ jobs:
- name: Setup DotNet SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: "3.1.101"
dotnet-version: "3.1.x"
- name: Build
shell: pwsh
@ -98,7 +98,7 @@ jobs:
- name: Setup DotNet SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: "3.1.101"
dotnet-version: "3.1.x"
- name: Pack
shell: pwsh

15
src/Directory.Build.targets

@ -22,13 +22,24 @@
<!-- Workaround for using SDK < 3.1.300, which we cannot use since it breaks coverlet -->
<!-- https://github.com/clairernovotny/DeterministicBuilds -->
<PropertyGroup>
<!--<PropertyGroup>
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
</PropertyGroup>
<ItemGroup>
<EmbeddedFiles Include="$(GeneratedAssemblyInfoFile)"/>
</ItemGroup>
</ItemGroup>-->
<!-- Workaround for running Coverlet with Determenistic builds -->
<!-- https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/DeterministicBuild.md -->
<Target Name="CoverletGetPathMap"
DependsOnTargets="InitializeSourceRootMappedPaths"
Returns="@(_LocalTopLevelSourceRoot)"
Condition="'$(DeterministicSourcePaths)' == 'true'">
<ItemGroup>
<_LocalTopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"/>
</ItemGroup>
</Target>
<ItemDefinitionGroup>
<InternalsVisibleTo>
<Visible>false</Visible>

Loading…
Cancel
Save