rpms/eclipse-cdt/devel eclipse-cdt-dynamic-scannerinfo-ext.patch, NONE, 1.1 eclipse-cdt.spec, 1.41, 1.42
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Wed Jul 12 21:09:53 UTC 2006
Author: jjohnstn
Update of /cvs/dist/rpms/eclipse-cdt/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv834
Modified Files:
eclipse-cdt.spec
Added Files:
eclipse-cdt-dynamic-scannerinfo-ext.patch
Log Message:
* Wed Jul 12 2006 Jeff Johnston <jjohnstn at redhat.com> 3.1.0-1jpp_2fc
- Add dynamic scannerinfo extension used by Autotools plug-in.
eclipse-cdt-dynamic-scannerinfo-ext.patch:
org.eclipse.cdt.core/plugin.xml | 1
org.eclipse.cdt.core/schema/DynamicScannerInfoProvider.exsd | 105 ++++++++++
org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java | 22 ++
org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java | 45 +++-
4 files changed, 161 insertions(+), 12 deletions(-)
--- NEW FILE eclipse-cdt-dynamic-scannerinfo-ext.patch ---
--- ./results/plugins/org.eclipse.cdt.core/schema/DynamicScannerInfoProvider.exsd.fix 2006-07-12 16:58:30.000000000 -0400
+++ ./results/plugins/org.eclipse.cdt.core/schema/DynamicScannerInfoProvider.exsd 2006-07-12 16:56:05.000000000 -0400
@@ -0,0 +1,105 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.cdt.core">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.cdt.core" id="DynamicScannerInfoProvider" name="Dynamic ScannerInfoProvider"/>
+ </appInfo>
+ <documentation>
+ ScannerInfoProvider that extracts from dynamic build info taken from makefiles.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence>
+ <element ref="run"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="run">
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ Class which implements IScannerInfoProvider dynamically from makefile build.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.cdt.core.parser.IScannerInfoProvider"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+</schema>
--- ./results/plugins/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java.fix 2006-07-12 16:54:55.000000000 -0400
+++ ./results/plugins/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java 2006-07-12 16:56:05.000000000 -0400
@@ -856,6 +856,28 @@ public class CCorePlugin extends Plugin
}
return provider;
}
+
+ /**
+ * Get the dynamic IScannerInfoProvider contributed interface for the platform.
+ * @return IScannerInfoProvider or null
+ */
+ public IScannerInfoProvider getDynamicScannerInfoProvider() throws CoreException {
+ IScannerInfoProvider provider = null;
+ IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint(CCorePlugin.PLUGIN_ID, "DynamicScannerInfoProvider"); //$NON-NLS-1$
+ if (extension != null) {
+ IExtension[] extensions = extension.getExtensions();
+ try {
+ if (extensions.length > 0) {
+ IConfigurationElement[] configElements = extensions[0].getConfigurationElements();
+ provider = (IScannerInfoProvider) configElements[0].createExecutableExtension("class");
+ }
+ return provider;
+ } catch (CoreException e) {
+ // log(e);
+ }
+ }
+ return null;
+ }
/**
* Helper function, returning the contenttype for a filename
--- ./results/plugins/org.eclipse.cdt.core/plugin.xml.fix 2006-07-12 16:54:19.000000000 -0400
+++ ./results/plugins/org.eclipse.cdt.core/plugin.xml 2006-07-12 16:56:05.000000000 -0400
@@ -44,6 +44,7 @@
<extension-point id="CodeFormatter" name="%CodeFormatter.name" schema="schema/CodeFormatter.exsd"/>
<extension-point id="CIndexer" name="C/C++ Indexer" schema="schema/CIndexer.exsd"/>
<extension-point id="language" name="%language.name" schema="schema/language.exsd"/>
+ <extension-point id="DynamicScannerInfoProvider" name="Dynamic ScannerInfoProvider" schema="schema/DynamicScannerInfoProvider.exsd"/>
<!-- =================================================================================== -->
<!-- Define the list of the Binary Parser provided by the CDT -->
<!-- =================================================================================== -->
--- ./results/plugins/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java.fix 2006-07-12 16:55:40.000000000 -0400
+++ ./results/plugins/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java 2006-07-12 16:56:05.000000000 -0400
@@ -37,8 +37,10 @@ import org.eclipse.core.resources.IResou
import org.eclipse.core.resources.IResourceProxyVisitor;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ISelection;
@@ -79,30 +81,47 @@ public class OpenIncludeAction extends A
if (include == null) {
return;
}
-
try {
+ boolean dynamicIncludePathFound = false;
IResource res = include.getUnderlyingResource();
ArrayList filesFound = new ArrayList(4);
+ IResource resToScan = res;
+ QualifiedName dynamicScannerPrevFile = new QualifiedName("org.eclipse.cdt.core", "DynamicScannerPrevFile");
if (res != null) {
IProject proj = res.getProject();
String includeName = include.getElementName();
- // Search in the scannerInfo information
- IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(proj);
+ IScannerInfoProvider provider = CCorePlugin.getDefault().getDynamicScannerInfoProvider();
if (provider != null) {
- IScannerInfo info = provider.getScannerInformation(res);
- // XXXX this should fall back to project by itself
- if (info == null) {
- info = provider.getScannerInformation(proj);
- }
+ while (resToScan.getSessionProperty(dynamicScannerPrevFile) != null)
+ resToScan = (IResource)resToScan.getSessionProperty(dynamicScannerPrevFile);
+ IScannerInfo info = provider.getScannerInformation(resToScan);
if (info != null) {
String[] includePaths = info.getIncludePaths();
HashSet found = new HashSet();
findFile(includePaths, includeName, filesFound, found);
}
- if (filesFound.size() == 0) {
- // Fall back and search the project
- findFile(proj, new Path(includeName), filesFound);
+ }
+ if (filesFound.size() == 0) {
+ // Search in the scannerInfo information
+ provider = CCorePlugin.getDefault().getScannerInfoProvider(proj);
+ if (provider != null) {
+ IScannerInfo info = provider.getScannerInformation(res);
+ // XXXX this should fall back to project by itself
+ if (info == null) {
+ info = provider.getScannerInformation(proj);
+ }
+ if (info != null) {
+ String[] includePaths = info.getIncludePaths();
+ HashSet found = new HashSet();
+ findFile(includePaths, includeName, filesFound, found);
+ }
+ if (filesFound.size() == 0) {
+ // Fall back and search the project
+ findFile(proj, new Path(includeName), filesFound);
+ }
}
+ } else {
+ dynamicIncludePathFound = true;
}
}
IPath fileToOpen;
@@ -110,7 +129,7 @@ public class OpenIncludeAction extends A
if (nElementsFound == 0) {
noElementsFound();
fileToOpen= null;
- } else if (nElementsFound == 1) {
+ } else if (nElementsFound == 1 || dynamicIncludePathFound) {
fileToOpen= (IPath) filesFound.get(0);
} else {
fileToOpen= chooseFile(filesFound);
@@ -119,6 +138,8 @@ public class OpenIncludeAction extends A
if (fileToOpen != null) {
IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(fileToOpen);
if (file != null) {
+ if (dynamicIncludePathFound)
+ file.setSessionProperty(dynamicScannerPrevFile, resToScan);
EditorUtility.openInEditor(file);
} else {
ICProject cproject = include.getCProject();
Index: eclipse-cdt.spec
===================================================================
RCS file: /cvs/dist/rpms/eclipse-cdt/devel/eclipse-cdt.spec,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- eclipse-cdt.spec 10 Jul 2006 22:38:32 -0000 1.41
+++ eclipse-cdt.spec 12 Jul 2006 21:09:50 -0000 1.42
@@ -21,7 +21,7 @@
Summary: %{pkg_summary}
Name: %{eclipse_name}-cdt
Version: %{majmin}.%{micro}
-Release: 1jpp_1fc
+Release: 1jpp_2fc
License: Eclipse Public License - v 1.0 (EPL) <http://www.eclipse.org/legal/epl-v10.html>
Group: Text Editors/Integrated Development Environments (IDE)
URL: http://www.eclipse.org/cdt
@@ -48,6 +48,7 @@
Patch2: %{name}-platform-build-linux.patch
Patch3: %{name}-sdk-build-linux.patch
Patch4: %{name}-no-tests.patch
+Patch5: %{name}-dynamic-scannerinfo-ext.patch
BuildRequires: eclipse-pde
%if %{gcj_support}
@@ -80,6 +81,7 @@
%patch2 -p0
%patch3 -p0
%patch4 -p0
+%patch5 -p0
popd
# Upstream CVS includes random .so files. Let's remove them now.
@@ -231,6 +233,9 @@
%changelog
+* Wed Jul 12 2006 Jeff Johnston <jjohnstn at redhat.com> 3.1.0-1jpp_2fc
+- Add dynamic scannerinfo extension used by Autotools plug-in.
+
* Mon Jul 10 2006 Andrew Overholt <overholt at redhat.com> 3.1.0-1jpp_1fc
- 3.1.0.
More information about the fedora-cvs-commits
mailing list