schedule auto-make on 'project opened' event

This commit is contained in:
Eugene Zhuravlev
2012-07-16 13:35:41 +02:00
parent d878c89611
commit a07df9bedf
3 changed files with 25 additions and 29 deletions
@@ -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),
@@ -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
@@ -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*/
}