I have a library which I want to create a Nuget package for which has the following situation:
The library compiles to different versions:
- Silverlight 4.0
- .Net 4.0
- .net 3.5
- Windows Phone
Luckily all of these platforms are supported by Nuget so in the lib folder of my package I can create sub folders for each of these platforms and Nuget will do the right thing when the library is installed on any of those platforms.
The problem is I have some other dependencies which differ by platform. For example: On the Windows Phone I need to include a 3rd party zip library (wpSharpLibZip) but this dependency does not exist on the other platforms which have zipping utilities included.
Is this scenario supported in Nuget? I want to be able to have the wpSharpLibZip dependency to only exist on the Windows Phone platform. Do I have to just create a separate package per platform?
If this feature doesn't exist I could imagine it being implemented something like:
Changing the section of the package manifest to support:
<dependencies>
<dependency id="Newtonsoft.Json" version="3.5.8" />
<dependency id="wpSharpLibZip">
<platform>Silverlight 4.0 - Windows Phone</platform>
</dependency>
</dependencies>
Or another way could be to allow for a seperate .nuspec file inside of each platform folder (under the lib folder) which could spell out platform specific dependencies.