The best way to organize source control for mobile platforms?

I am trying to figure out how best to organize my projects in source control. They have the same code, but they do not have and cannot use the same binary assemblies. Also, while the code itself is nearly 98% identical, there are various minor differences due to each platform. The current project is built for 4 platforms.

I am using Git as my original control, I tried to use multiple branches, but I got frustrated when I was working on branch 1 and wanted these changes to be pushed to branch 2 since the code is close but not identical. failed to merge, I need to manually copy the code and configure it.

So my current solution is separate repositories for each platform. Any thoughts on how this can be improved?

+1


source to share


2 answers


The usual way to support a multi-platform application is to have a single codebase that can be built for any supported platform, using things like #if

to enable and disable platform-specific parts. You definitely don't want to maintain them as separate branches and should copy all changes across all of them.



+1


source


If the differences are really small in the number of files, it would be better:



  • keep only one repo (no need for submodules for one large common codebase and small number of platform specific files)
  • keep branches to isolate development efforts (for example, prepare the next release or try some new feature), but not for platform-specific changes.
  • try to organize your code like this:
    • can generate the correct delivery for a given platform.
    • no need to isolate every platform-specific event in a branch, but rather across directories (one for each platform with files, including code specific to each platform).
0


source







All Articles