The recommended way to do resource filtering in Gradle is by having tokens in the properties file and then replacing them when processing.
Example
#
You could use the following (not tested):
processResources {
filesMatching('**/config.properties') {
filter {
it.replace('localhost', project.property('myhost'))
}
}
}
Or you could have a default file, used during development in your IDE, and have another file containing tokens and replacing the development one when building using gradle. Something like this (not tested)
processResources {
exclude '**/config.properties'
filesMatching('**/config-prod.properties') {
setName 'config.properties'
filter ReplaceTokens, tokens: [
"myhost": project.property('myhost')
]
}
}