rewrite gradle plugin in groovy