Different builds for different brands

We are developing an app for a customer that owns different brands and the we have to build the same app(functionalities) for each brand in separate apks to publish them in the stores.

The main differences between the apks will be the logos and main colors. We can achieve this with a gulp task that chooses between the correct css and imgs before the build process.

The problem comes with the app name and id(cordova’s config.xml file). Each brand will have it’s own app name and id, how can we handle this requirements to automate the different build processes? Is it posible to have different config.xml files in the same project?

thanks & regards

Hi Jon , I have a similar issue and i was wondering if you had found a solution. the only thing i can think of is to create a gulp task that removes/adds the platform after modifying the config.xml. once fro each brand.

We finally took the next solution that fits our needs although I think it could be improved.

We hace separate Ionic projects for each brand that share a common “src” folder. (Actually, we have three Ionic projects for each brand: Android, Android&xwalk and ios)

We have a common “src” folder for all the projects. Inside this “src” folder, there is a folder for each brand for brand specific code.

Every Ionic project has a gulp task that copies all the code from the outer “src” to it’s www folder, and overrides the common code with it’s brand specific folder. We have parametrized the task with a “compress” param to be able tu run the minify,uglify, etc. tasks for production builds.

We follow the same rules with the scss files, so we have brand specific folders. We also have a gulp task that runs a scss compilation of each brand and copies the result to it’s brand folder inside src.

Project structure:

  • brand1-android
    • www
  • brand1-android-xwalk
    • www
  • brand1-ios
    • www
  • brand2-android
    • www
  • brand2-android-xwalk
    • www
  • brand2-ios
    • www
  • src
    • brand1
      • js
      • templates
      • img
      • css
    • brand2
      • js
      • templates
      • img
      • css
    • js
    • templates
    • img
  • scss
    • brand1
    • brand2
  • brand1-resources
  • brand2-resources
  • bower.json
  • package.json

Hello jonmikelm

can you please share demo code for above explanation, because it will help me to create different branding and i have same requirement as you suggest

did you find the solution??