1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-19 15:05:36 +02:00

Defect 62772. Suppressed the make clean from happening on rebuild events. Works correctly for the standard build, but the managed build still programatically cleans the project. In the long run all builds should call "make all" and the explicit clean event should call "make clean". The managed makefiles will need to be enhanced so that they can never get "out-of-sync" with the source.

This commit is contained in:
David Daoust 2006-02-14 17:54:02 +00:00
parent 98c1263138
commit bfec40f011
9 changed files with 14 additions and 49 deletions

View file

@ -14,8 +14,7 @@ import org.eclipse.core.runtime.CoreException;
public interface IMakeBuilderInfo extends IMakeCommonBuildInfo { public interface IMakeBuilderInfo extends IMakeCommonBuildInfo {
public final static String BUILD_TARGET_FULL = ARGS_PREFIX + ".build.target.full"; //$NON-NLS-1$ public final static String BUILD_TARGET_INCREMENTAL = ARGS_PREFIX + ".build.target.inc"; //$NON-NLS-1$
public final static String BUILD_TARGET_INCREAMENTAL = ARGS_PREFIX + ".build.target.inc"; //$NON-NLS-1$
public final static String BUILD_TARGET_AUTO = ARGS_PREFIX + ".build.target.auto"; //$NON-NLS-1$ public final static String BUILD_TARGET_AUTO = ARGS_PREFIX + ".build.target.auto"; //$NON-NLS-1$
public final static String BUILD_TARGET_CLEAN = ARGS_PREFIX + ".build.target.clean"; //$NON-NLS-1$ public final static String BUILD_TARGET_CLEAN = ARGS_PREFIX + ".build.target.clean"; //$NON-NLS-1$

View file

@ -140,10 +140,9 @@ public class MakeProjectNature implements IProjectNature {
projectInfo.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_AUTO, info.getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_AUTO, "")); //$NON-NLS-1$ projectInfo.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_AUTO, info.getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_AUTO, "")); //$NON-NLS-1$
projectInfo.setIncrementalBuildEnable(info.isIncrementalBuildEnabled()); projectInfo.setIncrementalBuildEnable(info.isIncrementalBuildEnabled());
projectInfo.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREAMENTAL, info.getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREAMENTAL, "")); //$NON-NLS-1$ projectInfo.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREMENTAL, info.getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREMENTAL, "")); //$NON-NLS-1$
projectInfo.setFullBuildEnable(info.isFullBuildEnabled()); projectInfo.setFullBuildEnable(info.isIncrementalBuildEnabled());
projectInfo.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_FULL, info.getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_FULL, "")); //$NON-NLS-1$
projectInfo.setCleanBuildEnable(info.isCleanBuildEnabled()); projectInfo.setCleanBuildEnable(info.isCleanBuildEnabled());
projectInfo.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_CLEAN, info.getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_CLEAN, "")); //$NON-NLS-1$ projectInfo.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_CLEAN, info.getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_CLEAN, "")); //$NON-NLS-1$

View file

