port bash script as gradle tasks