1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-06 08:35:26 +02:00

Bug 412919: Progress monitor shows previous build command rather than the one which is running

This commit is contained in:
Andrew Gvozdev 2013-07-14 10:17:39 -04:00
parent d0cafe4cfb
commit fc77bb25a2

View file

@ -227,14 +227,14 @@ public class BuildRunnerHelper implements Closeable {
if (workingDirectoryURI != null) {
pathFromURI = EFSExtensionManager.getDefault().getPathFromURI(workingDirectoryURI);
}
if(pathFromURI == null) {
if (pathFromURI == null) {
// fallback to CWD
pathFromURI = System.getProperty("user.dir"); //$NON-NLS-1$
}
IPath workingDirectory = new Path(pathFromURI);
String errMsg = null;
monitor.subTask(CCorePlugin.getFormattedString("BuildRunnerHelper.invokingCommand", launcher.getCommandLine())); //$NON-NLS-1$
monitor.subTask(CCorePlugin.getFormattedString("BuildRunnerHelper.invokingCommand", guessCommandLine(buildCommand.toString(), args))); //$NON-NLS-1$
Process p = launcher.execute(buildCommand, args, envp, workingDirectory, monitor);
monitor.worked(TICKS_EXECUTE_PROGRAM);
if (p != null) {
@ -453,6 +453,19 @@ public class BuildRunnerHelper implements Closeable {
errorParserManager.processLine(msg);
}
/**
* Compose command line that presumably will be run by launcher.
*/
private static String guessCommandLine(String command, String[] args) {
StringBuffer buf = new StringBuffer(command + ' ');
if (args != null) {
for (String arg : args) {
buf.append(arg);
buf.append(' ');
}
}
return buf.toString().trim();
}
/**
* Print a message to the console info output. Note that this message is colored
* with the color assigned to "Info" stream.