external build: show message if build process is waiting for debugger connection

This commit is contained in:
nik
2015-05-06 13:52:23 +02:00
parent 8d638087bf
commit 06ca23787e
@@ -130,6 +130,7 @@ import static org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage
*/
public class BuildManager implements ApplicationComponent{
public static final Key<Boolean> ALLOW_AUTOMAKE = Key.create("_allow_automake_when_process_is_active_");
private static final Key<Integer> COMPILER_PROCESS_DEBUG_PORT = Key.create("_compiler_process_debug_port_");
private static final Key<String> FORCE_MODEL_LOADING_PARAMETER = Key.create(BuildParametersKeys.FORCE_MODEL_LOADING);
private static final Key<CharSequence> STDERR_OUTPUT = Key.create("_process_launch_errors_");
private static final SimpleDateFormat USAGE_STAMP_DATE_FORMAT = new SimpleDateFormat("dd.MM.yyyy");
@@ -780,6 +781,12 @@ public class BuildManager implements ApplicationComponent{
processHandler.startNotify();
}
Integer debugPort = processHandler.getUserData(COMPILER_PROCESS_DEBUG_PORT);
if (debugPort != null) {
String message = "Make: waiting for debugger connection on port " + debugPort;
messageHandler.handleCompileMessage(sessionId, CmdlineProtoUtil.createCompileProgressMessageResponse(message).getCompileMessage());
}
while (!processHandler.waitFor()) {
LOG.info("processHandler.waitFor() returned false for session " + sessionId + ", continue waiting");
}
@@ -1182,6 +1189,9 @@ public class BuildManager implements ApplicationComponent{
}
}
});
if (debugPort > 0) {
processHandler.putUserData(COMPILER_PROCESS_DEBUG_PORT, debugPort);
}
return processHandler;
}