I currently work for a company that does WPF applications for our customers. We have been receiving lots of requests for Macintosh compatible applications, and I have a Xamarin.Mac license.
For the most part, we did a really good job of separating the view from the model in our applications. So, I created a brand-new Xamarin.Mac Cocoa project in Xamarin.Studio, copied over all of our shared code, created my Mac-specific UI and linked everything together. For the most part, this has worked very well.
However, we currently keep our Mac application in its own solution, and in its own source control system. So, while I was porting the code over to the Mac, the Windows team was finding and fixing bugs in the Windows application. Each time this happens, I need to manually port those code changes over to the Mac. Needless to say, it's not a fun or productive experience.
So, my "dream" situation would be to have the Mac application code be stored in the same .sln as the Windows application. That way, all of the common code will always stay in sync. The Visual Studio solution seems to be capable of being laid out this way:
-> Shared Code
--> Common Logging
--> Common Utils
The only thing is that the shared code isn't 100% shared. There are a few minor differences. For example, when I'm creating a log file, I want to put information about the computer that is running the application. One of the items is "OSVersion". On Windows, I'm able to use the "Environment.OSVersion.ToString()" method to get a unique identifier for the Windows OS, however, when executed on a Mac, that doesn't give me the information I desire. So, I have a method that opens up a plist (/System/Library/CoreServices/SystemVersion.plist) and parses the data in it to figure out my OS. (I'd guess 95% of the code is re-used without any modifications)
Is anyone else able to re-use the same .sln file for both Windows & Mac C# applications? Any ideas on how to handle the "almost the same" shared code?