mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 01:36:01 +02:00
Bug 321778 Lost preference: build only if changes in workspace - patch by Keith W. Campbell
This commit is contained in:
parent
32d31cdd24
commit
57405226fa
4 changed files with 25 additions and 8 deletions
|
@ -9,6 +9,7 @@
|
|||
* QNX Software Systems - Initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
* Sergey Prigogin (Google)
|
||||
* IBM Corporation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core;
|
||||
|
||||
|
@ -148,4 +149,18 @@ public class CCorePreferenceConstants {
|
|||
* @since 5.2
|
||||
*/
|
||||
public static final String SHOW_SOURCE_ROOTS_AT_TOP_LEVEL_OF_PROJECT = CCorePlugin.PLUGIN_ID + ".showSourceRootsAtTopLevelOfProject"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* "Build All Configurations" preference key.
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public static final String PREF_BUILD_ALL_CONFIGS = "build.all.configs.enabled"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Preference key for "build only if resources in (related) projects are modified".
|
||||
*
|
||||
* @since 5.1
|
||||
*/
|
||||
public static final String PREF_BUILD_CONFIGS_RESOURCE_CHANGES = "build.proj.ref.configs.enabled"; //$NON-NLS-1$
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ import java.net.URI;
|
|||
import java.util.Map;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.CCorePreferenceConstants;
|
||||
import org.eclipse.cdt.core.IMarkerGenerator;
|
||||
import org.eclipse.cdt.core.ProblemMarkerInfo;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
|
@ -35,8 +36,6 @@ import org.eclipse.osgi.util.NLS;
|
|||
|
||||
public abstract class ACBuilder extends IncrementalProjectBuilder implements IMarkerGenerator {
|
||||
|
||||
private static final String PREF_BUILD_ALL_CONFIGS = "build.all.configs.enabled"; //$NON-NLS-1$
|
||||
private static final String PREF_BUILD_CONFIGS_RESOURCE_CHANGES = "build.proj.ref.configs.enabled"; //$NON-NLS-1$
|
||||
private static final Preferences prefs = CCorePlugin.getDefault().getPluginPreferences();
|
||||
|
||||
private static final String CONTENTS_CONFIGURATION_IDS = "org.eclipse.cdt.make.core.configurationIds"; //$NON-NLS-1$
|
||||
|
@ -126,11 +125,11 @@ public abstract class ACBuilder extends IncrementalProjectBuilder implements IMa
|
|||
}
|
||||
|
||||
public static boolean needAllConfigBuild() {
|
||||
return prefs.getBoolean(PREF_BUILD_ALL_CONFIGS);
|
||||
return prefs.getBoolean(CCorePreferenceConstants.PREF_BUILD_ALL_CONFIGS);
|
||||
}
|
||||
|
||||
public static void setAllConfigBuild(boolean enable) {
|
||||
prefs.setValue(PREF_BUILD_ALL_CONFIGS, enable);
|
||||
prefs.setValue(CCorePreferenceConstants.PREF_BUILD_ALL_CONFIGS, enable);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -142,7 +141,7 @@ public abstract class ACBuilder extends IncrementalProjectBuilder implements IMa
|
|||
*/
|
||||
public static boolean buildConfigResourceChanges() {
|
||||
//bug 219337
|
||||
return prefs.getBoolean(PREF_BUILD_CONFIGS_RESOURCE_CHANGES);
|
||||
return prefs.getBoolean(CCorePreferenceConstants.PREF_BUILD_CONFIGS_RESOURCE_CHANGES);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -152,7 +151,7 @@ public abstract class ACBuilder extends IncrementalProjectBuilder implements IMa
|
|||
* @since 5.1
|
||||
*/
|
||||
public static void setBuildConfigResourceChanges(boolean enable) {
|
||||
prefs.setValue(PREF_BUILD_CONFIGS_RESOURCE_CHANGES, enable);
|
||||
prefs.setValue(CCorePreferenceConstants.PREF_BUILD_CONFIGS_RESOURCE_CHANGES, enable);
|
||||
}
|
||||
|
||||
@SuppressWarnings("nls")
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
* QNX Software Systems - Initial API and implementation
|
||||
* Sergey Prigogin (Google)
|
||||
* Markus Schorn (Wind River Systems)
|
||||
* IBM Corporation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core;
|
||||
|
||||
|
@ -61,6 +62,10 @@ public class CCorePreferenceInitializer extends AbstractPreferenceInitializer {
|
|||
defaultPreferences.putBoolean(CCorePlugin.PREF_USE_STRUCTURAL_PARSE_MODE, false);
|
||||
defaultPreferences.putBoolean(CCorePreferenceConstants.FILE_PATH_CANONICALIZATION, true);
|
||||
defaultPreferences.putBoolean(CCorePreferenceConstants.SHOW_SOURCE_ROOTS_AT_TOP_LEVEL_OF_PROJECT, true);
|
||||
|
||||
// build defaults
|
||||
defaultPreferences.putBoolean(CCorePreferenceConstants.PREF_BUILD_ALL_CONFIGS, false);
|
||||
defaultPreferences.putBoolean(CCorePreferenceConstants.PREF_BUILD_CONFIGS_RESOURCE_CHANGES, false);
|
||||
|
||||
// indexer defaults
|
||||
IndexerPreferences.initializeDefaultPreferences(defaultPreferences);
|
||||
|
|
|
@ -238,8 +238,6 @@ public class CPluginPreferencePage extends PreferencePage implements IWorkbenchP
|
|||
public static void initDefaults(IPreferenceStore prefs) {
|
||||
prefs.setDefault(PreferenceConstants.PREF_LINK_TO_EDITOR, false);
|
||||
prefs.setDefault(PreferenceConstants.PREF_USE_STRUCTURAL_PARSE_MODE, false);
|
||||
ACBuilder.setAllConfigBuild(false);
|
||||
ACBuilder.setBuildConfigResourceChanges(false);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
Loading…
Add table
Reference in a new issue