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

Add .NET 3.5 Backwards Compatibility #191

Merged
merged 51 commits into from Mar 13, 2012

Conversation

kamranayub
Copy link
Contributor

Pull Request for Issue #168

Goals

  • As much shim transparency as possible to not disrupt existing codebase
  • Totally automated multi-targeted build process
  • No extra Nuget packages
  • As little extra configuration as possible for end-users (this will be eliminated in Nuget 1.8 hopefully)
  • Least maintenance headache as possible (the only annoying thing will be updating Cassette's own nuget dependencies)

Rundown

  • Added Cassette.FX35.sln for easy 3.5 development
  • Added shims where needed to add support for .NET 3.5, redirects or uses .NET 4 native methods in 4.0 mode (uses NET40 and NET35 constants)
  • Modified csproj files to conditionally reference/include files based on TargetFrameworkVersion
  • Added contribution documentation to help contributors code against 3.5
  • Cassette, Web, Views, UnitTests, and IntegrationTests all have .NET 3.5 configurations (Debug-FX35, Release-FX35)
  • Updated build.xml to support multi-targeting
  • Updated Nuget package workflow using XDT transformations (less maintenance)
  • Added DotNet35 example web project
  • Added documentation to Cassette website under Getting Started
  • Removed WebActivator in favor of CassetteHttpModule starting/stopping Cassette (@andrewdavey's suggestion to avoid a new Nuget package)

Potential Issues

  • Will the HttpModule be as good as WebActivator? Remains to be seen. In Nuget 1.8 (hopefully) we can reintroduce the dependency for .NET 4 and use this method for 3.5 (that will also remove any extra configuration for end-users).
  • CoffeeScript compilation is using old multi-threaded method

Conflicts:
	src/Cassette/CassetteApplicationContainerFactoryBase.cs
…includes in csproj file for Cassette project to support multi-targeting.
Added a new page to website documentation for how to configure Cassette in .NET 3.5
Changed how Nuget packaging works to support multiple framework targeting. Updated Fx35 docs with a gotcha I ran into during testing.
…orkaround in IsolatedStorageFile and opted to throw NotImplementedException instead for LastWriteTime
…uild to 3.5 as well. All tests pass and everything is green. Nuget packages are ackaged correctly based on local feed test. This is a fully stable (and working) commit!
…); Fixed Cassette nuspecs to use Pandora.dll from lib35/lib40 folder.
…; fix NET40 constant not being in Views or Web
@@ -66,7 +66,7 @@ public IEnumerable<IFile> GetFiles(string searchPattern, SearchOption searchOpti
var storage = getStorage();
return storage.GetFileNames(searchPattern).Select(
filename => new IsolatedStorageFile(GetAbsolutePath(filename), getStorage, this)
);
).Cast<IFile>();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another variance thing for 3.5

@andrewdavey
Copy link
Owner

This is amazing! I've only had time for a quick scan of the commits, but it's looking great.

I've just released 1.1.0. I'll do a full review of this pull request and aim to get it merged in for the next release. I'm away most of next week and following weekend, so this may take a little while. It's top of my Cassette to-do list though :)

I'll add more inline comments as I'm reviewing. Thanks again!

@kamranayub
Copy link
Contributor Author

No problem! I'm glad to be of service. Just let me know if there things I should add/remove and I'll commit them.

@kamranayub
Copy link
Contributor Author

Merged in your latest v1.1 changes :)

@kamranayub
Copy link
Contributor Author

@andrewdavey, do you want me to try and keep this in-sync with all your latest changes? Or will you be taking care of that when you merge this in?

@andrewdavey
Copy link
Owner

If you've got the time to re-sync this branch then please do. I'm very busy this week, so I'll take all the help I can get :) Thanks!

…ork around dynamic keyword. Including Iron/SASS dependencies in Nuget package instead of as dependency references to keep one Nuget package. Might need to include licenses if we do this.
@kamranayub
Copy link
Contributor Author

I synced all the changes, however I don't think we can support SASS just yet for FX35 (or ever?). I was able to compile IronRuby against 3.5, but it seemed to have some underlying references to .NET 4. Furthermore, the SassAndCoffee package is targeted at .NET 4, so we'd need to fix all of that... and finally, the SassCompiler is using the dynamic keyword and we'd need to work around that. Blah.

Also, I had to manually include all the SASS dependencies in the lib40 folder of Cassette's Nuget package... this might require us to include the licenses for IronRuby and SassAndCoffee. We could split it out (again, hard for people to upgrade), make it a separate dependency (Cassette.Sass), or wait until Nuget 1.8 (approximately) supports targeted dependencies.

PS. I did not try to convert the Jasmine project to FX35. Maybe I'll try later this week but it's dependent on WebActivator, but only to add routes so maybe we can have extra instructions for people when using FX35.

@andrewdavey
Copy link
Owner

That's unfortunate. I wonder what the ETA on Nuget 1.8 is? Framework targeted dependencies would solve most of our problems, since I don't mind saying Sass support is only for .NET 4 and above.

A temporary solution for .NET 3.5 is to not create a nuget package, but simply provide binaries the old school way i.e. a zip file :)

Once Nuget supports targeted dependencies, we can roll them into the main nuget package.

@kamranayub
Copy link
Contributor Author

We could do that, especially now that there is more of a difference between versions (and might continue to be). Could use MSBuild ext pack to zip automatically or else can just copy the required DLLs to a directory and zip it manually to upload to GitHub. Could also go full throttle and auto-upload to Github when using NugetPush target.

Since it's temporary, the manual method would probably be just fine.

@andrewdavey
Copy link
Owner

I'm okay with a manual approach for now :)

…leases until Nuget supports targeted dependencies. Output goes to build\Cassette.Fx35-{version}
@kamranayub
Copy link
Contributor Author

Alright, it's done... will need to update the web doc though now to include some new steps.

@kamranayub
Copy link
Contributor Author

Nice and clean merge of 1.2.0 done!

@andrewdavey
Copy link
Owner

Awesome!!

@andrewdavey andrewdavey merged commit da16a84 into andrewdavey:master Mar 13, 2012
@andrewdavey
Copy link
Owner

Merged!

I made some minor edits to remove unused members, internalize some types and cleaned up usings to keep ReSharper quiet :) There's still an odd issue with the Conditional references where ReSharper gets confused an tries to use both. I can probably live with the false error for now.

I'll do some more testing and should be able to get a release out next weekend.

Thanks again for all the work here.

@kamranayub
Copy link
Contributor Author

Wow, some people are gonna be real happy. Thanks for being patient with all
the questions!

On Tue, Mar 13, 2012 at 5:48 PM, Andrew Davey <
reply@reply.github.com

wrote:

Merged!

I made some minor edits to remove unused members, internalize some types
and cleaned up usings to keep ReSharper quiet :) There's still an odd issue
with the Conditional references where ReSharper gets confused an tries to
use both. I can probably live with the false error for now.

I'll do some more testing and should be able to get a release out next
weekend.

Thanks again for all the work here.


Reply to this email directly or view it on GitHub:
#191 (comment)

Kamran Ayub

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.

None yet

3 participants