Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Best way to organize solutions for Xamarin.Forms PCL with multiple dependent iOS/Android Apps

$
0
0

Hello,

QUESTION:
1) What is the best way to layout multiple apps that depend on a single core PCL?
2) Do Workspaces do anything to help this problem?

BACKGROUND:
I've been working with Xamarin.Forms building some projects with the following layout that is generated by the Xamarin.Forms template (New Solution->MobileApps->BlankApp (Xamarin.Forms Portable)

  • SolutionName
    |- SolutionName.Core (PCL Library)
    |- SolutionName.App1.Droid
    |- SolutionName.App1.iOS
    |- Tests.PCL
    |- Tests.App1.iOS
    |- Tests.App1.Droid

This is pretty much the layout in the tutorials presented on the Xamarin website.

So now, I want to develop some additional Apps that will depend on the SolutionName.Core PCL library.

IDEAS:
1) Add to SolutionName additional projects like SolutionName.App2.Droid, etc. This way is going to quickly lead to a very busy solution. Also, my git repository (NOT using the internal Xamarin Studio version control) will have all apps chunked together, so not ideal.
2) Create a new solution (SolutionName.App2) and bring in PCL Project project (Add Existing Project). Then add new App2.iOS and App2.Droid + associated tests. Any changes I make in the PCL Project are reflected in SolutionName.App2 as well.
3) Change the layout in my original solution to look like:

  • SolutionName.Core
    |- SolutionName.Core (PCL Project Holding objects common to all apps (Models, serialization, Business Logic))
    |- Tests.PCL

  • SolutionName.App1
    |- SolutionName.Core (Add Existing PCL from SolutionName.Core)
    |- SolutionName.App1 (New PCL) - PCL for App1 (Mainly View and ViewModels, removed from the current PCL Project)
    |- SolutionName.App1.iOS (New)
    |- SolutionName.App1.Droid(New)
    |- Tests.App1.iOS(New)
    |-Tests.App1.Droid(New)

And for every new app, create a new solution:

  • SolutionName.App2
    |- SolutionName.Core (Add Existing PCL from SolutionName.Core)
    |- SolutionName.App1 (New PCL) - PCL for App2 (Again, mainly View and ViewModels)
    |- SolutionName.App2.iOS (New)
    |- And so on...

Right now, I like solution 3 the best. Looks scalable. More solutions to track, but a nice clean demarcation line for my git repositories.

Any insight and ideas are greatly appreciated. Curious if anyone has any solutions involving Workspaces. Just now starting to play with them and still not quite sure what they are for.

Thanks,

Shane


Viewing all articles
Browse latest Browse all 58056

Trending Articles