mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-25 18:05:33 +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:
parent
e70713966f
commit
150fda824d
2 changed files with 11 additions and 3 deletions
|
@ -23,6 +23,7 @@ import org.eclipse.cdt.core.ICommandLauncher;
|
||||||
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildCommand;
|
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildCommand;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
|
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedMakeMessages;
|
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.CoreException;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
|
@ -47,6 +48,8 @@ public class CommandBuilder implements IBuildModelBuilder {
|
||||||
private Process fProcess;
|
private Process fProcess;
|
||||||
private String fErrMsg;
|
private String fErrMsg;
|
||||||
|
|
||||||
|
private IProject fProject;
|
||||||
|
|
||||||
protected class OutputStreamWrapper extends OutputStream {
|
protected class OutputStreamWrapper extends OutputStream {
|
||||||
private OutputStream fOut;
|
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;
|
fCmd = cmd;
|
||||||
|
fProject = project;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected OutputStream wrap(OutputStream out){
|
protected OutputStream wrap(OutputStream out){
|
||||||
|
@ -143,7 +147,7 @@ public class CommandBuilder implements IBuildModelBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ICommandLauncher createLauncher() {
|
protected ICommandLauncher createLauncher() {
|
||||||
return CommandLauncherFactoryManager.getInstance().getCommandLauncher();
|
return CommandLauncherFactoryManager.getInstance().getCommandLauncher(fProject);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getErrMsg() {
|
public String getErrMsg() {
|
||||||
|
|
|
@ -17,7 +17,9 @@ import org.eclipse.cdt.managedbuilder.buildmodel.IBuildCommand;
|
||||||
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildDescription;
|
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildDescription;
|
||||||
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildResource;
|
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildResource;
|
||||||
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildStep;
|
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.IFile;
|
||||||
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.resources.IWorkspaceRoot;
|
import org.eclipse.core.resources.IWorkspaceRoot;
|
||||||
import org.eclipse.core.resources.ResourcesPlugin;
|
import org.eclipse.core.resources.ResourcesPlugin;
|
||||||
|
@ -223,8 +225,10 @@ public class StepBuilder implements IBuildModelBuilder {
|
||||||
fCommandBuilders = new CommandBuilder[0];
|
fCommandBuilders = new CommandBuilder[0];
|
||||||
else {
|
else {
|
||||||
fCommandBuilders = new CommandBuilder[cmds.length];
|
fCommandBuilders = new CommandBuilder[cmds.length];
|
||||||
|
IConfiguration cfg = fStep.getBuildDescription().getConfiguration();
|
||||||
|
IProject project = (IProject)cfg.getOwner();
|
||||||
for(int i = 0; i < cmds.length; i++){
|
for(int i = 0; i < cmds.length; i++){
|
||||||
fCommandBuilders[i] = new CommandBuilder(cmds[i], fRebuildStateContainer);
|
fCommandBuilders[i] = new CommandBuilder(cmds[i], fRebuildStateContainer, project);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue