Code: Select all
// watch folders and print files that were added/modified (requires Java 7)
def watchman = args.watch { files ->
println files
}
// process after 500ms without any changes to the folder
watchman.commitDelay = 500 // default = 5min
watchman.commitPerFolder = true // default = true
println 'Waiting for changes'
console.readLine() // keep running and watch for changes