1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00
- PR 62334: `Message: Unable to find full path for "cygpath" echoed
repeatedly to xterminal`
- PR 64226: `[Scanner Config] Path discovery supporting UNC filepaths`
- PR 65121: `[Scanner Config] Importing 1.2.1 project does not update
properties`
- PR 62742: `CDT-specific file changes to .project are not saved` -
Scanner config portion, since Platform PR 64128 `Changing arguments on an
ICommand no longer makes it to the .project` was fixed in Eclipse 3.0 RC1
This commit is contained in:
David Inglis 2004-06-07 15:53:30 +00:00
parent 2dfa4fa8a1
commit df04b9e18c
4 changed files with 19 additions and 35 deletions

View file

@ -291,10 +291,8 @@ public class ScannerConfigInfoFactory {
IProjectDescription description = project.getDescription(); IProjectDescription description = project.getDescription();
ICommand builder = ScannerConfigNature.getBuildSpec(description, builderID); ICommand builder = ScannerConfigNature.getBuildSpec(description, builderID);
args.put(name, value); args.put(name, value);
ICommand newBuilder = description.newCommand(); builder.setArguments(args);
newBuilder.setBuilderName(builder.getBuilderName()); MakeProjectNature.setBuildSpec(description, builder);
newBuilder.setArguments(args);
description = MakeProjectNature.setBuildSpec(description, newBuilder);
project.setDescription(description, null); project.setDescription(description, null);
} }

View file

