I have the following in my android app
#MyAndroidApp/assets/app.properties
server=localhost
....
....
when building the app, I would like to change the value of 'server' from localhost to whatever is defined in gradle.properties.
The 'java' plugin allows me to do this
processResources {
def serverHostName = project.hasProperty("serverhost") ? project.property("serverhost") : "localhost"
filter ReplaceTokens, tokens: [
"serverhost": serverHostName
]
}
Similarly, I thought I could override processDebugResources and processReleaseResources in Android but unfortunately its not possible. Is there any other alternative way?
I checked out 'productFlavors' but it requires to define whole new project structure, all I want is to change a single property here.