Skip to content

Commit 41312fd

Browse files
committed
Enabled deterministic builds
1 parent 4c7aae0 commit 41312fd

File tree

4 files changed

+62
-20
lines changed

4 files changed

+62
-20
lines changed
Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
2-
3-
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
5-
</PropertyGroup>
6-
7-
<ItemGroup>
8-
<PackageReference Include="Cake.Core" Version="$(CakeVersion)">
9-
<PrivateAssets>all</PrivateAssets>
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageReference Include="Cake.Core" Version="$(CakeVersion)">
9+
<PrivateAssets>all</PrivateAssets>
10+
</PackageReference>
11+
<PackageReference Include="Cake.Testing" Version="$(CakeVersion)">
12+
<PrivateAssets>all</PrivateAssets>
1013
</PackageReference>
11-
<PackageReference Include="Cake.Testing" Version="$(CakeVersion)">
12-
<PrivateAssets>all</PrivateAssets>
14+
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
15+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
16+
<PrivateAssets>all</PrivateAssets>
1317
</PackageReference>
1418
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.6.0" />
1519
<PackageReference Include="xunit" Version="2.3.1" />
16-
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
17-
<PackageReference Include="NSubstitute" Version="3.1.0" />
18-
</ItemGroup>
19-
20-
<ItemGroup>
21-
<ProjectReference Include="..\Cake.Chocolatey.Module\Cake.Chocolatey.Module.csproj" />
22-
</ItemGroup>
23-
24-
</Project>
20+
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
21+
<PackageReference Include="NSubstitute" Version="3.1.0" />
22+
</ItemGroup>
23+
24+
<ItemGroup>
25+
<ProjectReference Include="..\Cake.Chocolatey.Module\Cake.Chocolatey.Module.csproj" />
26+
</ItemGroup>
27+
28+
</Project>

Source/Cake.Chocolatey.Module.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.Chocolatey.Module", "C
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.Chocolatey.Module.Tests", "Cake.Chocolatey.Module.Tests\Cake.Chocolatey.Module.Tests.csproj", "{1A12838D-0FD6-448E-834F-23927CF9D91E}"
99
EndProject
10+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{9EB0B68C-69C5-40C0-97FE-2524B51F60B2}"
11+
ProjectSection(SolutionItems) = preProject
12+
Directory.Build.props = Directory.Build.props
13+
Directory.Build.targets = Directory.Build.targets
14+
EndProjectSection
15+
EndProject
1016
Global
1117
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1218
Debug|Any CPU = Debug|Any CPU

Source/Cake.Chocolatey.Module/Cake.Chocolatey.Module.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ For details see $(PackageProjectUrl)/releases</PackageReleaseNotes>
3232
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3333
</PackageReference>
3434
<PackageReference Include="JetBrains.Annotations" Version="2024.2.0" />
35+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
36+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
37+
<PrivateAssets>all</PrivateAssets>
38+
</PackageReference>
3539
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
3640
<PrivateAssets>all</PrivateAssets>
3741
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

Source/Directory.Build.targets

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
<!-- This target must be imported into Directory.Build.targets -->
3+
<!-- Workaround. Remove once we're targeting the 3.1.300+ SDK
4+
https://github.com/dotnet/sourcelink/issues/572 -->
5+
<Project>
6+
<PropertyGroup>
7+
<!-- Uncomment the following if you want to have pdb files embedded inside a nupkg package -->
8+
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
9+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
10+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
11+
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
12+
</PropertyGroup>
13+
<ItemGroup>
14+
<EmbeddedFiles Include="$(GeneratedAssemblyInfoFile)"/>
15+
</ItemGroup>
16+
<ItemGroup>
17+
<SourceRoot Include="$(NuGetPackageRoot)" />
18+
</ItemGroup>
19+
20+
<Target Name="CoverletGetPathMap"
21+
DependsOnTargets="InitializeSourceRootMappedPaths"
22+
Returns="@(_LocalTopLevelSourceRoot)"
23+
Condition="'$(DeterministicSourcePaths)' == 'true'">
24+
<ItemGroup>
25+
<_LocalTopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"/>
26+
</ItemGroup>
27+
</Target>
28+
</Project>

0 commit comments

Comments
 (0)