1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 06:32:10 +02:00

Bug 461628 Some tools within a toolchain can potentially generate an

output resource with the same name even if the input resource name to
the tool is not the same. This fix is to provide this capability to CDT


Change-Id: I9ad9d2ff0cc39797718f8b689c7a828e81f49648
Signed-off-by: Guy Bonneau <guy.bonneau@videotron.ca>

Bug 461628 Some tools within a toolchain can potentially generate an
output resource with the same name even if the input resource name to
the tool is not the same. This fix is to provide this capability to CDT"

Change-Id: I9ad9d2ff0cc39797718f8b689c7a828e81f49648
Signed-off-by: Guy Bonneau <guy.bonneau@videotron.ca>
This commit is contained in:
Guy Bonneau 2015-03-07 09:23:42 -05:00 committed by Elena Laskavaia
parent 65bac9ae34
commit f3781679fa

View file

@ -21,6 +21,7 @@ import org.eclipse.cdt.managedbuilder.buildmodel.IBuildDescription;
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildIOType;
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildResource;
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildStep;
import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
@ -143,6 +144,15 @@ public class BuildResource implements IBuildResource {
inStep.removeResource(fProducerArg, this, true);
fProducerArg = arg;
} else {
// Bug 461628
// Check if this resource is an output produced by a Tool that support merging in which case
// a producer can already be defined by a previous step. This is supported.
IBuildStep step = fProducerArg.getStep();
ITool tool = step instanceof BuildStep ? ((BuildStep)(step)).getTool() : null;
if(tool != null && !arg.isInput()) {
return;
}
String err = "ProducerArgument not null!!!\n"; //$NON-NLS-1$
String rcName = DbgUtil.resourceName(this);
@ -155,8 +165,6 @@ public class BuildResource implements IBuildResource {
if(DbgUtil.DEBUG){
err = err + externalizedErr + "curent producer: " + DbgUtil.dumpStep(fProducerArg.getStep()) + "\n producer attempt: " + DbgUtil.dumpStep(arg.getStep()); //$NON-NLS-1$ //$NON-NLS-2$
}
throw new IllegalArgumentException(externalizedErr);
}
}