Refactoring the Ant tasks in build.gradle