mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
force running compiler in a non-AWT thread in test mode
This commit is contained in:
@@ -213,7 +213,7 @@ public class CompileDriver {
|
||||
}
|
||||
scope = addAdditionalRoots(scope, ALL_EXCEPT_SOURCE_PROCESSING);
|
||||
|
||||
final CompilerTask task = new CompilerTask(myProject, "Classes up-to-date check", true);
|
||||
final CompilerTask task = new CompilerTask(myProject, "Classes up-to-date check", true, false);
|
||||
final CompileContextImpl compileContext = new CompileContextImpl(myProject, task, scope, createDependencyCache(), true, false);
|
||||
|
||||
checkCachesVersion(compileContext, ((PersistentFS)ManagingFS.getInstance()).getCreationTimestamp());
|
||||
@@ -549,7 +549,7 @@ public class CompileDriver {
|
||||
|
||||
final String contentName =
|
||||
forceCompile ? CompilerBundle.message("compiler.content.name.compile") : CompilerBundle.message("compiler.content.name.make");
|
||||
final CompilerTask compileTask = new CompilerTask(myProject, contentName, ApplicationManager.getApplication().isUnitTestMode());
|
||||
final CompilerTask compileTask = new CompilerTask(myProject, contentName, ApplicationManager.getApplication().isUnitTestMode(), true);
|
||||
|
||||
StatusBar.Info.set("", myProject, "Compiler");
|
||||
if (useExtProcessBuild && BuildManager.getInstance().rescanRequired(myProject)) {
|
||||
@@ -2168,7 +2168,7 @@ public class CompileDriver {
|
||||
|
||||
public void executeCompileTask(final CompileTask task, final CompileScope scope, final String contentName, final Runnable onTaskFinished) {
|
||||
final CompilerTask progressManagerTask =
|
||||
new CompilerTask(myProject, contentName, false);
|
||||
new CompilerTask(myProject, contentName, false, false);
|
||||
final CompileContextImpl compileContext = new CompileContextImpl(myProject, progressManagerTask, scope, null, false, false);
|
||||
|
||||
FileDocumentManager.getInstance().saveAllDocuments();
|
||||
|
||||
@@ -79,6 +79,7 @@ public class CompilerTask extends Task.Backgroundable {
|
||||
private final Object myMessageViewLock = new Object();
|
||||
private final String myContentName;
|
||||
private final boolean myHeadlessMode;
|
||||
private final boolean myForceAsyncExecution;
|
||||
private int myErrorCount = 0;
|
||||
private int myWarningCount = 0;
|
||||
private boolean myMessagesAutoActivated = false;
|
||||
@@ -88,10 +89,11 @@ public class CompilerTask extends Task.Backgroundable {
|
||||
private final AtomicBoolean myMessageViewWasPrepared = new AtomicBoolean(false);
|
||||
private Runnable myRestartWork;
|
||||
|
||||
public CompilerTask(@NotNull Project project, String contentName, final boolean headlessMode) {
|
||||
public CompilerTask(@NotNull Project project, String contentName, final boolean headlessMode, boolean forceAsync) {
|
||||
super(project, contentName);
|
||||
myContentName = contentName;
|
||||
myHeadlessMode = headlessMode;
|
||||
myForceAsyncExecution = forceAsync;
|
||||
}
|
||||
|
||||
public void setContentIdKey(Key<Key<?>> contentIdKey) {
|
||||
@@ -465,7 +467,7 @@ public class CompilerTask extends Task.Backgroundable {
|
||||
}
|
||||
|
||||
public boolean isHeadless() {
|
||||
return myHeadlessMode;
|
||||
return myHeadlessMode && !myForceAsyncExecution;
|
||||
}
|
||||
|
||||
private boolean isHeadlessMode() {
|
||||
|
||||
Reference in New Issue
Block a user