zeromq / clrzmq4

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

Copy native libs using package build targets #50

Closed gillima closed 8 years ago

gillima commented 8 years ago

Using a simple MSBuild target, the native lib's can be copied to the output directory without adding them to each project as content.

leupibr commented 8 years ago

+1

metadings commented 8 years ago

Sorry, your change to the nuspec file will break the package.

Nuget does add all .dll within the lib folder into the project references, which should not be the case for native libraries. This is why I'm used to do them into the content folder. (nuget entirely breaks the installation, does a rollback and shows up with an exception.)

gillima commented 8 years ago

I've tested it with VS2013 without problems. NuGet seems only to add automatically when no reference is specified, but here the ZeroMQ.dll is specified... As you can see when you check the current package, .dlls are already in the lib folder because the files are recursively added by <file src="\bin\Release\**\*.*" target="lib\net40\" />:

$ find
.
./repositories.config
./ZeroMQ.4.1.0.17
./ZeroMQ.4.1.0.17/content
./ZeroMQ.4.1.0.17/content/amd64
./ZeroMQ.4.1.0.17/content/amd64/libsodium.dll
./ZeroMQ.4.1.0.17/content/amd64/libsodium.so
./ZeroMQ.4.1.0.17/content/amd64/libzmq.dll
./ZeroMQ.4.1.0.17/content/amd64/libzmq.so
./ZeroMQ.4.1.0.17/content/i386
./ZeroMQ.4.1.0.17/content/i386/libsodium.dll
./ZeroMQ.4.1.0.17/content/i386/libsodium.so
./ZeroMQ.4.1.0.17/content/i386/libzmq.dll
./ZeroMQ.4.1.0.17/content/i386/libzmq.so
./ZeroMQ.4.1.0.17/lib
./ZeroMQ.4.1.0.17/lib/net40
./ZeroMQ.4.1.0.17/lib/net40/amd64
./ZeroMQ.4.1.0.17/lib/net40/amd64/libsodium.dll
./ZeroMQ.4.1.0.17/lib/net40/amd64/libsodium.so
./ZeroMQ.4.1.0.17/lib/net40/amd64/libzmq.dll
./ZeroMQ.4.1.0.17/lib/net40/amd64/libzmq.so
./ZeroMQ.4.1.0.17/lib/net40/i386
./ZeroMQ.4.1.0.17/lib/net40/i386/libsodium.dll
./ZeroMQ.4.1.0.17/lib/net40/i386/libsodium.so
./ZeroMQ.4.1.0.17/lib/net40/i386/libzmq.dll
./ZeroMQ.4.1.0.17/lib/net40/i386/libzmq.so
./ZeroMQ.4.1.0.17/lib/net40/ZeroMQ.dll
./ZeroMQ.4.1.0.17/ZeroMQ.4.1.0.17.nupkg

If it's not working on your machine, it's also possible to do the same using the tools directory instead of the lib.

metadings commented 8 years ago

I don't really know - what I know is that it doesn't work as expected if there are changes to this file.

Look: I don't really care about problems using nuget. It's nice to have, but not a requirement. This also means that this program should work without it. So please, you may add a MSBuild target file, but it shouldn't expect this being a nuget package, or otherwise said, it should also work without nuget.

Limro commented 8 years ago

@gillima I would like to give you a hand getting this working on NuGet. The latest version in there is from August anyways, so an update should be added :) I will take a look at it when I get home.