I have an automated build process that I\'d like to extend so I can build the libraries I am distributing via NuGet. Currently, running nuget.exe to create the packages is
I'm doing the thing you want to achieve already in my current project:
Every assembly is built into its own proper nuget package, with dependencies in place.
I solved it by making a package folder in the project for which I wanted to make a nuget package. There I configure a nuspec file with the necessary information about the nupkg
There I make all the folders and unchanging files in there needed for Nuget package structure.
I added a post build step in the project that copies the files that just have been built into the package folder and run nuget.exe
So it goes:
nuget.exe with nuspec file in package folder.Nuget.exe has to be either in a fixed folder on your system and the buildserver (dirty solution) or included in your build (less dirty).
Buildscript:
Xcopy.exe /Y "$(TargetPath)" "$(ProjectDir)\Package\Lib"
cd "$(ProjectDir)Package"
"$(TargetDir)..\Buildscripts\Nuget.exe" pack MyPackage.nuspec xcopy /Y *.nupkg "$(TargetDir)"
In order to use this, the only thing you have to take care of, is deciding where to checkin the nuget.exe. I made a buildscripts folder on the top level of my development tree.