[mono-android] [MonoTouch] sharing code between mono touch and mono for android
nathan.clevenger at itr-mobility.com
Mon Feb 27 17:25:20 UTC 2012
Have you looked at the proposed solution/project structure and workflow
proposed in the new book, *Professional Cross-Platform Mobile Development
This is the approach that our firm has structured and managed 100+
cross-platform mono-based projects, and while it's not without its
idiosyncrasies, it does work quite well.
*From:* monodroid-bounces at lists.ximian.com [mailto:
monodroid-bounces at lists.ximian.com] *On Behalf Of *Jamie Briant
*Sent:* Monday, February 27, 2012 7:13 AM
*To:* monotouch at lists.ximian.com; monodroid at lists.ximian.com
*Subject:* Re: [mono-android] [MonoTouch] sharing code between mono touch
and mono for android
Is this as good as it gets? I'm attempting to build an MfA version of my MT
app and its proving extremely frustrating, to the extent that I'm
considering just writing the thing in Java. My reason for using MT was the
awfulness of Objective-C, and while java is frustrating its entirely
doable. The only thing at this point is the real possibility that a WP7
version will be next, so I might as well bite the bullet now.
Context: I'm using Visual Studio, Resharper, and my own Monotouch VSIX to
load MT projects. I edit entirely in VS, and build in MD on the mac. I've
tried Project Linker.
Problem: MfA, MT and WP7 require different .XXproj file formats.
There's no getting around this for WP7.
Why is this a problem?
1. "This file is open in another project". (and associated Intellisense
2. Refactorings don't refactor #if/#endif code.
3. Refactorings don't refactor code in linked projects at all.
4. Resharper completely horked.
Basically, I cannot work the way I work. And if I can't do that - if I
can't keep the apps in sync *as I work* I might as well use java: if I have
to retype the code I can just as easily convert it to java as I type.
Project Linker doesn't solve any of these. It makes things slightly less
broken, but the flip side is I managed to delete a whole ton of files off
disk as I tried to remove them from the MfA project.
Source Control as an alternative. I thought about having separate branches
and handling it that way. But this fundamentally fails for refactoring
often. It made me wonder how on earth teams of programmers collaborate.
When I decide to take a class, split it into two and then pull out a common
base, all with new names: how does a team deal with that? I refactor
*A Possible Solution*
Could the MT and MfA compilers/linkers/projects be made to accept WP7
projects as References? Then I could factor out common code into a shared
library - but it would claim to be WP7 so the WP7 app could use it. The MT
and MfA apps would ignore the fact that the library is WP7. MT could solve
any problems at code generation time anyway.
How do the rest of you do this? Is Project Linker as good as it gets? How
do you deal with intellisense/resharper being completely horked?
On Mon, Jan 30, 2012 at 11:30 PM, Miljenko Cvjetko <
mcvjetko at holisticware.net> wrote:
On 2012.01.31 01:59, Felix Collins wrote:
What is Project Linker?
Byproduct of Patterns and Practices project called Prism where MS guys
code sharing on WPF, SL and lately WP7 platform.
Project linker is just a tool VS plugin that helps batch linking of files.
project dependencies in sense of code sharing (copy as link + paste or copy
+ paste as link)
Greg's sample with M4A
I like the tool, cos it is nonintrusive regarding IDE tools, does not break
VS (other plugins) and
works with MonoDevelop too (meaning one can do the linking in VS and all
links are picked up).
Right now besides integrating MTch stuff I'm trying to extend our
MultiTarget solution template to
include Project Linker stuff from the beginning, so the manual addition of
links is not necessary.
On 31/01/2012 12:46 p.m., Miljenko Cvjetko wrote:
Sharing code with Project Linker
Miljenko Cvjetko dipl.ing. ET
Projektant rješenja/Solution Architect
Razvojni programer/Senior developer
Voditelj projekta/Project Manager
IX južna obala 13
T: 385 1 7775555
M: 385 91 557 447 3
F: 385 1 7779556
e: mcvjetko at holisticware.net
MonoTouch mailing list
MonoTouch at lists.ximian.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Monodroid