@ -88,9 +88,7 @@ public class BuildInfoFactory {
value = getString(BuildInfoFactory.BUILD_TARGET_AUTO); value = getString(BuildInfoFactory.BUILD_TARGET_AUTO);
} else if (IMakeBuilderInfo.BUILD_TARGET_CLEAN.equals(name)) { } else if (IMakeBuilderInfo.BUILD_TARGET_CLEAN.equals(name)) {
value = getString(BuildInfoFactory.BUILD_TARGET_CLEAN); value = getString(BuildInfoFactory.BUILD_TARGET_CLEAN);
} else if (IMakeBuilderInfo.BUILD_TARGET_FULL.equals(name)) { } else if (IMakeBuilderInfo.BUILD_TARGET_INCREMENTAL.equals(name)) {
value = getString(BuildInfoFactory.BUILD_TARGET_FULL);
} else if (IMakeBuilderInfo.BUILD_TARGET_INCREAMENTAL.equals(name)) {
value = getString(BuildInfoFactory.BUILD_TARGET_INCREMENTAL); value = getString(BuildInfoFactory.BUILD_TARGET_INCREMENTAL);
} }
} }
@ -222,12 +220,12 @@ public class BuildInfoFactory {
} }
public void setIncrementalBuildTarget(String target) throws CoreException { public void setIncrementalBuildTarget(String target) throws CoreException {
putString(IMakeBuilderInfo.BUILD_TARGET_INCREAMENTAL, null); putString(IMakeBuilderInfo.BUILD_TARGET_INCREMENTAL, null);
putString(BuildInfoFactory.BUILD_TARGET_INCREMENTAL, target); putString(BuildInfoFactory.BUILD_TARGET_INCREMENTAL, target);
} }
public String getIncrementalBuildTarget() { public String getIncrementalBuildTarget() {
String result = getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREAMENTAL, String result = getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREMENTAL,
getString(BuildInfoFactory.BUILD_TARGET_INCREMENTAL)); getString(BuildInfoFactory.BUILD_TARGET_INCREMENTAL));
try { try {
result = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(result, false); result = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(result, false);
@ -237,12 +235,11 @@ public class BuildInfoFactory {
} }
public void setFullBuildTarget(String target) throws CoreException { public void setFullBuildTarget(String target) throws CoreException {
putString(IMakeBuilderInfo.BUILD_TARGET_FULL, null);
putString(BuildInfoFactory.BUILD_TARGET_FULL, target);
} }
public String getFullBuildTarget() { public String getFullBuildTarget() {
String result = getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_FULL, getString(BuildInfoFactory.BUILD_TARGET_FULL)); String result = getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREMENTAL, getString(BuildInfoFactory.BUILD_TARGET_INCREMENTAL));
try { try {
result = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(result, false); result = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(result, false);
} catch (CoreException e) { } catch (CoreException e) {

View file

@ -288,7 +288,6 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
info.setUseDefaultBuildCmd(isDefaultBuildCmd()); info.setUseDefaultBuildCmd(isDefaultBuildCmd());
info.setStopOnError(isStopOnError()); info.setStopOnError(isStopOnError());
info.setFullBuildEnable(true); info.setFullBuildEnable(true);
info.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_FULL, getBuildAttribute(IMakeTarget.BUILD_TARGET, "")); //$NON-NLS-1$
info.setEnvironment(getExpandedEnvironment()); info.setEnvironment(getExpandedEnvironment());
info.setAppendEnvironment(appendEnvironment()); info.setAppendEnvironment(appendEnvironment());
if (container != null) { if (container != null) {

View file

@ -39,9 +39,8 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
info.setAutoBuildEnable(false); info.setAutoBuildEnable(false);
info.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_AUTO, "all"); //$NON-NLS-1$ info.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_AUTO, "all"); //$NON-NLS-1$
info.setIncrementalBuildEnable(true); info.setIncrementalBuildEnable(true);
info.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREAMENTAL, "all"); //$NON-NLS-1$ info.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREMENTAL, "all"); //$NON-NLS-1$
info.setFullBuildEnable(true); info.setFullBuildEnable(true);
info.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_FULL, "clean all"); //$NON-NLS-1$
info.setCleanBuildEnable(true); info.setCleanBuildEnable(true);
info.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_CLEAN, "clean"); //$NON-NLS-1$ info.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_CLEAN, "clean"); //$NON-NLS-1$
info.setAppendEnvironment(true); info.setAppendEnvironment(true);

View file

