Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Managed Projects and Builder

> Another query, i have created my own builder and registered it. When the
> project is created  along with my builder the default CDT builder also gets
> added in the project configuration, how do i remove the default CDT builder
> from the configuraton.

We have solved this by adding our own builder after the C project
creation, and in that process kicking out the standard managed
builder, something like:

	IProjectDescription description = project.getDescription();
	ICommand[] commands = description.getBuildSpec();
	String CDTBuilderID = ManagedCProjectNature.getBuilderID();

	for (int i = 0; i < commands.length; i++) 
	{
		if ( commands[i].getBuilderName().equals(CDTBuilderID))
		{
			// Replace the command
			description.setBuildSpec( (ICommand[])ArrayUtil.removeArrayElement(commands,i) );
			break;
		}
	}

Not the nicest solution, and if more implementers are using their own
builder it might perhaps be worth to have a special 'builder' attribute 
in the toolchain or projectType element specifying an alternative builder.

Regards,
  Wieant


Back to the top