I’d like to use Gradle to package two .java files in a .zip file – so I added to my build.gradle.ktl file the following code. I have no build errors and running ./gradlew assemble –dry-run I can see the new task being executed, but I actually don’t see the expected .zip file (anywhere, not just on desktop as expected). Anything I could be missing / doing incorrectly? Thanks!
tasks.register<Zip>("packageFiles") {
from("bootrecoverybackend/src/main/java/mbr_backend/Closer.java")
from("bootrecoverybackend/src/main/java/mbr_backend/SambaThread.java")
archiveFileName.set("zippedFiles.zip")
destinationDirectory.set(file("/Users/c11886/desktop")) // NOPE :(
}
tasks.named("assemble") {
dependsOn("packageFiles")
}
I tried a code from answers to similar “how to package” questions on Stackoverflow. I was expecting a .zip file being generated and put on desktop, but no .zip file is generated or put anywhere in my machine