dotnet / reproducible-builds

Contains the DotNet.ReproducibleBuilds package
MIT License
168 stars 18 forks source link

Add support for transitive reference #16

Closed meziantou closed 1 year ago

meziantou commented 2 years ago

The props/targets files are not imported automatically when the package is referenced transitively. Copying the props/targets files to buildTransitive/ should be enough to support transitive reference.

The main reason for this change is to allow creating meta-packages. These packages can reference Dotnet.ReproducibleBuilds and other packages (such as Roslyn Analyzers). Then, you can reference a single package to your projects.

https://github.com/NuGet/Home/wiki/Allow-package--authors-to-define-build-assets-transitive-behavior

baronfel commented 2 years ago

As an alternative, if the props/targets in buildTransitive had a shim import to the 'core' props/targets, that would work with less duplication.

In either case, we should do this.

meziantou commented 2 years ago

@clairernovotny What do you think of the proposed change?

clairernovotny commented 2 years ago

I agree with @baronfel; we can do this but lets reduce duplication.

meziantou commented 2 years ago

Do you want me to simplify buildTransitive\DotNet.ReproducibleBuilds.props and also the existing buildMultiTargeting\DotNet.ReproducibleBuilds.props? Or just the new file?

meziantou commented 2 years ago

I've updated the PR to simplify buildTransitive and buildMultiTargeting.