The project that I am working is built for both Amazon based devices as well as Android. Almost of 95% of the code base is common between these two. So instead of making these two as different projects, I thought of putting these two together using product flavors.(Please let me know if there can be other better solution)
But one of the problem I am facing here is with the buildscript and android properties in build.gradle, where I will need different values for Amazon and Android. For example, I need this for Android
dependencies {
classpath 'com.android.tools.build:gradle:1.1.3'
}
and this for Amazon
dependencies {
classpath 'com.amazon.device.tools.build:gradle:1.0.0'
}
Similarly for compileSdkVersion and buildToolsVersion as well.
If I need to have two different build.gradles for each, how should I let one of them get picked based on the build flavor? ( I am not sure if it is really possible)
If not, is there really a better possible solution to fix this problem by placing everything in the same project.
Thanks in advance.