Search code examples
javagradleantzipbuild.gradle

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()?


Solution

  • Like this:

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