eclipse plugin: use separate output streams for stdout & stderr

This commit is contained in:
Timotei Dolean 2010-07-22 17:35:06 +00:00
parent a40747f5e0
commit 81cf422afa
2 changed files with 11 additions and 11 deletions

View file

@ -15,6 +15,7 @@ import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.ui.console.MessageConsole;
import wesnoth_eclipse_plugin.Constants;
import wesnoth_eclipse_plugin.Logger;
@ -129,10 +130,10 @@ public class GameUtils
// we need to add the working dir (backward compatibility)
args.add(workingDir);
OutputStream[] stream = new OutputStream[] {
GUIUtils.createConsole("Wesnoth game:", null, true).newMessageStream()
};
ExternalToolInvoker.launchTool(wesnothExec, args, stream, stream);
MessageConsole console = GUIUtils.createConsole("Wesnoth game:", null, true);
ExternalToolInvoker.launchTool(wesnothExec, args,
new OutputStream[] { console.newMessageStream() },
new OutputStream[] { console.newMessageStream() });
}
/**

View file

@ -192,9 +192,8 @@ public class WMLTools
try{
monitor.beginTask(toolName, 1050);
MessageConsole console = GUIUtils.createConsole(toolName + " result:", null, true);
OutputStream messageStream = console.newMessageStream();
//TODO: multiple streams? - check performance
OutputStream[] stream = new OutputStream[]{ messageStream};
OutputStream[] stdout = new OutputStream[]{ console.newMessageStream() };
OutputStream[] stderr = new OutputStream[]{ console.newMessageStream() };
String location;
String stdin = EditorUtils.getEditorDocument().get();
@ -215,16 +214,16 @@ public class WMLTools
case WMLINDENT:
if (selFile != null && targetPath == null)
toolInvoker = WMLTools.runWMLIndent(null, stdin, false,
null, stream);
null, stdout);
else
toolInvoker = WMLTools.runWMLIndent(location, null, false,
stream, stream);
stdout, stderr);
break;
case WMLLINT:
toolInvoker = WMLTools.runWMLLint(location, true, stream, stream);
toolInvoker = WMLTools.runWMLLint(location, true, stdout, stderr);
break;
case WMLSCOPE:
toolInvoker = WMLTools.runWMLScope(location, stream, stream);
toolInvoker = WMLTools.runWMLScope(location, stdout, stderr);
break;
}
monitor.worked(50);