### Eclipse Workspace Patch 1.0 #P org.eclipse.pde.core Index: src/org/eclipse/pde/internal/core/builders/FeatureErrorReporter.java =================================================================== RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/FeatureErrorReporter.java,v retrieving revision 1.9 diff -u -r1.9 FeatureErrorReporter.java --- src/org/eclipse/pde/internal/core/builders/FeatureErrorReporter.java 28 Oct 2008 20:19:11 -0000 1.9 +++ src/org/eclipse/pde/internal/core/builders/FeatureErrorReporter.java 5 Aug 2009 18:22:12 -0000 @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Simon Muschel - bug 260549 *******************************************************************************/ package org.eclipse.pde.internal.core.builders; @@ -15,8 +16,7 @@ import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.osgi.util.NLS; -import org.eclipse.pde.core.plugin.IPluginModelBase; -import org.eclipse.pde.core.plugin.PluginRegistry; +import org.eclipse.pde.core.plugin.*; import org.eclipse.pde.internal.core.*; import org.eclipse.pde.internal.core.ibundle.IBundlePluginModel; import org.eclipse.pde.internal.core.ibundle.IManifestHeader; @@ -105,6 +105,7 @@ validatePluginID(plugin, attr, isFragment); } else if (name.equals("version")) { //$NON-NLS-1$ validateVersionAttribute(plugin, attr); + validateVersion(plugin, attr); } else if (name.equals("fragment") || name.equals("unpack")) { //$NON-NLS-1$ //$NON-NLS-2$ validateBoolean(plugin, attr); } else if (!name.equals("os") && !name.equals("ws") && !name.equals("nl") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ @@ -425,4 +426,22 @@ report(message, getLine(parent), severity, PDEMarkerFactory.CAT_OTHER); } } + + private void validateVersion(Element plugin, Attr attr) { + String id = plugin.getAttribute("id"); //$NON-NLS-1$ + String version = plugin.getAttribute("version"); //$NON-NLS-1$ + if (version.equals("0.0.0")) //$NON-NLS-1$ + return; + ModelEntry entry = PluginRegistry.findEntry(id); + IPluginModelBase[] allModels = entry.getActiveModels(); + for (int i = 0; i < allModels.length; i++) { + IPluginModelBase availablePlugin = allModels[i]; + if (id.equals(availablePlugin.getPluginBase().getId())) { + if (version.equals(availablePlugin.getPluginBase().getVersion())) { + return; + } + } + } + report(NLS.bind(PDECoreMessages.Builders_Feature_mismatchPluginVersion, new String[] {version, id}), getLine(plugin, attr.getName()), CompilerFlags.WARNING, PDEMarkerFactory.CAT_OTHER); + } } Index: src/org/eclipse/pde/internal/core/PDECoreMessages.java =================================================================== RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECoreMessages.java,v retrieving revision 1.69 diff -u -r1.69 PDECoreMessages.java --- src/org/eclipse/pde/internal/core/PDECoreMessages.java 28 Jul 2009 19:46:59 -0000 1.69 +++ src/org/eclipse/pde/internal/core/PDECoreMessages.java 5 Aug 2009 18:22:12 -0000 @@ -8,7 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation * Code 9 Corporation - on going enhancements and maintenance - * Simon Muschel - bug 215743 + * Simon Muschel - bugs 215743, 260549 *******************************************************************************/ package org.eclipse.pde.internal.core; @@ -114,6 +114,7 @@ public static String Builders_Feature_patchedMatch; public static String Builders_Feature_missingUnpackFalse; public static String Builders_Feature_mismatchUnpackBundleShape; + public static String Builders_Feature_mismatchPluginVersion; public static String Builders_Schema_compiling; public static String Builders_Schema_compilingSchemas; public static String Builders_Schema_removing; Index: src/org/eclipse/pde/internal/core/pderesources.properties =================================================================== RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/pderesources.properties,v retrieving revision 1.112 diff -u -r1.112 pderesources.properties --- src/org/eclipse/pde/internal/core/pderesources.properties 28 Jul 2009 19:46:59 -0000 1.112 +++ src/org/eclipse/pde/internal/core/pderesources.properties 5 Aug 2009 18:22:12 -0000 @@ -7,7 +7,7 @@ # # Contributors: # IBM Corporation - initial API and implementation -# Simon Muschel - bug 215743 +# Simon Muschel - bugs 215743, 260549 ############################################################################### ###### Status text ##################################### @@ -59,6 +59,7 @@ Builders_Feature_patchedMatch = ''{0}'' attribute cannot be used when ''patch'' attribue is set Builders_Feature_missingUnpackFalse = It is recommended for plug-in ''{0}'' to run from a JAR, specify ''{1}'' attribute Builders_Feature_mismatchUnpackBundleShape = The feature specifies ''{0}'', however the plug-in ''{1}'' specifies ''{2}'' +Builders_Feature_mismatchPluginVersion = Version ''{0}'' of plug-in ''{1}'' is not available. Builders_Schema_compiling = Compiling {0} ... Builders_Schema_compilingSchemas=Compiling extension point schemas... Builders_Schema_removing = Removing {0} ...