Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paket.pack: add support for nuget dependencies conditional on target framework #913

Closed
eiriktsarpalis opened this issue Jul 5, 2015 · 9 comments

Comments

@eiriktsarpalis
Copy link
Member

As of Nuget 2.0, support for package dependencies that that are bound to specific target frameworks has been included. For instance:

<dependencies> 
   <group>
      <dependency id="RouteMagic" version="1.1.0" />
   </group>

   <group targetFramework="net40">
      <dependency id="jQuery" />
      <dependency id="WebActivator" />
   </group>

   <group targetFramework="sl30">
   </group>
</dependencies>

I'm not entirely sure how this feature would fit in with the design philosophy of paket, but I'd be interested to see having something like this added to the paket.template syntax.

@forki
Copy link
Member

forki commented Jul 19, 2015

First question: how could this look in our current paket.template syntax?

/cc @mavnn

@eiriktsarpalis
Copy link
Member Author

I guess it could be worked out like this:

dependencies
    RouteMagic 1.1.0
dependencies targetFramework=net40
    jQuery
    WebActivator

I have a few misgivings on the compatibility of this feature with the overall paket design philosophy. For example:

dependencies targetFramework=net35
    Newtonsoft.Json ~> 4.0
dependencies targetFramework=net40
    Newtonsoft.Json ~> 5.0

requires that two separate versions of the same package be present in one environment, which AFAIK is not supported by paket.

@forki
Copy link
Member

forki commented Aug 5, 2015

yes.

dependencies targetFramework=net35
    Newtonsoft.Json ~> 4.0
dependencies targetFramework=net40
    Newtonsoft.Json ~> 5.0

would be problematic, but only if your app uses both targetFrameworks. If not you can resolve the conflict with paket.

@enricosada
Copy link
Collaborator

with new TFM (target framework monikers) and .NET Core that's going to be really useful (needed?) because for some frameworks the library/app depends on different packages.

Some examples:

  • some bcl assemblies are split in multiple assemblies/packages. So in .net 4.5 is a package, in .net core multiple packages
  • FSharp.Core for .NET Core in a different package ( Microsoft.FSharp.Core.netcore ) instead of FSharp.Core package (but that should be temporary i hope)

for example Chessie fsprojects/Chessie#43 ( .NET 4.6 and .NET Core with dnxcore50 atm but i am going to move it to netstandard asap )

@davidschwegler
Copy link
Contributor

davidschwegler commented May 2, 2016

We can't use paket to make nuget packages without this, since we have Xamarin packages (which of course use multiple frameworks, and our iOS frameworks obviously can't depend on Android dependencies).

@cdrnet
Copy link
Member

cdrnet commented Sep 10, 2016

I have a need for this as well. But I'll also have to specify empty groups to be able to end up with the following:

<dependencies>
    <group targetFramework=".NETFramework3.5">
        <dependency id="TaskParallelLibrary" version="1.0.2856" />
    </group>
    <group targetFramework=".NETFramework4.0" />
</dependencies>

Maybe this could then become:

dependencies targetFramework=net35
    TaskParallelLibrary >= 1.0.2856
dependencies targetFramework=net40

@Thorium
Copy link
Member

Thorium commented May 10, 2017

Type OptionalPackagingInfo at TemplateFile.fs has Dependencies and FrameworkAssemblyReferences, instead of having a list, they should have a map or tuple of groupname*list pairs.

The framework assemblies also have this targetFramework:

<frameworkAssemblies>
  <frameworkAssembly assemblyName="mscorlib" targetFramework=".NETFramework4.6.3" />
  <frameworkAssembly assemblyName="System.Core" targetFramework=".NETFramework4.5" />
  <frameworkAssembly assemblyName="System.Core" targetFramework=".NETFramework4.6.3" />
</frameworkAssemblies>

bhugot added a commit to bhugot/Paket that referenced this issue Jun 16, 2017
forki added a commit that referenced this issue Jun 18, 2017
Implementation for #913 Paket.pack: add support for nuget dependencies conditional on target framework
@seanamosw
Copy link
Contributor

I see #2428 was merged, I haven't been able to figure out a way to generate:

<group targetFramework="net451" />

Basically specify no dependencies for a target framework.

@matthid
Copy link
Member

matthid commented Sep 3, 2017

@seanamosw Please open a new issue if this is still the case.

@matthid matthid closed this as completed Sep 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants