Skip to content

Instantly share code, notes, and snippets.

@gki
Created October 2, 2015 04:27
Show Gist options
  • Save gki/eaa9b54b6effeb0de8be to your computer and use it in GitHub Desktop.
Save gki/eaa9b54b6effeb0de8be to your computer and use it in GitHub Desktop.
[Gradle] copy file, replace, rename
task mycopy << {
println "$projectDir"
File filea = file 'filea.txt'
println filea.name
copy {
from "./"
into "./"
filter { line ->
line.replaceAll '<FIX_ME>', 'FIXED!!'
}
include 'filea.txt'
rename 'filea.txt', 'newfilea.txt'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment