1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 08:55:25 +02:00

Bug 580113: Do not reuse ICommandLauncher

Each command should have it's own command launcher. The alternative is
to ensure that the previous command has finished prior to launching the
next one, but that's harder to acchieve as it's up to the consumer of
Builder to fullfill.

Contributed by STMicroelectronics

Change-Id: I17038220ccd7c1767328ecfce92f28d8205c1d56
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
This commit is contained in:
Torbjörn Svensson 2022-06-03 07:31:22 +02:00 committed by Torbjorn-Svensson
parent 4a1e0f467b
commit 054e494e10

View file

@ -146,7 +146,6 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
private ICOutputEntry[] outputEntries;
private ICommandLauncher fCommandLauncher = null;
private IConfigurationElement fCommandLauncherElement = null;
private AbstractBuildRunner fBuildRunner = null;
@ -336,7 +335,6 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
super.copyChildren(builder);
fCommandLauncher = builder.fCommandLauncher;
fCommandLauncherElement = builder.fCommandLauncherElement;
fBuildRunner = builder.fBuildRunner;
@ -2843,25 +2841,18 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public ICommandLauncher getCommandLauncher() {
if (fCommandLauncher != null)
return fCommandLauncher;
if (fCommandLauncher == null && fCommandLauncherElement != null) {
if (fCommandLauncherElement != null) {
try {
fCommandLauncher = (ICommandLauncher) fCommandLauncherElement
.createExecutableExtension(ATTRIBUTE_COMMAND_LAUNCHER);
return fCommandLauncher;
return (ICommandLauncher) fCommandLauncherElement.createExecutableExtension(ATTRIBUTE_COMMAND_LAUNCHER);
} catch (CoreException e) {
e.printStackTrace();
}
}
if (fCommandLauncher == null && superClass != null)
if (superClass != null)
return getSuperClass().getCommandLauncher();
else if (fCommandLauncher == null) // catch all for backwards compatibility
fCommandLauncher = CommandLauncherManager.getInstance().getCommandLauncher();
return fCommandLauncher;
// catch all for backwards compatibility
return CommandLauncherManager.getInstance().getCommandLauncher();
}
@Override