def filesDir = $files.getFilesDir() def src = $files.buildFile { setPath(filesDir, "tmp/abc.txt") } src.writeText("hello world", "UTF-8") def dest = $files.buildFile { setPath(filesDir, "tmp/abc.zip") } $console.log($files.zipFile(src, dest, null)) $console.log(dest.exists() && dest.isFile()) src.delete() dest.delete()