mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
schedule auto-make on 'project opened' event
This commit is contained in:
@@ -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*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user