Skip to content

Commit

Permalink
(GH-55) Enable deterministic build
Browse files Browse the repository at this point in the history
  • Loading branch information
gep13 committed Feb 26, 2021
1 parent 66a6260 commit 532e459
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
6 changes: 5 additions & 1 deletion src/Cake.Json.Tests/Cake.Json.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@
<ItemGroup>
<PackageReference Include="Cake.Core" Version="0.35.0" />
<PackageReference Include="Cake.Testing" Version="0.35.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="NSubstitute" Version="4.2.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="coverlet.msbuild" Version="2.9.0" >
<PackageReference Include="coverlet.msbuild" Version="2.9.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
6 changes: 6 additions & 0 deletions src/Cake.Json/Cake.Json.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net46</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -23,6 +25,10 @@
<ItemGroup>
<PackageReference Include="Cake.Core" Version="0.35.0" PrivateAssets="All" />
<PackageReference Include="Cake.Common" Version="0.35.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="Cake.Addin.Analyzer" Version="0.1.1">
<PrivateAssets>all</PrivateAssets>
Expand Down
11 changes: 0 additions & 11 deletions src/Directory.Build.props

This file was deleted.

15 changes: 10 additions & 5 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@

<!-- This target must be imported into Directory.Build.targets -->
<!-- Workaround. Remove once we're on 3.1.300+
<!-- Workaround. Remove once we're targeting the 3.1.300+ SDK
https://github.com/dotnet/sourcelink/issues/572 -->
<Project>
<PropertyGroup>
<!-- Uncomment the following if you want to have pdb files embedded inside a nupkg package -->
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
</PropertyGroup>
<ItemGroup>
Expand All @@ -13,11 +18,11 @@ https://github.com/dotnet/sourcelink/issues/572 -->
</ItemGroup>

<Target Name="CoverletGetPathMap"
DependsOnTargets="InitializeSourceRootMappedPaths"
Returns="@(_LocalTopLevelSourceRoot)"
Condition="'$(DeterministicSourcePaths)' == 'true'">
DependsOnTargets="InitializeSourceRootMappedPaths"
Returns="@(_LocalTopLevelSourceRoot)"
Condition="'$(DeterministicSourcePaths)' == 'true'">
<ItemGroup>
<_LocalTopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"/>
<_LocalTopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"/>
</ItemGroup>
</Target>
</Project>

0 comments on commit 532e459

Please sign in to comment.