icordoba
icordoba

Reputation: 1899

How to duplicate Xcode project for different clients?

I am pretty new to Swift and Xcode. I have an app that will be delivered to multiple clients. The app is essentially the same and only changes the name, icon, colors (obviously bundles, certificates to test and deploy, etc) but 100% of source code is the same. What is the best approach for this? Having different projects in the unique workspace? Where should I include the specifics for every app.

I have also tried forking the whole git source tree (workspace and project) and changing the specifics but if I change something in the master project (bug fix for example), when I try to merge to the sub project, I get conflicts, for example in Info.plist file, as they have some different values.

Upvotes: 0

Views: 549

Answers (2)

Anton Rogachevskyi
Anton Rogachevskyi

Reputation: 219

It sounds pretty like white-label products (the same source code and behavior, but different look).

I used to make this stuff using multiple Targets for the product. It will avoid code duplication. You can change bundles, name and other configuration for each project target in project -> general.

!Also you can define a set of images, colours, icons or even different code for each target. Just set Target Membership on Utilities panel

But don't forget select all targets for common source code files and resources.

enter image description here

Upvotes: 0

Neil Stevens
Neil Stevens

Reputation: 3904

You could try using a branch for each client, or as you have suggested fork the code for each client. You could then have a info.client.plist in the branch or forked code and use a build event to merge this with info.plist on build. In your master branch you can have a info.master.plist. Then only commit these plist files and ignore info.plist.

You will also need to have a merge strategy in place so that you are checking what is being merged, you may get in to the situation where some code or a feature in clientA branch is specific to that client and so should not get merged, or conversely implemented something in master that should not be merged to a specific client.

There are many option to achieve what you are asking and without specifics of the application and how features will be implemented per client it is difficult to give a definitive answer on the best approach to use. The approach above is just one way of handling this, HTH.

Upvotes: 1

Related Questions