mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 03:15:33 +02:00
Add the clean target. Note that I have commented out the rebuild action as it is not working properly
This commit is contained in:
parent
30c4df2fce
commit
b47f2425ce
2 changed files with 25 additions and 10 deletions
|
@ -33,7 +33,8 @@ import org.eclipse.ui.ide.IDEActionFactory;
|
|||
public class BuildGroup extends CViewActionGroup {
|
||||
|
||||
private BuildAction buildAction;
|
||||
private BuildAction rebuildAction;
|
||||
// private BuildAction rebuildAction;
|
||||
private BuildAction cleanAction;
|
||||
|
||||
// Menu tags for the build
|
||||
final String BUILD_GROUP_MARKER = "buildGroup"; //$NON-NLS-1$
|
||||
|
@ -45,7 +46,7 @@ public class BuildGroup extends CViewActionGroup {
|
|||
|
||||
public void fillActionBars(IActionBars actionBars) {
|
||||
actionBars.setGlobalActionHandler(IDEActionFactory.BUILD_PROJECT.getId(), buildAction);
|
||||
actionBars.setGlobalActionHandler(IDEActionFactory.REBUILD_PROJECT.getId(), rebuildAction);
|
||||
// actionBars.setGlobalActionHandler(IDEActionFactory.REBUILD_PROJECT.getId(), rebuildAction);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -99,15 +100,14 @@ public class BuildGroup extends CViewActionGroup {
|
|||
hasBuilder = false;
|
||||
}
|
||||
}
|
||||
// Allow manual incremental build only if auto build is off.
|
||||
//if (!selection.isEmpty() && isProjectSelection
|
||||
// && !ResourcesPlugin.getWorkspace().isAutoBuilding()
|
||||
// && hasBuilder) {
|
||||
|
||||
if (!selection.isEmpty() && isProjectSelection && hasBuilder) {
|
||||
buildAction.selectionChanged(selection);
|
||||
menu.add(buildAction);
|
||||
rebuildAction.selectionChanged(selection);
|
||||
menu.add(rebuildAction);
|
||||
// rebuildAction.selectionChanged(selection);
|
||||
// menu.add(rebuildAction);
|
||||
cleanAction.selectionChanged(selection);
|
||||
menu.add(cleanAction);
|
||||
}
|
||||
menu.add(new GroupMarker(BUILD_GROUP_MARKER_END));
|
||||
}
|
||||
|
@ -137,13 +137,27 @@ public class BuildGroup extends CViewActionGroup {
|
|||
|
||||
protected void makeActions() {
|
||||
Shell shell = getCView().getSite().getShell();
|
||||
|
||||
// when the managed builder can handle a full build we should change this to use FULL BUILD
|
||||
// the incremental build allows the eclipse plaftorm to decide that the CDT builder does not
|
||||
// need to be called. FULL_BUILD will always call our builders and WE can decide what to do.
|
||||
buildAction = new BuildAction(shell, IncrementalProjectBuilder.INCREMENTAL_BUILD);
|
||||
rebuildAction = new BuildAction(shell, IncrementalProjectBuilder.FULL_BUILD);
|
||||
// buildAction = new BuildAction(shell, IncrementalProjectBuilder.FULL_BUILD);
|
||||
buildAction.setText(CViewMessages.getString("BuildAction.label")); //$NON-NLS-1$
|
||||
|
||||
cleanAction = new BuildAction(shell, IncrementalProjectBuilder.CLEAN_BUILD);
|
||||
cleanAction.setText(CViewMessages.getString("CleanAction.label")); //$NON-NLS-1$
|
||||
|
||||
// I need to figure out how to override the action on the rebuild. Currently this is all implemented
|
||||
// as the default action. I would like to do both CLEAN_BUILD followed by INCREMENTAL_BUILD
|
||||
// oddly enough if it is not INCREMENTAL_BUILD the strings are maped to "rebuild" in the contructor of BuildAction
|
||||
// rebuildAction = new BuildAction(shell, IncrementalProjectBuilder.FULL_BUILD);
|
||||
// rebuildAction.setText(CViewMessages.getString("RebuildAction.label")); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public void updateActionBars() {
|
||||
IStructuredSelection selection = (IStructuredSelection) getContext().getSelection();
|
||||
buildAction.selectionChanged(selection);
|
||||
rebuildAction.selectionChanged(selection);
|
||||
// rebuildAction.selectionChanged(selection);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ OpenWithMenu.label=Open Wit&h
|
|||
|
||||
BuildAction.label=&Build Project
|
||||
RebuildAction.label=Rebuild Pro&ject
|
||||
CleanAction.label=Clean Project
|
||||
|
||||
CollapseAllAction.label=Collapse All
|
||||
CollapseAllAction.tooltip=Collapse All
|
||||
|
|
Loading…
Add table
Reference in a new issue