jps server to support sources timestamp tracking

This commit is contained in:
Eugene Zhuravlev
2011-10-08 17:32:24 +02:00
parent 50e9e43ee0
commit 19f1d99c89
8 changed files with 25 additions and 4 deletions
@@ -51,7 +51,8 @@ public class Bootstrap {
name.startsWith("gant")||
name.startsWith("groovy") ||
name.startsWith("javac2") ||
name.startsWith("util")
name.startsWith("util") ||
name.startsWith("trove")
);
if (shouldAdd) {
cp.add(file);
@@ -9,6 +9,8 @@ import org.jetbrains.jps.server.*;
import org.jetbrains.jpsservice.JpsRemoteProto;
import org.jetbrains.jpsservice.Server;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
@@ -180,9 +182,26 @@ public class JpsServerMessageHandler extends SimpleChannelHandler {
error = e;
}
finally {
final JpsRemoteProto.Message lastMessage = error != null?
ProtoUtil.toMessage(mySessionId, ProtoUtil.createFailure("build failed: ", error)) :
ProtoUtil.toMessage(mySessionId, ProtoUtil.createBuildCompletedEvent("build completed"));
final JpsRemoteProto.Message lastMessage;
if (error != null) {
Throwable cause = error.getCause();
if (cause == null) {
cause = error;
}
final ByteArrayOutputStream out = new ByteArrayOutputStream();
cause.printStackTrace(new PrintStream(out));
final StringBuilder messageText = new StringBuilder();
messageText.append("JPS Internal error: (").append(cause.getClass().getName()).append(") ").append(cause.getMessage());
final String trace = out.toString();
if (!trace.isEmpty()) {
messageText.append("\n").append(trace);
}
lastMessage = ProtoUtil.toMessage(mySessionId, ProtoUtil.createFailure(messageText.toString(), cause));
}
else {
lastMessage = ProtoUtil.toMessage(mySessionId, ProtoUtil.createBuildCompletedEvent("build completed"));
}
Channels.write(myChannelContext.getChannel(), lastMessage).addListener(new ChannelFutureListener() {
public void operationComplete(ChannelFuture future) throws Exception {
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
View File
@@ -9,3 +9,4 @@ jps-incremental/jps-gwt.jar
jps-incremental/jps-javaee.jar
jps-incremental/jps-jpa.jar
jps-incremental/util.jar
jps-incremental/trove4j.jar