sestoft / C5

C5 generic collection library for C#/.NET
http://www.itu.dk/research/c5/
MIT License
1.03k stars 181 forks source link

Allow building a non-PCL and put PCL and non-PCL in nupkg. #19

Closed LHCGreg closed 10 years ago

LHCGreg commented 10 years ago

Manually edited the .csproj to allow building C5 as a PCL and a non-PCL and wrote a .bat script to build a nuget package containing both the PCL version and a net40 version. PCLs do not work on versions of Mono earlier than 3.x. Even the latest version of Ubuntu is not on 3.x yet.

I'm not sure how Visual Studio treats the changes in the .csproj or if it will even open the project. I only have the express edition which does not open PCL projects. Command line builds do work though.

ondfisk commented 10 years ago

Thanks :) I'll have a look at it soon. Hopefully Next week.

ondfisk commented 10 years ago

Hi Greg, I had to undo the pull request as it breaks compatibility for PCL in .NET 4.0. This happens when you reference C5 in a PCL and then try to reference the PCL in a standard .NET 4.0+ project. I see that NuGet now has support for specific Mono folders but they are probably only working for Mono 3+. If you have any suggestions as how to fix this, I'll gladly take another pull request :)

LHCGreg commented 10 years ago

When you say "reference" do you mean the plain old "add reference" reference or a nuget package install reference? VS Express doesn't support building PCLs so I'm not able to try to reproduce it. I'm surprised it doesn't work because Json.NET, a very popular JSON library, includes portable-net45+wp80+win8, portable-net40+sl4+wp7+win8, netcore45, net45, net40, net35, and net20 versions in its package.

I guess I'll just bundle a non-PCL build of C5 in the MyMediaLite package instead of declaring a package dependency on C5. Thanks for looking into this.

ondfisk commented 10 years ago

Hi Greg, I've just published a new version which should support all scenarios, including .NET 3.5, .NET 4.0, and universal. Hope this helps :)

LHCGreg commented 10 years ago

Awesome, thanks! I'll take a look this weekend.

LHCGreg commented 10 years ago

Works great on Mono 2.10.8.1. :)

ondfisk commented 10 years ago

Awesome :)