I want to replace a @VERSION@ token in a java source file with a version before building (Gradle is my build system of choice).
@VERSION@
In my current script a
a
To complement other answers, I found this idiom more simple if there's only one value you are looking to change:
task generateSources(type: Copy) { from 'src/main/java' into 'build/src/main/java' filter { line -> line.replaceAll('xxx', 'aaa') } }