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

Fix step builder make invocation that isn't using Container

- change CommandBuilder to accept a project as an argument
  to its constructor and to pass this as an argument to
  the CommandLauncherFactoryManager
- have StepBuilder pass project when creating a CommandBuilder

Change-Id: I54073b791fb48a7fd62ce98a93dcfbdcd6d76d2b
This commit is contained in:
Jeff Johnston 2017-04-13 19:22:06 -04:00
parent e70713966f
commit 150fda824d
2 changed files with 11 additions and 3 deletions

View file

@ -23,6 +23,7 @@ import org.eclipse.cdt.core.ICommandLauncher;
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildCommand;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedMakeMessages;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@ -47,6 +48,8 @@ public class CommandBuilder implements IBuildModelBuilder {
private Process fProcess;
private String fErrMsg;
private IProject fProject;
protected class OutputStreamWrapper extends OutputStream {
private OutputStream fOut;
@ -80,8 +83,9 @@ public class CommandBuilder implements IBuildModelBuilder {
}
public CommandBuilder(IBuildCommand cmd, IResourceRebuildStateContainer cr){
public CommandBuilder(IBuildCommand cmd, IResourceRebuildStateContainer cr, IProject project){
fCmd = cmd;
fProject = project;
}
protected OutputStream wrap(OutputStream out){
@ -143,7 +147,7 @@ public class CommandBuilder implements IBuildModelBuilder {
}
protected ICommandLauncher createLauncher() {
return CommandLauncherFactoryManager.getInstance().getCommandLauncher();
return CommandLauncherFactoryManager.getInstance().getCommandLauncher(fProject);
}
public String getErrMsg() {

View file

@ -17,7 +17,9 @@ import org.eclipse.cdt.managedbuilder.buildmodel.IBuildCommand;
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildDescription;
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildResource;
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildStep;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
@ -223,8 +225,10 @@ public class StepBuilder implements IBuildModelBuilder {
fCommandBuilders = new CommandBuilder[0];
else {
fCommandBuilders = new CommandBuilder[cmds.length];
IConfiguration cfg = fStep.getBuildDescription().getConfiguration();
IProject project = (IProject)cfg.getOwner();
for(int i = 0; i < cmds.length; i++){
fCommandBuilders[i] = new CommandBuilder(cmds[i], fRebuildStateContainer);
fCommandBuilders[i] = new CommandBuilder(cmds[i], fRebuildStateContainer, project);
}
}
}