'change ant.zip() output directory

I want to store output of ant.zip() inside build directory. I'm doing it the following way for now.

ant.zip(destfile: sourceDirectory.name + ".zip") {
    fileset(dir: sourceDirectory.path)
}

ant.move(todir: "$project.buildDir" + "/zip") {
    fileset(dir: "$project.projectDir", includes: "*.zip")
}

Is there way to directly do it in ant.zip()?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source