Browse Source

Update deterministic workaround

pull/1377/head
James Jackson-South 6 years ago
parent
commit
699c371915
  1. 2
      Directory.Build.targets
  2. 25
      src/Directory.Build.targets

2
Directory.Build.targets

@ -18,7 +18,7 @@
<!-- Package versions for package references across all projects --> <!-- Package versions for package references across all projects -->
<ItemGroup> <ItemGroup>
<!--Global Dependencies--> <!--Global Dependencies-->
<PackageReference Update="Microsoft.Net.Compilers.Toolset" PrivateAssets="All" Version="3.3.1" /> <PackageReference Update="Microsoft.Net.Compilers.Toolset" PrivateAssets="All" Version="3.7.0" />
<PackageReference Update="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0" /> <PackageReference Update="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0" />
<PackageReference Update="StyleCop.Analyzers" PrivateAssets="All" Version="1.1.118" /> <PackageReference Update="StyleCop.Analyzers" PrivateAssets="All" Version="1.1.118" />

25
src/Directory.Build.targets

@ -21,16 +21,25 @@
</PropertyGroup> </PropertyGroup>
<!-- Workaround for running Coverlet with Determenistic builds --> <!-- Workaround for running Coverlet with Determenistic builds -->
<!-- https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/DeterministicBuild.md --> <PropertyGroup>
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
</PropertyGroup>
<ItemGroup>
<EmbeddedFiles Include="$(GeneratedAssemblyInfoFile)"/>
</ItemGroup>
<ItemGroup>
<SourceRoot Include="$(NuGetPackageRoot)" />
</ItemGroup>
<Target Name="CoverletGetPathMap" <Target Name="CoverletGetPathMap"
DependsOnTargets="InitializeSourceRootMappedPaths" DependsOnTargets="InitializeSourceRootMappedPaths"
Returns="@(_LocalTopLevelSourceRoot)" Returns="@(_LocalTopLevelSourceRoot)"
Condition="'$(DeterministicSourcePaths)' == 'true'"> Condition="'$(DeterministicSourcePaths)' == 'true'">
<ItemGroup> <ItemGroup>
<_LocalTopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"/> <_LocalTopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"/>
</ItemGroup> </ItemGroup>
</Target> </Target>
<ItemDefinitionGroup> <ItemDefinitionGroup>
<InternalsVisibleTo> <InternalsVisibleTo>
<Visible>false</Visible> <Visible>false</Visible>
@ -62,7 +71,7 @@
<!-- Empty target so that `dotnet test` will work on the solution --> <!-- Empty target so that `dotnet test` will work on the solution -->
<!-- https://github.com/Microsoft/vstest/issues/411 --> <!-- https://github.com/Microsoft/vstest/issues/411 -->
<Target Name="VSTest" Condition="'$(IsTestProject)' == 'true'"/> <Target Name="VSTest" Condition="'$(IsTestProject)' == 'true'"/>
<ItemGroup> <ItemGroup>
<!--Shared config files that have to exist at root level.--> <!--Shared config files that have to exist at root level.-->
<ConfigFilesToCopy Include="..\..\shared-infrastructure\.editorconfig;..\..\shared-infrastructure\.gitattributes" /> <ConfigFilesToCopy Include="..\..\shared-infrastructure\.editorconfig;..\..\shared-infrastructure\.gitattributes" />
@ -74,7 +83,7 @@
SkipUnchangedFiles = "true" SkipUnchangedFiles = "true"
DestinationFolder="..\..\" /> DestinationFolder="..\..\" />
</Target> </Target>
<!-- Allows regenerating T4-generated files at build time using MsBuild --> <!-- Allows regenerating T4-generated files at build time using MsBuild -->
<!-- Enable on Windows OS to build all T4 templates. TODO: XPlat <!-- Enable on Windows OS to build all T4 templates. TODO: XPlat
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TextTemplating\Microsoft.TextTemplating.targets" /> <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TextTemplating\Microsoft.TextTemplating.targets" />
@ -82,5 +91,5 @@
<TransformOnBuild>true</TransformOnBuild> <TransformOnBuild>true</TransformOnBuild>
</PropertyGroup> </PropertyGroup>
--> -->
</Project> </Project>

Loading…
Cancel
Save