зеркало из
1
0
Форкнуть 0
Contains the DotNet.ReproducibleBuilds package
Перейти к файлу
Matt Kotsenas 714df2e174
Bump required SDK to 8+ and remove fixed issues (#52)
Bump the minimum required version of MSBuild to 17.8.0, which
corresponds to .NET SDK 8, which will soon be oldest supported version
of the SDK (see
https://learn.microsoft.com/en-us/dotnet/core/porting/versioning-sdk-msbuild-vs).

Doing so allows us to clean up / slim down the package:

- Remove our references to SourceLink, since it's now provided by the
SDK (reference:
https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/8.0/source-link)
- Remove setting `<EmbedUntrackedSources>` as it's already set to the
same value by the SDK (reference:
https://github.com/dotnet/sdk/pull/31632/files#diff-0adc92e620c2edfd1285b34be242429af4ff7116be50f6685b146b5c31a4de44R19)
- Remove setting `<IncludePackageReferencesDuringMarkupCompilation>` as
it's already set to the same value by the SDK (reference:
https://github.com/dotnet/sdk/pull/15465/files#diff-7d043b70287c061ddd2cc5ccc8ad0547b629b0eb9c60f3bce15b3b0f353744b9R26)

I also added unit tests and updated docs.
2024-09-06 12:08:18 -07:00
.config
Documentation
config
src
tests/DotNet.ReproducibleBuilds.Tests
.editorconfig
.gitattributes
.gitignore
CHECKLIST.md
CODE-OF-CONDUCT.md
CODEOWNERS
CONTRIBUTING.md
Directory.Build.props
DotNet.ReproducibleBuilds.sln
LICENSE
README.md
azure-pipelines.yml
dirs.proj
global.json
version.json

README.md

DotNet.ReproducibleBuilds

.NET Foundation Build Status

This repo is a collection of best practices for build reproducibility with MSBuild.

It provides documentation and NuGet packages to simplify build configuration and isolate builds from developer or workstation-specific settings.

DotNet.ReproducibleBuilds nuget package

NuGet Version NuGet Downloads

It's highly recommended that all projects enable these settings, either via adding this package or manually as described here: https://devblogs.microsoft.com/dotnet/producing-packages-with-source-link/

This package sets the following properties:

  • PublishRepositoryUrl = true
  • DebugType = embedded. You can specify portable in your project if you prefer, but you'll need to upload that .snupkg file too.
  • ContinuousIntegrationBuild = true on CI systems

More information on PublishRepositoryUrl and debugging with Source Link is here.

Usage

Add the following to your Directory.Build.props file so all projects in your solution have the package added -- use the latest package version.

<ItemGroup>
  <PackageReference Include="DotNet.ReproducibleBuilds" Version="1.2.4" PrivateAssets="All"/>
</ItemGroup>

MSBuild 16.10 is required to generate binaries that can be fully reproduced. You'll need Visual Studio 2019 16.10 and/or .NET 5.0.300 SDK. You'll get a warning if you're using a lower version.

Prerelease packages are available on the following NuGet feed: https://pkgs.dev.azure.com/dotnet/Projects/_packaging/ReproducibleBuilds/nuget/v3/index.json

DotNet.ReproducibleBuilds.Isolated Documentation and nuget package

NuGet Version NuGet Downloads

It's highly recommended that all projects enable these settings, either via adding this package or manually, as described in Documentation/Reproducible-MSBuild.

This package configures a variety of properties and item groups to prevent your build from unintentionally depending on other installed software that's not described by your repo. All build dependencies should come from either the MSBuild SDK you've chosen, or from nuget packages restored from your package feed.

If you check out the same commit with the same SDK version and same nuget feed, you should get the same build result.

Usage

Add the following to the top of your projects or to Directory.Build.props:

<Sdk Name="DotNet.ReproducibleBuilds.Isolated" Version="1.2.4" />

Tested on MSBuild 16.7 (Latest LTS at time of writing).

Contributing

See CONTRIBUTING.md for information on contributing to this project.

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information, see the .NET Foundation Code of Conduct.

License

This project is licensed with the MIT license.

.NET Foundation

DotNet.ReproducibleBuilds is a .NET Foundation project.

You should take a look at these related projects: