I have a library that I want to create Nuget for which there is the following situation:
The library is compiled in different versions:
- Silverlight 4.0
- .Net 4.0
- .net 3.5
- Windows phone
Fortunately, all these platforms are supported by Nuget, so in the lib folder of my package I can create subfolders for each of these platforms, and Nuget will do everything correctly if the library is installed on any of these platforms.
The problem is that I have other dependencies that differ on the platform. For example: on Windows Phone, I need to enable a third-party zip library (wpSharpLibZip), but this dependency does not exist on other platforms that include zipping utilities.
Is this script supported in Nuget? I want the wpSharpLibZip dependency to exist only on the Windows Phone platform. Should I just create a separate package for the platform?
If this function does not exist, I can imagine that it is implemented something like this:
Changing the package manifest section to support:
<dependencies>
<dependency id="Newtonsoft.Json" version="3.5.8" />
<dependency id="wpSharpLibZip">
<platform>Silverlight 4.0 - Windows Phone</platform>
</dependency>
</dependencies>
Or in another way, there may be a separate separate .nuspec file inside each platform folder (under the lib folder), which could identify platform-dependent dependencies.
source
share