From 06ca23787e69488bef02ffaf88682237061c3fa8 Mon Sep 17 00:00:00 2001 From: nik Date: Wed, 6 May 2015 13:50:14 +0200 Subject: [PATCH] external build: show message if build process is waiting for debugger connection --- .../src/com/intellij/compiler/server/BuildManager.java | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 64204a6409db..a86ee4467a3c 100644 --- a/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java +++ b/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java @@ -130,6 +130,7 @@ import static org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage */ public class BuildManager implements ApplicationComponent{ public static final Key ALLOW_AUTOMAKE = Key.create("_allow_automake_when_process_is_active_"); + private static final Key COMPILER_PROCESS_DEBUG_PORT = Key.create("_compiler_process_debug_port_"); private static final Key FORCE_MODEL_LOADING_PARAMETER = Key.create(BuildParametersKeys.FORCE_MODEL_LOADING); private static final Key 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; }