void (List<Module> pluginModules, Project project) { List<String> errorMessages = new ArrayList<>(); List<String> successMessages = new ArrayList<>(); CompilerManager compilerManager = CompilerManager.getInstance(project); CompileScope scope = compilerManager.createModulesCompileScope(pluginModules.toArray(Module.EMPTY_ARRAY), true); compilerManager.make(scope, new CompileStatusNotification() { @Override public void finished(boolean aborted, int errors, int warnings, @NotNull CompileContext compileContext) { if (aborted || errors != 0) return; ApplicationManager.getApplication().invokeLater(() -> { for (Module module : pluginModules) { if (!doPrepare(module, errorMessages, successMessages)) { return; } } if (!errorMessages.isEmpty()) { @NlsSafe String errorMessage = errorMessages.iterator().next(); Messages.showErrorDialog(errorMessage, DevKitBundle.message("error.occurred")); } else if (!successMessages.isEmpty()) { String title = pluginModules.size() == 1 ? DevKitBundle.message("success.deployment.message", pluginModules.get(0).getName()) : DevKitBundle.message("success.deployment.message.all"); @NlsSafe String successMessage = StringUtil.join(successMessages, "\n"); Holder.NOTIFICATION_GROUP.createNotification(title, successMessage, NotificationType.INFORMATION).notify(project); } }, project.getDisposed()); } }); }