From a07df9bedfbda16ad2179a3cac65ecfce0efd19a Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Mon, 16 Jul 2012 13:28:58 +0200 Subject: [PATCH] schedule auto-make on 'project opened' event --- .../intellij/compiler/impl/CompileDriver.java | 4 +- .../compiler/server/BuildManager.java | 47 +++++++++---------- .../CompilerWorkspaceConfiguration.java | 3 -- 3 files changed, 25 insertions(+), 29 deletions(-) diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java b/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java index c89bbe7838e6..177cebc7bfa1 100644 --- a/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java @@ -589,7 +589,7 @@ public class CompileDriver { } final long start = System.currentTimeMillis(); try { - LOG.info("COMPILATION STARTED " + (CompilerWorkspaceConfiguration.useServerlessOutOfProcessBuild() ? "(BUILD PROCESS)" : "(COMPILE SERVER)")); + LOG.info("COMPILATION STARTED (BUILD PROCESS)"); if (message != null) { compileContext.addMessage(message); } @@ -615,7 +615,7 @@ public class CompileDriver { finally { final long finish = System.currentTimeMillis(); CompilerUtil.logDuration( - "\tCOMPILATION FINISHED " + (CompilerWorkspaceConfiguration.useServerlessOutOfProcessBuild() ? "(BUILD PROCESS)" : "(COMPILE SERVER)") + "; Errors: " + + "\tCOMPILATION FINISHED (BUILD PROCESS); Errors: " + compileContext.getMessageCount(CompilerMessageCategory.ERROR) + "; warnings: " + compileContext.getMessageCount(CompilerMessageCategory.WARNING), diff --git a/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java b/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java index 7803f3195ff4..10fe0921f45e 100644 --- a/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java +++ b/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java @@ -259,34 +259,32 @@ public class BuildManager implements ApplicationComponent{ if (IS_UNIT_TEST_MODE || PowerSaveMode.isEnabled()) { return; } - if (CompilerWorkspaceConfiguration.useServerlessOutOfProcessBuild()) { - addMakeRequest(new Runnable() { - @Override - public void run() { - if (!myAutoMakeInProgress.getAndSet(true)) { - try { - ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { - @Override - public void run() { - try { - runAutoMake(); - } - finally { - myAutoMakeInProgress.set(false); - } + addMakeRequest(new Runnable() { + @Override + public void run() { + if (!myAutoMakeInProgress.getAndSet(true)) { + try { + ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { + @Override + public void run() { + try { + runAutoMake(); } - }); - } - catch (RejectedExecutionException ignored) { - // we were shut down - } + finally { + myAutoMakeInProgress.set(false); + } + } + }); } - else { - addMakeRequest(this); + catch (RejectedExecutionException ignored) { + // we were shut down } } - }); - } + else { + addMakeRequest(this); + } + } + }); } private void addMakeRequest(Runnable runnable) { @@ -948,6 +946,7 @@ public class BuildManager implements ApplicationComponent{ scheduleAutoMake(); } }); + scheduleAutoMake(); // run automake on project opening } @Override diff --git a/java/compiler/openapi/src/com/intellij/compiler/CompilerWorkspaceConfiguration.java b/java/compiler/openapi/src/com/intellij/compiler/CompilerWorkspaceConfiguration.java index 97e7dff8db72..eb20465b3d28 100644 --- a/java/compiler/openapi/src/com/intellij/compiler/CompilerWorkspaceConfiguration.java +++ b/java/compiler/openapi/src/com/intellij/compiler/CompilerWorkspaceConfiguration.java @@ -54,9 +54,6 @@ public class CompilerWorkspaceConfiguration implements PersistentStateComponent< return USE_COMPILE_SERVER; } - public static boolean useServerlessOutOfProcessBuild() { - return true/*!Registry.is("compiler.out-of-process.as-server")*/; - } public boolean allowAutoMakeWhileRunningApplication() { return false;/*ALLOW_AUTOMAKE_WHILE_RUNNING_APPLICATION*/ }