Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Scanner config discovery - fixes

This patch contains fixes for following bugs:

- 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

Thanks,
Vmir

Index: src/org/eclipse/cdt/make/internal/core/scannerconfig/ScannerConfigInfoFactory.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/ScannerConfigInfoFactory.java,v
retrieving revision 1.6
diff -u -r1.6 ScannerConfigInfoFactory.java
--- src/org/eclipse/cdt/make/internal/core/scannerconfig/ScannerConfigInfoFactory.java	28 May 2004 14:17:03 -0000	1.6
+++ src/org/eclipse/cdt/make/internal/core/scannerconfig/ScannerConfigInfoFactory.java	4 Jun 2004 18:19:28 -0000
@@ -291,10 +291,8 @@
 			IProjectDescription description = project.getDescription();
 			ICommand builder = ScannerConfigNature.getBuildSpec(description, builderID);
 			args.put(name, value);
-			ICommand newBuilder = description.newCommand();
-			newBuilder.setBuilderName(builder.getBuilderName());
-			newBuilder.setArguments(args);
-			description = MakeProjectNature.setBuildSpec(description, newBuilder);
+			builder.setArguments(args);
+			MakeProjectNature.setBuildSpec(description, builder);
 			project.setDescription(description, null);
 		}
 
Index: src/org/eclipse/cdt/make/internal/core/scannerconfig/ScannerInfoCollector.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/ScannerInfoCollector.java,v
retrieving revision 1.11
diff -u -r1.11 ScannerInfoCollector.java
--- src/org/eclipse/cdt/make/internal/core/scannerconfig/ScannerInfoCollector.java	25 May 2004 19:04:15 -0000	1.11
+++ src/org/eclipse/cdt/make/internal/core/scannerconfig/ScannerInfoCollector.java	4 Jun 2004 18:19:28 -0000
@@ -294,7 +294,10 @@
 			String includePath = (String) i.next();
 			IPath realPath = new Path(includePath);
 			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.equals(includePath)) {
 						// Check if the translated path exists
Index: src/org/eclipse/cdt/make/internal/core/scannerconfig/util/ScannerInfoConsoleParserUtility.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/ScannerInfoConsoleParserUtility.java,v
retrieving revision 1.5
diff -u -r1.5 ScannerInfoConsoleParserUtility.java
--- src/org/eclipse/cdt/make/internal/core/scannerconfig/util/ScannerInfoConsoleParserUtility.java	7 May 2004 20:44:28 -0000	1.5
+++ src/org/eclipse/cdt/make/internal/core/scannerconfig/util/ScannerInfoConsoleParserUtility.java	4 Jun 2004 18:19:28 -0000
@@ -322,7 +322,7 @@
 		for (Iterator i = includes.iterator(); i.hasNext(); ) {
 			String include = (String) i.next();
 			IPath includePath = new Path(include);
-			if (!includePath.isAbsolute()) {
+			if (!includePath.isAbsolute() && !includePath.isUNC()) {	// do not translate UNC paths
 				// First try the current working directory
 				IPath cwd = getWorkingDirectory();
 				if (!cwd.isAbsolute()) {
Index: src/org/eclipse/cdt/make/ui/dialogs/DiscoveryOptionsBlock.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveryOptionsBlock.java,v
retrieving revision 1.6
diff -u -r1.6 DiscoveryOptionsBlock.java
--- src/org/eclipse/cdt/make/ui/dialogs/DiscoveryOptionsBlock.java	3 Jun 2004 18:08:49 -0000	1.6
+++ src/org/eclipse/cdt/make/ui/dialogs/DiscoveryOptionsBlock.java	4 Jun 2004 19:26:51 -0000
@@ -71,8 +71,6 @@
 	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_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 PREFIX = "ScannerConfigOptionsDialog"; //$NON-NLS-1$
@@ -156,11 +154,15 @@
 				IScannerConfigBuilderInfo buildInfo;
 				IProject project = getContainer().getProject();
 				if (project != null) {
+					if (needsSCNature) {
+						ScannerConfigNature.addScannerConfigNature(getContainer().getProject());
+						needsSCNature = false;
+					}
 					buildInfo = MakeCorePlugin.createScannerConfigBuildInfo(project, ScannerConfigBuilder.BUILDER_ID);
 					if (isScannerConfigDiscoveryEnabled()) {
-						createDiscoveredPathContainer(project);
+						createDiscoveredPathContainer(project, monitor);
 					} else {
-						removeDiscoveredPathContainer(project);
+						removeDiscoveredPathContainer(project, monitor);
 					}
 					// create a new discovered scanner config store
 					MakeCorePlugin.getDefault().getDiscoveryManager().removeDiscoveredInfo(project);
@@ -193,9 +195,10 @@
 	}
 	/**
 	 * @param project
+	 * @param monitor
 	 * @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);
 		ICProject cProject = CoreModel.getDefault().create(project);
 		if (cProject != null) {
@@ -203,13 +206,12 @@
 			List newEntries = new ArrayList(Arrays.asList(entries));
 			if (!newEntries.contains(container)) {
 				newEntries.add(container);
-				cProject.setRawPathEntries((IPathEntry[])newEntries.toArray(new IPathEntry[newEntries.size()]),
-						new NullProgressMonitor());
+				cProject.setRawPathEntries((IPathEntry[])newEntries.toArray(new IPathEntry[newEntries.size()]), monitor);
 			}
 		}
 	}
 
-	private void removeDiscoveredPathContainer(IProject project) throws CModelException {
+	private void removeDiscoveredPathContainer(IProject project, IProgressMonitor monitor) throws CModelException {
 		IPathEntry container = CoreModel.newContainerEntry(DiscoveredPathContainer.CONTAINER_ID);
 		ICProject cProject = CoreModel.getDefault().create(project);
 		if (cProject != null) {
@@ -217,8 +219,7 @@
 			List newEntries = new ArrayList(Arrays.asList(entries));
 			if (newEntries.contains(container)) {
 				newEntries.remove(container);
-				cProject.setRawPathEntries((IPathEntry[])newEntries.toArray(new IPathEntry[newEntries.size()]),
-						new NullProgressMonitor());
+				cProject.setRawPathEntries((IPathEntry[])newEntries.toArray(new IPathEntry[newEntries.size()]), monitor);
 			}
 		}
 	}
@@ -326,30 +327,12 @@
 		// VMIR* old projects will have discovery disabled by default
 		scEnabledButton.setSelection(needsSCNature ? false : fBuildInfo.isAutoDiscoveryEnabled());
 		scEnabledButton.addSelectionListener(new SelectionAdapter() {
-
 			public void widgetSelected(SelectionEvent e) {
-				handleScannerConfigEnable();
+				enableAllControls();
 			}
 		});
 		//		handleScannerConfigEnable(); Only if true in VMIR*
 		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();
 	}
 
 	/**

Back to the top