@ -294,7 +294,10 @@ public class ScannerInfoCollector implements IScannerInfoCollector {
String includePath = (String) i.next(); String includePath = (String) i.next();
IPath realPath = new Path(includePath); IPath realPath = new Path(includePath);
if (!realPath.toFile().exists()) { if (!realPath.toFile().exists()) {
String translatedPath = new CygpathTranslator(currentProject, includePath).run(); String translatedPath = includePath;
if (Platform.getOS().equals(Platform.OS_WIN32)) {
translatedPath = new CygpathTranslator(currentProject, includePath).run();
}
if (translatedPath != null) { if (translatedPath != null) {
if (!translatedPath.equals(includePath)) { if (!translatedPath.equals(includePath)) {
// Check if the translated path exists // Check if the translated path exists

View file

@ -322,7 +322,7 @@ public class ScannerInfoConsoleParserUtility implements IScannerInfoConsoleParse
for (Iterator i = includes.iterator(); i.hasNext(); ) { for (Iterator i = includes.iterator(); i.hasNext(); ) {
String include = (String) i.next(); String include = (String) i.next();
IPath includePath = new Path(include); IPath includePath = new Path(include);
if (!includePath.isAbsolute()) { if (!includePath.isAbsolute() && !includePath.isUNC()) { // do not translate UNC paths
// First try the current working directory // First try the current working directory
IPath cwd = getWorkingDirectory(); IPath cwd = getWorkingDirectory();
if (!cwd.isAbsolute()) { if (!cwd.isAbsolute()) {

View file

@ -71,8 +71,6 @@ public class DiscoveryOptionsBlock extends AbstractCOptionPage {
private static final String PREFIX_BP = "BuildPathInfoBlock"; //$NON-NLS-1$ private static final String PREFIX_BP = "BuildPathInfoBlock"; //$NON-NLS-1$
private static final String SC_GROUP_LABEL = PREFIX_BP + ".scGroup.label"; //$NON-NLS-1$ private static final String SC_GROUP_LABEL = PREFIX_BP + ".scGroup.label"; //$NON-NLS-1$
private static final String SC_ENABLED_LABEL = PREFIX_BP + ".scGroup.enabled.label"; //$NON-NLS-1$ private static final String SC_ENABLED_LABEL = PREFIX_BP + ".scGroup.enabled.label"; //$NON-NLS-1$
// private static final String SC_OPTIONS_LABEL = PREFIX +
// ".scGroup.options.label"; //$NON-NLS-1$
private static final String MISSING_BUILDER_MSG = "ScannerConfigOptionsDialog.label.missingBuilderInformation"; //$NON-NLS-1$ private static final String MISSING_BUILDER_MSG = "ScannerConfigOptionsDialog.label.missingBuilderInformation"; //$NON-NLS-1$
private static final String PREFIX = "ScannerConfigOptionsDialog"; //$NON-NLS-1$ private static final String PREFIX = "ScannerConfigOptionsDialog"; //$NON-NLS-1$
@ -156,11 +154,15 @@ public class DiscoveryOptionsBlock extends AbstractCOptionPage {
IScannerConfigBuilderInfo buildInfo; IScannerConfigBuilderInfo buildInfo;
IProject project = getContainer().getProject(); IProject project = getContainer().getProject();
if (project != null) { if (project != null) {
if (needsSCNature) {
ScannerConfigNature.addScannerConfigNature(getContainer().getProject());
needsSCNature = false;
}
buildInfo = MakeCorePlugin.createScannerConfigBuildInfo(project, ScannerConfigBuilder.BUILDER_ID); buildInfo = MakeCorePlugin.createScannerConfigBuildInfo(project, ScannerConfigBuilder.BUILDER_ID);
if (isScannerConfigDiscoveryEnabled()) { if (isScannerConfigDiscoveryEnabled()) {
createDiscoveredPathContainer(project); createDiscoveredPathContainer(project, monitor);
} else { } else {
removeDiscoveredPathContainer(project); removeDiscoveredPathContainer(project, monitor);
} }
// create a new discovered scanner config store // create a new discovered scanner config store
MakeCorePlugin.getDefault().getDiscoveryManager().removeDiscoveredInfo(project); MakeCorePlugin.getDefault().getDiscoveryManager().removeDiscoveredInfo(project);
@ -193,9 +195,10 @@ public class DiscoveryOptionsBlock extends AbstractCOptionPage {
} }
/** /**
* @param project * @param project
* @param monitor
* @throws CModelException * @throws CModelException
*/ */
private void createDiscoveredPathContainer(IProject project) throws CModelException { private void createDiscoveredPathContainer(IProject project, IProgressMonitor monitor) throws CModelException {
IPathEntry container = CoreModel.newContainerEntry(DiscoveredPathContainer.CONTAINER_ID); IPathEntry container = CoreModel.newContainerEntry(DiscoveredPathContainer.CONTAINER_ID);
ICProject cProject = CoreModel.getDefault().create(project); ICProject cProject = CoreModel.getDefault().create(project);
if (cProject != null) { if (cProject != null) {
@ -203,13 +206,12 @@ public class DiscoveryOptionsBlock extends AbstractCOptionPage {
List newEntries = new ArrayList(Arrays.asList(entries)); List newEntries = new ArrayList(Arrays.asList(entries));
if (!newEntries.contains(container)) { if (!newEntries.contains(container)) {
newEntries.add(container); newEntries.add(container);
cProject.setRawPathEntries((IPathEntry[])newEntries.toArray(new IPathEntry[newEntries.size()]), cProject.setRawPathEntries((IPathEntry[])newEntries.toArray(new IPathEntry[newEntries.size()]), monitor);
new NullProgressMonitor());
} }
} }
} }
private void removeDiscoveredPathContainer(IProject project) throws CModelException { private void removeDiscoveredPathContainer(IProject project, IProgressMonitor monitor) throws CModelException {
IPathEntry container = CoreModel.newContainerEntry(DiscoveredPathContainer.CONTAINER_ID); IPathEntry container = CoreModel.newContainerEntry(DiscoveredPathContainer.CONTAINER_ID);
ICProject cProject = CoreModel.getDefault().create(project); ICProject cProject = CoreModel.getDefault().create(project);
if (cProject != null) { if (cProject != null) {
@ -217,8 +219,7 @@ public class DiscoveryOptionsBlock extends AbstractCOptionPage {
List newEntries = new ArrayList(Arrays.asList(entries)); List newEntries = new ArrayList(Arrays.asList(entries));
if (newEntries.contains(container)) { if (newEntries.contains(container)) {
newEntries.remove(container); newEntries.remove(container);
cProject.setRawPathEntries((IPathEntry[])newEntries.toArray(new IPathEntry[newEntries.size()]), cProject.setRawPathEntries((IPathEntry[])newEntries.toArray(new IPathEntry[newEntries.size()]), monitor);
new NullProgressMonitor());
} }
} }
} }
@ -326,32 +327,14 @@ public class DiscoveryOptionsBlock extends AbstractCOptionPage {
// VMIR* old projects will have discovery disabled by default // VMIR* old projects will have discovery disabled by default
scEnabledButton.setSelection(needsSCNature ? false : fBuildInfo.isAutoDiscoveryEnabled()); scEnabledButton.setSelection(needsSCNature ? false : fBuildInfo.isAutoDiscoveryEnabled());
scEnabledButton.addSelectionListener(new SelectionAdapter() { scEnabledButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
handleScannerConfigEnable(); enableAllControls();
} }
}); });
// handleScannerConfigEnable(); Only if true in VMIR* // handleScannerConfigEnable(); Only if true in VMIR*
return true; return true;
} }
/**
* Handles scanner configuration discovery selection change
*/
private void handleScannerConfigEnable() {
boolean enable = scEnabledButton.getSelection();
if (enable && needsSCNature) {
// first install the SC nature
try {
ScannerConfigNature.addScannerConfigNature(getContainer().getProject());
needsSCNature = false;
} catch (CoreException e) {
MakeCorePlugin.log(e.getStatus());
}
}
enableAllControls();
}
/** /**
* Fills console parser maps * Fills console parser maps
*/ */