zeromq / clrzmq4

ZeroMQ C# namespace (.NET and mono, Windows, Linux and MacOSX, x86 and amd64)
GNU Lesser General Public License v3.0
237 stars 112 forks source link

Fix consuming native libraries in consumers projects #186

Closed cezarypiatekGC closed 4 years ago

cezarypiatekGC commented 4 years ago

Problem: If the consuming project is also packed as nuget then the native libraries are incorrectly handled - there are copied to content and contentFiles folders therefor incorrectly consumed by the downstream projects.

Solution: 1) Changing Content to None item group where the native libraries are attached prevents adding them to the nuget package of the consuming project (None item group is not packed by default) 2) Adding FixZeroMqPackageConsumptions target prevents excluding ZeroMQ.targets from consumption in the projects that indirectly reference ZeroMQ nuget package. This will generate the following dependency in the nuspect:

<dependency id="ZeroMQ" version="4.1.0.31" include="Runtime,Compile,Build,Native,ContentFiles,BuildTransitive" />

instead of

<dependency id="ZeroMQ" version="4.1.0.31" exclude="Build,Analyzers" />