public static void startPackagingFiles(Project project, List<? extends VirtualFile> files, Artifact[] artifacts, final @NotNull Runnable onFinishedInAwt) {
    startPackagingFiles(project, files, artifacts, true).doWhenProcessed(
      () -> ApplicationManager.getApplication().invokeLater(onFinishedInAwt));
  }
public static void startPackagingFiles(Project project, List<? extends VirtualFile> files, Artifact[] artifacts, final @NotNull Runnable onFinishedInAwt)