@ -75,11 +75,9 @@ SettingsBlock.makeWorkbench.auto=Build on resource save (Auto Build)
SettingsBlock.makeWorkbench.note=Note: SettingsBlock.makeWorkbench.note=Note:
SettingsBlock.makeWorkbench.autobuildMessage=See Workbench automatic build preference. SettingsBlock.makeWorkbench.autobuildMessage=See Workbench automatic build preference.
SettingsBlock.makeWorkbench.incremental=Build (Incremental Build) SettingsBlock.makeWorkbench.incremental=Build (Incremental Build)
SettingsBlock.makeWorkbench.full=Rebuild (Full Build)
SettingsBlock.makeWorkbench.clean=Clean SettingsBlock.makeWorkbench.clean=Clean
SettingsBlock.makeWorkbench.autoBuildTarget=Auto Build Target SettingsBlock.makeWorkbench.autoBuildTarget=Auto Build Target
SettingsBlock.makeWorkbench.incrementalBuildTarget=Incremental Build Target SettingsBlock.makeWorkbench.incrementalBuildTarget=Incremental Build Target
SettingsBlock.makeWorkbench.fullBuildTarget=Full Build Target
SettingsBlock.makeWorkbench.cleanTarget=Clean Target SettingsBlock.makeWorkbench.cleanTarget=Clean Target
SettingsBlock.variables=Variables... SettingsBlock.variables=Variables...
TargetBlock.target.group_label=Target TargetBlock.target.group_label=Target

View file

