Git – Different feature set in multiple mobile apps from the same code base

development-processgitiosmobileproduct-features

I inherited a large code base (iOS / Objective-C) that is used to build multiple mobile apps. The apps have similar, but not identical UI.

The apps share a lot of common features, but there are features only found in one app. Some features can be later added to other apps.

Apps have relatively independent life cycle. Releases are not simultaneous. It is common to have two or three versions of each app in development at the same time: hotfix for the current published version, next minor version, next major version. Features can move between versions. I.e features can be postponed to the later version or moved to the earlier one.

For now there is a separate scheme for each app. Code contains quite a lot of conditional compilation to separate features. Code changes often transferred between branches (develop -> master, develop -> releaseXYZ) using git cherry-pick and git revert commands.

How can I reduce the pain of maintaining all this? I would really like to simplify feature set management between different versions of the same app and between different apps.

EDIT:
Thank you for your answers so far. I understand, that I need to split code base into some kind of modules. I would really appreciate if you tell me more how I can manage these modules efficiently / less painful.

Best Answer

I don't know how modular the code is, but in order to handle the complexity of all of this it might be useful to create API layers. The core library has the features/functions in all apps, with feature packs that can be included in each of the final apps. Essentially the dependency graph is intended to be a directed acyclic graph (DAG).

After organizing your features into modules, you may want to include extension points so that applications can inject functionality to take care of the things in the conditional compilation. That way your code won't break just because you make a change and then forget about the part in the condition.

In each specific app, you do all your customization and wiring together.

Related Topic