mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 17:26:01 +02:00
Fix for bugzilla 58164 "Change the tool command "gcc" not resetable" and bugzilla 58497 "Can't create a Managed Project". In the first case, the version testing did not take the qualifier the nightly build adds into account so it thought the plugin version was too high, and in the second, the configuration was not flagged as dirty, so after the reset, the change back was not saved.
This commit is contained in:
parent
74cf488602
commit
ecdbf0cd6e
4 changed files with 29 additions and 16 deletions
|
@ -71,7 +71,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
public static final String EXTENSION_POINT_ID = "ManagedBuildInfo"; //$NON-NLS-1$
|
||||
|
||||
// This is the version of the manifest and project files that
|
||||
private static final PluginVersionIdentifier buildInfoVersion = new PluginVersionIdentifier("2.0.0"); //$NON-NLS-1$
|
||||
private static final PluginVersionIdentifier buildInfoVersion = new PluginVersionIdentifier(2, 0, 0);
|
||||
private static boolean extensionTargetsLoaded = false;
|
||||
private static Map extensionTargetMap;
|
||||
private static List extensionTargets;
|
||||
|
@ -455,6 +455,18 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
return new Target(resource, parentTarget);
|
||||
}
|
||||
|
||||
private static boolean isVersionCompatible(IPluginDescriptor descriptor) {
|
||||
// Get the version of the manifest
|
||||
PluginVersionIdentifier plugin = descriptor.getVersionIdentifier();
|
||||
|
||||
// We can ignore the qualifier
|
||||
PluginVersionIdentifier version = new PluginVersionIdentifier(plugin.getMajorComponent(),
|
||||
plugin.getMinorComponent(),
|
||||
plugin.getServiceComponent());
|
||||
|
||||
return(buildInfoVersion.isCompatibleWith(version));
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* Load the build information for the specified resource from its project
|
||||
* file. Pay attention to the version number too.
|
||||
|
@ -492,9 +504,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
// Get those extensions
|
||||
IPluginDescriptor descriptor = ManagedBuilderCorePlugin.getDefault().getDescriptor();
|
||||
|
||||
// Get the version of the manifest
|
||||
PluginVersionIdentifier version = descriptor.getVersionIdentifier();
|
||||
if (version.isGreaterThan(buildInfoVersion)) {
|
||||
if (!isVersionCompatible(descriptor)) {
|
||||
//The version of the Plug-in is greater than what the manager thinks it understands
|
||||
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("ManagedBuildManager.error.version.higher")); //$NON-NLS-1$
|
||||
}
|
||||
|
|
|
@ -412,6 +412,7 @@ public class Configuration extends BuildObject implements IConfiguration {
|
|||
ref.resolveReferences();
|
||||
}
|
||||
}
|
||||
isDirty = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -831,8 +831,13 @@ public class BuildPropertyPage extends PropertyPage implements IWorkbenchPropert
|
|||
// Recreate the settings store for the configuration
|
||||
settingsStore = new BuildToolsSettingsStore(getSelectedConfiguration());
|
||||
|
||||
// Reset the category selection and run selection event handler
|
||||
// Write out the build model info
|
||||
ManagedBuildManager.setDefaultConfiguration(getProject(), getSelectedConfiguration());
|
||||
ManagedBuildManager.saveBuildInfo(getProject(), false);
|
||||
|
||||
// Reset the category or tool selection and run selection event handler
|
||||
selectedCategory = null;
|
||||
selectedTool = null;
|
||||
handleOptionSelection();
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.eclipse.cdt.managedbuilder.core.IOption;
|
|||
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIImages;
|
||||
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.jface.dialogs.IInputValidator;
|
||||
import org.eclipse.jface.dialogs.InputDialog;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
|
@ -123,11 +124,9 @@ public class FileListControl {
|
|||
private List list;
|
||||
private String compTitle;
|
||||
private SelectionListener selectionListener;
|
||||
private GridData gdata, tgdata, grid3, grid4, grid2;
|
||||
// types of dialogs that will be displayed when the add button is pressed.
|
||||
// public static final int FILE_DIALOG = 0;
|
||||
// public static final int DIR_DIALOG = 1;
|
||||
// public static final int TEXT_DIALOG = 2;
|
||||
private GridData tgdata, grid3, grid4, grid2;
|
||||
|
||||
// The type of browse support that is required
|
||||
private int browseType;
|
||||
private IPath path;
|
||||
private static final String ADD_STR = ManagedBuilderUIPlugin.getResourceString("FileListControl.add"); //$NON-NLS-1$
|
||||
|
@ -171,20 +170,18 @@ public class FileListControl {
|
|||
form1.marginHeight = 0;
|
||||
form1.marginWidth = 0;
|
||||
filePanel.setLayout(form1);
|
||||
gdata = new GridData(GridData.FILL_BOTH);
|
||||
gdata.heightHint = 83;
|
||||
filePanel.setLayoutData(gdata);
|
||||
filePanel.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||
|
||||
// title panel
|
||||
Composite titlePanel = new Composite(filePanel, SWT.BORDER);
|
||||
GridLayout titleform = new GridLayout();
|
||||
titleform.numColumns = 2;
|
||||
GridLayout titleform = new GridLayout(2, false);
|
||||
titleform.horizontalSpacing = 0;
|
||||
titleform.verticalSpacing = 0;
|
||||
titleform.marginHeight = 0;
|
||||
titleform.marginWidth = 0;
|
||||
titlePanel.setLayout(titleform);
|
||||
tgdata = new GridData(GridData.FILL_HORIZONTAL);
|
||||
tgdata.heightHint = 22;
|
||||
tgdata.heightHint = IDialogConstants.BUTTON_BAR_HEIGHT;
|
||||
titlePanel.setLayoutData(tgdata);
|
||||
title = new Label(titlePanel, SWT.NONE | SWT.BOLD);
|
||||
this.compTitle = " " + compTitle; //$NON-NLS-1$
|
||||
|
|
Loading…
Add table
Reference in a new issue