void (boolean success) { int successes = success ? successCounter.incrementAndGet() : successCounter.get(); int errors = success ? errorCounter.get() : errorCounter.incrementAndGet(); if (successes + errors == rootPaths.size()) { if (!project.isDisposed()) { try { if (GradleImprovedHotswapDetection.isEnabled()) { GradleImprovedHotswapDetection.processInitScriptOutput(context, outputPathsFile); } else { Set<String> affectedRoots = getAffectedOutputRoots(outputPathsFile, context, executionSettingsBuilder); if (!affectedRoots.isEmpty()) { if (context.isCollectionOfGeneratedFilesEnabled()) { context.addDirtyOutputPathsProvider(() -> affectedRoots); } // refresh on output roots is required in order for the order enumerator to see all roots via VFS // have to refresh in case of errors too, because run configuration may be set to ignore errors CompilerUtil.refreshOutputRoots(affectedRoots); } } } finally { if (outputPathsFile != null) { FileUtil.delete(outputPathsFile); } } } resultPromise.setResult(errors > 0 ? TaskRunnerResults.FAILURE : TaskRunnerResults.SUCCESS); } else { if (successes + errors > rootPaths.size()) { LOG.error("Unexpected callback!"); } } }