The recommended way to do resource filtering in Gradle is by having tokens in the properties file and then replacing them when processing.
Example
# config.properties
hostname = @myhost@
and in build.gradle do something like below
processResources {
filter ReplaceTokens, tokens: [
"myhost": project.property('myhost')
]
}
The problem with this approach is that it won't work when running from IDEs like eclipse. I would like the property files to be free of Gradle specific tokens i.e just have
hostname = localhost
but have option to replace it when building from Gradle.