dotnet / msbuild

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
https://docs.microsoft.com/visualstudio/msbuild/msbuild
MIT License
5.17k stars 1.34k forks source link

Improved UX for nuget developers - referencing project as nuget #8772

Open JanKrivanek opened 1 year ago

JanKrivanek commented 1 year ago

Summary

V-Next continutation of https://github.com/dotnet/msbuild/issues/8398 Add option to to treat referenced project (ProjectReference) as NuGet package (PackageReference).

This way the package developer could have a solution containing the project producing the package as well as project integration testing the package, that is utilizing not only the actual code, but as well other possible assets (analyzers, msbuild .props/.targets files). This can currently be achieved only via additional steps (packing the project, flushing nuget caches, adding the location with build package to sources, referencing the build package).

Related:

jrdodds commented 1 year ago

... as NuGet package (PackageDependence).

Should that be PackageReference?

atrauzzi commented 4 months ago

This would be extra nice if the references could be to projects in other solutions as well. Thereby enabling multi-repo scenarios where packages are built in a separate code repository.

JanKrivanek commented 4 months ago

This would be extra nice if the references could be to projects in other solutions as well. Thereby enabling multi-repo scenarios where packages are built in a separate code repository.

The solution (.sln) boundary is usualy not a big deal for msbuild (as it operates on projects and their dependencies) - as soon as there is no additional build logic, that is not a part of the said project (e.g. custom build script used to produce nuget). That happens as well - and in such case some specific conventions would need to be prescribed and followed (something along the lines of https://github.com/dotutils/MSBuild.BuildLink/blob/main/docs/buildlink.json.md).

All that being said - this topic is currently below the focus line of the team. So no promisses (but stay tunned ;-))