libyal / libvmdk

Library and tools to access the VMware Virtual Disk (VMDK) format
GNU Lesser General Public License v3.0
163 stars 66 forks source link

Add nuget targets file. #25

Closed APriestman closed 3 years ago

APriestman commented 3 years ago

Change nuget paths to prevent warning.

APriestman commented 3 years ago

Having the .targets file allows easier integration into Visual Studio - it sets up the include/library folders and copies the dlls.

Switching from "lib" to "build" for the base folder seems more consistent with other packages I've seen, and having it as "lib" was generating a warning when I ran nuget pack.

joachimmetz commented 3 years ago

FYI the libvmdk.nuspec file is generated by https://github.com/libyal/libyal/blob/master/scripts/source-generate.py. Any documentation on these changes and the target file format?

APriestman commented 3 years ago

Looking at it further, it seems like the .targets file does need to be in a build folder, but a lib folder also makes sense. Let me see if it works to only put the .targets file in build and leave the lib folder as-is.

https://docs.microsoft.com/en-us/nuget/create-packages/creating-a-package#including-msbuild-props-and-targets-in-a-package

joachimmetz commented 3 years ago

ack, let me know how that turns out. I recall the lib folder was the advise/default for an earlier version of nuget creation tools. I've not followed this space too much.

APriestman commented 3 years ago

It is still unclear to me how this is supposed to be done. But it's not that bad setting up the includes/libraries on our end for the existing nuget package so I think we can just stick with that. Sorry for the trouble.

Incidentally, any chance of getting a libewf nuget package?

joachimmetz commented 3 years ago

Incidentally, any chance of getting a libewf nuget package?

yes, is building on AppVeyor as we speak. if that succeeds I'll deploy it

It is still unclear to me how this is supposed to be done.

What part? I thought VS pulls in the files using nuget and then you'll have to make sure the project files include the library and include paths.

joachimmetz commented 3 years ago

built and deployed: https://www.nuget.org/packages/libewf/

APriestman commented 3 years ago

Excellent!

Yes that is how I'm doing it now. Some nuget packages have a .targets file that will automatically add the include folders/lib folders and copy over the dlls at the end (the versions of openssl and zlib I have do this) so you don't need to edit the build file at all. What I'm still unclear about is how to properly have a lib folder like you have now but still support this. But as I said, editing the project files isn't that much work.

joachimmetz commented 3 years ago

The nuget documentation is far from specific but maybe this is an indication into cause https://docs.microsoft.com/en-us/nuget/guides/native-packages

NuGet cannot directly add references to a C++ project