static def createArchive()

in src/main/groovy/org/jetbrains/gradle/ext/IdeArtifacts.groovy [186:204]


  static def createArchive(String archiveName, File inputDir, File destinationDir) {

    ZipOutputStream output = new ZipOutputStream(new FileOutputStream(new File(destinationDir, archiveName)))

    output.withCloseable { closeableOutput ->
      inputDir.eachFileRecurse { file ->
        if (!file.isFile()) {
          return
        }

        String relativePath = inputDir.relativePath(file);
        closeableOutput.putNextEntry(new ZipEntry(relativePath));

        Files.copy(file.toPath(), closeableOutput)
        closeableOutput.closeEntry(); // End of current document in ZIP
      }

    }
  }