Bug 256153 - Need API for disabled project builders
Summary: Need API for disabled project builders
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows Vista
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Ant-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-21 13:12 EST by Anna Karjakina CLA
Modified: 2016-02-09 11:13 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anna Karjakina CLA 2008-11-21 13:12:19 EST
Build ID: I20081030-1917

Steps To Reproduce:
1. Create any project
2. 'Add dynamic nature' with its context menu
3. Open project's Properties
4. Disable 'Dynamic Project Builder' on the Builders page
5. 'Remove dynamic nature' with project's context menu
6. 'Add dynamic nature' once again
7. Open project's Properties on the Builders page
=> See two 'Dynamic Project Builder's now, one is enabled and second is not
<= Builders should not be duplicated, especially taking into account that there is no way to 'Remove' builder with the Builders page UI.



More information:
In many places throughout JDT, CDT, PDE, JET, QVT the same piece of code can be met:
(example is from org.eclipse.ui.tools.builder.DynamicNature.configure()):
		IProjectDescription desc = project.getDescription();
		ICommand[] commands = desc.getBuildSpec();
		for (int i = 0; i < commands.length; ++i) {
			if (commands[i].getBuilderName().equals(paramBuilderId)) {
				return;
			}
		}
		ICommand[] newCommands = new ICommand[commands.length + 1];
		System.arraycopy(commands, 0, newCommands, 0, commands.length);
		ICommand command = desc.newCommand();
	command.setBuilderName(paramBuilderId);
		newCommands[newCommands.length - 1] = command;
		desc.setBuildSpec(newCommands);
		project.setDescription(desc, null);

But since [bug 29677] disabled builders are kept as specially configured external builders with id=org.eclipse.ui.externaltools.ExternalToolBuilder. So all these checks do not see them. However, even if one really wants to handle disabled normal builders, there is no way to import constants from org.eclipse.ui.externaltools plugin due to restriction level in runtime. See org.eclipse.ui.externaltools.internal.model.ExternalToolBuilder.ID and org.eclipse.ui.externaltools.internal.model.BuilderUtils.
Comment 1 Mike Wilson CLA 2009-05-05 12:22:53 EDT
Changing Version tag to something more believable. Note that this is not a statement about when the enhancement request will be addressed (the Target Milestone field is used for that); the Version tag should be set to the version of Eclipse you were using when you saw the need for the enhancement.