5
Vote

multi-platform nuget.exe pack proj[] -nuspec

description

Given the following scenario:
  • A single solution with multiple projects containing a linked code base
  • Each project targets a different framework
  • All project versions are kept in sync
Goal is to have a single nuget package containing a version of the same DLL compatible with the different target frameworks, e.g.
lib\net20
lib\net35
lib\net40
lib\net45
lib\sl4
lib\wp8
...

Currently, this can only be done using the convention-based working directory approach.
This means all project output paths must be redirected and the user should go create such directory tree on-the-fly or commit it to source control for it to work everywhere.

Suggestion:
Make nuget.exe pack support an array of project files could avoid this. Providing a single nuspec would become mandatory though. Also, if different versions of dll's are detected, then the command should error and point the user to the -Version option or tell them to align the versions.

E.g.
nuget pack AwesomeLib-NET20.csproj;AwesomeLib-NET40.csproj -nuspec AwesomeLib.nuspec

comments