Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Why Build All Configurations doesn't work for different builders from CDT Common Builder?

Hi,
 
I have my own project builder and I extend CDT and add new project types and configurations.
When I select Build from Project menu, my builder works and project's active configuration is built.
But when i want to built a different configuration or all configurations from the context menu (Build Configurations->All), only the active configuration is built.
 
In the ManagedBuildManager class buildConfigurations method:
Build arguments are created for the selected configurations (
final Map map = builder != null ?
BuilderFactory.createBuildArgs(configs, builder)
: BuilderFactory.createBuildArgs(configs);
)
 
But then these arguments are passed to the build function only if the builder is CommonBuilder. So, when Build Configurations->All selected from the context menu for a project that has a different builder, only the active configuration of the project is built.
 
I need these build arguments for my builder, why builders other than CommonBuilder are not called with these args?
 
Regards
 
Aytac
 
private static void buildConfigurations(final IProject project, IConfiguration[] configs, IBuilder builder, final IProgressMonitor monitor) throws CoreException{
// final IProject project = configs[0].getOwner().getProject();
final boolean runAllBuidlers = false;
final Map map = builder != null ?
BuilderFactory.createBuildArgs(configs, builder)
: BuilderFactory.createBuildArgs(configs);
IWorkspaceRunnable op = new IWorkspaceRunnable() {
/*
* (non-Javadoc)
*
* @see org.eclipse.core.resources.IWorkspaceRunnable#run(org.eclipse.core.runtime.IProgressMonitor)
*/
public void run(IProgressMonitor monitor) throws CoreException {
if (runAllBuidlers) {
ICommand[] commands = project.getDescription().getBuildSpec();
monitor.beginTask("", commands.length); //$NON-NLS-1$
for (int i = 0; i < commands.length; i++) {
if (commands[i].getBuilderName().equals(CommonBuilder.BUILDER_ID)) {
project.build(IncrementalProjectBuilder.FULL_BUILD, CommonBuilder.BUILDER_ID, map, new SubProgressMonitor(monitor, 1));
} else {
project.build(IncrementalProjectBuilder.FULL_BUILD, commands[i].getBuilderName(),
commands[i].getArguments(), new SubProgressMonitor(monitor, 1));
}
}
monitor.done();
} else {
project.build(IncrementalProjectBuilder.FULL_BUILD, CommonBuilder.BUILDER_ID, map, monitor);
}
}


Back to the top