Hi, I have the following scenario:
I have a main Project, which will have ‘branding’ versions. So for a different country, for example Greece we will have little modified code and different resources. For Netherlands we will have again different code changes and resource changes.
We don’t want to make a new project for each country, so the Solution could be:
-
Make a folder ‘branding/greece’ and ‘branding/netherlands’, etc. In it we put ONLY the stuff that is different/changed - code, layouts, assets, etc.
-
Then make a Gradle script which copies the stuff from ‘branding/greece’ and the copies+replaces it into the main project directory. So contents of ‘branded’ ‘res’ and ‘src’ folders would be copied/replaced into the main project for example.
So this would make the main project appear to be as the ‘brand’ project and according .apk files would be generated.
- Since the main Project structure should not change permanently, there are two options:
-
Make a backup of the main project, and after building a ‘brand’ version delete the project with all the copied/replaced files - then restore the original project structure from the backup.
-
Somehow undo the copy/replace operation after building, but not sure if this is possible in Gradle.
I might be totally wrong about this, so any suggestions are welcome.