Skip to content
This repository was archived by the owner on Mar 1, 2021. It is now read-only.

Commit 5e0cbce

Browse files
committed
(GH-29) Enable deterministic builds
1 parent 7c876ec commit 5e0cbce

File tree

5 files changed

+60
-24
lines changed

5 files changed

+60
-24
lines changed

Source/Cake.DotNetTool.Module.Tests/Cake.DotNetTool.Module.Tests.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@
88
<ItemGroup>
99
<PackageReference Include="Cake.Core" Version="0.33.0" PrivateAssets="All" />
1010
<PackageReference Include="Cake.Testing" Version="0.33.0" PrivateAssets="All" />
11+
<PackageReference Include="coverlet.msbuild" Version="3.0.2">
12+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
13+
<PrivateAssets>all</PrivateAssets>
14+
</PackageReference>
1115
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
16+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
17+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
18+
<PrivateAssets>all</PrivateAssets>
19+
</PackageReference>
1220
<PackageReference Include="xunit" Version="2.4.1" />
1321
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
1422
<PackageReference Include="NSubstitute" Version="4.0.0" />

Source/Cake.DotNetTool.Module/Cake.DotNetTool.Module.csproj

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,30 @@
1111
<DefineConstants>TRACE;DEBUG;NETSTANDARD</DefineConstants>
1212
</PropertyGroup>
1313

14+
<PropertyGroup>
15+
<StartYear>2016</StartYear>
16+
<EndYear>$([System.DateTime]::Today.Year)</EndYear>
17+
<FullYear Condition="'$(StartYear)'=='$(EndYear)'">$(StartYear)</FullYear>
18+
<FullYear Condition="'$(StartYear)'!='$(EndYear)'">$(StartYear)-$(EndYear)</FullYear>
19+
20+
<!-- Properties related to packaging -->
21+
<Authors>Gary Ewan Park</Authors>
22+
<Copyright>Copyright © $(FullYear) — Gary Ewan Park</Copyright>
23+
<Description>Cake Module that extends Cake with ability to install tools using dotnet cli.</Description>
24+
<PackageIconUrl>https://cdn.jsdelivr.net/gh/cake-contrib/graphics/png/cake-contrib-medium.png</PackageIconUrl>
25+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
26+
<PackageProjectUrl>https://github.com/cake-contrib/Cake.DotNetTool.Module/</PackageProjectUrl>
27+
<PackageTags>Cake;Script;Build;DotNetTool;Module</PackageTags>
28+
<RepositoryUrl>https://github.com/cake-contrib/Cake.DotNetTool.Module.git</RepositoryUrl>
29+
<PackageReleaseNotes>https://github.com/cake-contrib/Cake.DotNetTool.Module/releases/tag/$(Version)</PackageReleaseNotes>
30+
</PropertyGroup>
31+
1432
<ItemGroup>
1533
<PackageReference Include="Cake.Core" Version="0.33.0" PrivateAssets="All" />
34+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
35+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
36+
<PrivateAssets>all</PrivateAssets>
37+
</PackageReference>
1638
</ItemGroup>
1739

1840
</Project>

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>

nuspec/nuget/Cake.DotNetTool.Module.nuspec

Lines changed: 0 additions & 23 deletions
This file was deleted.

recipe.cake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ BuildParameters.SetParameters(context: Context,
88
title: "Cake.DotNetTool.Module",
99
repositoryOwner: "cake-contrib",
1010
repositoryName: "Cake.DotNetTool.Module",
11-
appVeyorAccountName: "cakecontrib");
11+
appVeyorAccountName: "cakecontrib",
12+
shouldRunDotNetCorePack: true);
1213

1314
BuildParameters.PrintParameters(Context);
1415

0 commit comments

Comments
 (0)