I have a android gradle project where i have two buildTypes: QA and prod. I want to change a property in .properties file depending on the build type. I also want to change one of the value in settings.gradle file based on the buildType. I'm new to android and gradle so excuse me if this is a very basic question.
This is my .properties file:
build_number=3.1-SNAPSHOT
version_number=3.1.0
environment_name=prod //this needs to changed to environment_name=qa in qa environment
This is my settings.gradle file:
rootProject.name = 'tom-android-prod' //this needs to changed to rootProject.name = 'tom-android-qa' in qa environment
This is my build.gradle file:
apply plugin: 'com.android.application'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
}
}
android {
compileSdkVersion 21
buildToolsVersion "21.1.0"
defaultConfig {
multiDexEnabled true
}
dexOptions {
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
}
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
}
}
dependencies {
....
}