@ -88,17 +88,14 @@ public class SettingsBlock extends AbstractCOptionPage {
Text buildLocation; Text buildLocation;
Button locationVariablesButton; Button locationVariablesButton;
Text targetFull;
Text targetIncr; Text targetIncr;
Text targetAuto; Text targetAuto;
Text targetClean; Text targetClean;
Button fullButton;
Button incrButton; Button incrButton;
Button autoButton; Button autoButton;
Button cleanButton; Button cleanButton;
Button fullVariableButton;
Button incrVariableButton; Button incrVariableButton;
Button autoVariableButton; Button autoVariableButton;
Button cleanVariableButton; Button cleanVariableButton;
@ -189,8 +186,6 @@ public class SettingsBlock extends AbstractCOptionPage {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
targetAuto.setEnabled(autoButton.getSelection()); targetAuto.setEnabled(autoButton.getSelection());
autoVariableButton.setEnabled(autoButton.getSelection()); autoVariableButton.setEnabled(autoButton.getSelection());
targetFull.setEnabled(fullButton.getSelection());
fullVariableButton.setEnabled(fullButton.getSelection());
targetIncr.setEnabled(incrButton.getSelection()); targetIncr.setEnabled(incrButton.getSelection());
incrVariableButton.setEnabled(incrButton.getSelection()); incrVariableButton.setEnabled(incrButton.getSelection());
targetClean.setEnabled(cleanButton.getSelection()); targetClean.setEnabled(cleanButton.getSelection());
@ -231,20 +226,11 @@ public class SettingsBlock extends AbstractCOptionPage {
incrButton.addSelectionListener(selectionAdapter); incrButton.addSelectionListener(selectionAdapter);
incrButton.setSelection(fBuildInfo.isIncrementalBuildEnabled()); incrButton.setSelection(fBuildInfo.isIncrementalBuildEnabled());
targetIncr = ControlFactory.createTextField(group, SWT.SINGLE | SWT.BORDER); targetIncr = ControlFactory.createTextField(group, SWT.SINGLE | SWT.BORDER);
targetIncr.setText(fBuildInfo.getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREAMENTAL, "")); //$NON-NLS-1$ targetIncr.setText(fBuildInfo.getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREMENTAL, "")); //$NON-NLS-1$
((GridData) (targetIncr.getLayoutData())).horizontalAlignment = GridData.FILL; ((GridData) (targetIncr.getLayoutData())).horizontalAlignment = GridData.FILL;
((GridData) (targetIncr.getLayoutData())).grabExcessHorizontalSpace = true; ((GridData) (targetIncr.getLayoutData())).grabExcessHorizontalSpace = true;
addControlAccessibleListener(targetIncr, MakeUIPlugin.getResourceString(MAKE_BUILD_INCREMENTAL_TARGET)); addControlAccessibleListener(targetIncr, MakeUIPlugin.getResourceString(MAKE_BUILD_INCREMENTAL_TARGET));
incrVariableButton = addVariablesButton(group, targetIncr); incrVariableButton = addVariablesButton(group, targetIncr);
fullButton = ControlFactory.createCheckBox(group, MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_FULL));
fullButton.addSelectionListener(selectionAdapter);
fullButton.setSelection(fBuildInfo.isFullBuildEnabled());
targetFull = ControlFactory.createTextField(group, SWT.SINGLE | SWT.BORDER);
targetFull.setText(fBuildInfo.getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_FULL, "")); //$NON-NLS-1$
((GridData) (targetFull.getLayoutData())).horizontalAlignment = GridData.FILL;
((GridData) (targetFull.getLayoutData())).grabExcessHorizontalSpace = true;
addControlAccessibleListener(targetFull, MakeUIPlugin.getResourceString(MAKE_BUILD_FULL_TARGET));
fullVariableButton = addVariablesButton(group, targetFull);
cleanButton = ControlFactory.createCheckBox(group, MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_CLEAN)); cleanButton = ControlFactory.createCheckBox(group, MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_CLEAN));
cleanButton.addSelectionListener(selectionAdapter); cleanButton.addSelectionListener(selectionAdapter);
cleanButton.setSelection(fBuildInfo.isCleanBuildEnabled()); cleanButton.setSelection(fBuildInfo.isCleanBuildEnabled());
@ -468,9 +454,8 @@ public class SettingsBlock extends AbstractCOptionPage {
info.setAutoBuildEnable(autoButton.getSelection()); info.setAutoBuildEnable(autoButton.getSelection());
info.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_AUTO, targetAuto.getText().trim()); info.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_AUTO, targetAuto.getText().trim());
info.setIncrementalBuildEnable(incrButton.getSelection()); info.setIncrementalBuildEnable(incrButton.getSelection());
info.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREAMENTAL, targetIncr.getText().trim()); info.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREMENTAL, targetIncr.getText().trim());
info.setFullBuildEnable(fullButton.getSelection()); info.setFullBuildEnable(incrButton.getSelection());
info.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_FULL, targetFull.getText().trim());
info.setCleanBuildEnable(cleanButton.getSelection()); info.setCleanBuildEnable(cleanButton.getSelection());
info.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_CLEAN, targetClean.getText().trim()); info.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_CLEAN, targetClean.getText().trim());
if (buildLocation != null) { if (buildLocation != null) {
@ -531,10 +516,6 @@ public class SettingsBlock extends AbstractCOptionPage {
incrVariableButton.setEnabled(info.isIncrementalBuildEnabled()); incrVariableButton.setEnabled(info.isIncrementalBuildEnabled());
targetIncr.setText(info.getIncrementalBuildTarget()); targetIncr.setText(info.getIncrementalBuildTarget());
targetIncr.setEnabled(info.isIncrementalBuildEnabled()); targetIncr.setEnabled(info.isIncrementalBuildEnabled());
fullButton.setSelection(info.isFullBuildEnabled());
fullVariableButton.setEnabled(info.isFullBuildEnabled());
targetFull.setText(info.getFullBuildTarget());
targetFull.setEnabled(info.isFullBuildEnabled());
cleanButton.setSelection(info.isCleanBuildEnabled()); cleanButton.setSelection(info.isCleanBuildEnabled());
cleanVariableButton.setEnabled(info.isCleanBuildEnabled()); cleanVariableButton.setEnabled(info.isCleanBuildEnabled());
targetClean.setText(info.getCleanBuildTarget()); targetClean.setText(info.getCleanBuildTarget());

View file

@ -219,7 +219,6 @@ public class GeneratedMakefileBuilder extends ACBuilder {
private static final String TRACE_FOOTER = "]: "; //$NON-NLS-1$ private static final String TRACE_FOOTER = "]: "; //$NON-NLS-1$
private static final String TRACE_HEADER = "GeneratedmakefileBuilder trace ["; //$NON-NLS-1$ private static final String TRACE_HEADER = "GeneratedmakefileBuilder trace ["; //$NON-NLS-1$
private static final String TYPE_CLEAN = "ManagedMakeBuilder.type.clean"; //$NON-NLS-1$ private static final String TYPE_CLEAN = "ManagedMakeBuilder.type.clean"; //$NON-NLS-1$
private static final String TYPE_FULL = "ManagedMakeBuilder.type.full"; //$NON-NLS-1$
private static final String TYPE_INC = "ManagedMakeBuider.type.incremental"; //$NON-NLS-1$ private static final String TYPE_INC = "ManagedMakeBuider.type.incremental"; //$NON-NLS-1$
private static final String WARNING_UNSUPPORTED_CONFIGURATION = "ManagedMakeBuilder.warning.unsupported.configuration"; //$NON-NLS-1$ private static final String WARNING_UNSUPPORTED_CONFIGURATION = "ManagedMakeBuilder.warning.unsupported.configuration"; //$NON-NLS-1$
public static boolean VERBOSE = false; public static boolean VERBOSE = false;
@ -276,9 +275,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
ConsoleOutputStream consoleOutStream = console.getOutputStream(); ConsoleOutputStream consoleOutStream = console.getOutputStream();
// Report a successful clean // Report a successful clean
String[] consoleHeader = new String[3]; String[] consoleHeader = new String[3];
if (buildType == FULL_BUILD) { if (buildType == FULL_BUILD || buildType == INCREMENTAL_BUILD) {
consoleHeader[0] = ManagedMakeMessages.getResourceString(TYPE_FULL);
} else if (buildType == INCREMENTAL_BUILD) {
consoleHeader[0] = ManagedMakeMessages.getResourceString(TYPE_INC); consoleHeader[0] = ManagedMakeMessages.getResourceString(TYPE_INC);
} else { } else {
consoleHeader[0] = new String(); consoleHeader[0] = new String();
@ -595,7 +592,6 @@ public class GeneratedMakefileBuilder extends ACBuilder {
args.add("clean"); //$NON-NLS-1$ args.add("clean"); //$NON-NLS-1$
break; break;
case FULL_BUILD: case FULL_BUILD:
args.add("clean"); //$NON-NLS-1$
case INCREMENTAL_BUILD: case INCREMENTAL_BUILD:
args.add("all"); //$NON-NLS-1$ args.add("all"); //$NON-NLS-1$
break; break;
@ -749,8 +745,6 @@ public class GeneratedMakefileBuilder extends ACBuilder {
String[] consoleHeader = new String[3]; String[] consoleHeader = new String[3];
switch (buildType) { switch (buildType) {
case FULL_BUILD: case FULL_BUILD:
consoleHeader[0] = ManagedMakeMessages.getResourceString(TYPE_FULL);
break;
case INCREMENTAL_BUILD: case INCREMENTAL_BUILD:
consoleHeader[0] = ManagedMakeMessages.getResourceString(TYPE_INC); consoleHeader[0] = ManagedMakeMessages.getResourceString(TYPE_INC);
break; break;

View file

@ -27,8 +27,7 @@ ManagedMakeBuilder.message.finished = Build complete for project {0}
ManagedMakeBuilder.message.clean.deleting.output=Removing build artifacts from {0} ManagedMakeBuilder.message.clean.deleting.output=Removing build artifacts from {0}
ManagedMakeBuilder.message.clean.build.clean=Trying a make clean in {0} ManagedMakeBuilder.message.clean.build.clean=Trying a make clean in {0}
ManagedMakeBuilder.type.clean = Clean-only build ManagedMakeBuilder.type.clean = Clean-only build
ManagedMakeBuilder.type.full = Full rebuild ManagedMakeBuider.type.incremental = Build
ManagedMakeBuider.type.incremental = Incremental build
ManagedMakeBuilder.warning.unsupported.configuration=**** WARNING: The "{0}" Configuration may not build ****\n**** because it uses the "{1}" ****\n**** tool-chain that is unsupported on this system. ****\n\n**** Attempting to build... **** ManagedMakeBuilder.warning.unsupported.configuration=**** WARNING: The "{0}" Configuration may not build ****\n**** because it uses the "{1}" ****\n**** tool-chain that is unsupported on this system. ****\n\n**** Attempting to build... ****
# Option exception messages # Option exception messages