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

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

Merged
merged 1 commit into from
Nov 21, 2013

Conversation

LHCGreg
Copy link
Contributor

@LHCGreg LHCGreg commented Oct 20, 2013

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.

Passing /p:PCL=false to msbuild will build a non-PCL dll. This
is necessary for C5 to run on versions of Mono earlier than 3.x.

I'm not sure what effect the conditionals inserted into the
.csproj have on Visual Studio. I am not able to open C5 in
Visual Studio because I only have the Express edition.

Changed nuspec to contain id, version, etc directly because
the package will need to be built passing the .nuspec instead of
the .csproj in order to build a package with multiple target
frameworks (net40 and portable-win+net40+sl40+wp+Xbox40).

Added a .bat script for building a package. It does a rebuild of
C5 and copies the dll and xml file to
package\lib\portable-win+net40+sl40+wp+Xbox40\

then does it again, passing PCL=false to msbuild and copying
to package\lib\net40\

Finally it does a nuget pack.
@ondfisk
Copy link
Collaborator

ondfisk commented Oct 30, 2013

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

ondfisk pushed a commit that referenced this pull request Nov 21, 2013
Allow building a non-PCL and put PCL and non-PCL in nupkg.
@ondfisk ondfisk merged commit 612088d into sestoft:master Nov 21, 2013
ondfisk pushed a commit that referenced this pull request Nov 21, 2013
@ondfisk
Copy link
Collaborator

ondfisk commented Nov 21, 2013

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
Copy link
Contributor Author

LHCGreg commented Nov 22, 2013

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
Copy link
Collaborator

ondfisk commented Jun 10, 2014

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
Copy link
Contributor Author

LHCGreg commented Jun 11, 2014

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

@LHCGreg
Copy link
Contributor Author

LHCGreg commented Jun 16, 2014

Works great on Mono 2.10.8.1. :)

@ondfisk
Copy link
Collaborator

ondfisk commented Jun 16, 2014

Awesome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants