I have a commercial Android project that I have created a client-specific version for (mainly UI tweaks). Since the bulk of the tweaks are in the res/ folder in XML files, we have the changes currently in a branch but I really don't want to have to port changes back and forth between branches in perpetuity. I'm curious if anyone has any source control strategies that will make managing multiple client-specific versions of an Android application as painless as possible.
Also, not sure if this belongs here or StackOverflow. Feel free to transition over there if I guessed wrong.
-
If you were using Mercurial, I'd suggest Mercurial Queues, so maybe stackoverflow.com/q/952651/42473 would be of some help.Mark Booth– Mark Booth2011年07月05日 16:07:33 +00:00Commented Jul 5, 2011 at 16:07
-
Have you checked out submodules? That might help.Nic– Nic2011年08月05日 22:56:32 +00:00Commented Aug 5, 2011 at 22:56
2 Answers 2
Have you consider apply a style of programming called FeatureToggle?
The basic idea is to have a configuration file that defines a bunch of toggles for various features you have pending. The running application then uses these toggles in order to decide whether or not to show the new feature.
While is hard, we usually use this style when it ́s hard to use branches.
More about this by Martin Fowler. http://martinfowler.com/bliki/FeatureToggle.html
The path we are going down is we are avoiding custom code as much as possible, and the app resources (everything in the res/ subdirectory) are stored in a separate git project with its own branches. That way we can decouple feature branches from UI branches and test features with different UI's without having to do the gymnastics from before where the UI was tied with the code on a per-branch basis, if that makes sense.