Lines 7-12
Link Here
|
7 |
* |
7 |
* |
8 |
* Contributors: |
8 |
* Contributors: |
9 |
* IBM Corporation - initial API and implementation |
9 |
* IBM Corporation - initial API and implementation |
|
|
10 |
* Simon Muschel <smuschel@gmx.de> - bug 260549 |
10 |
*******************************************************************************/ |
11 |
*******************************************************************************/ |
11 |
package org.eclipse.pde.internal.core.builders; |
12 |
package org.eclipse.pde.internal.core.builders; |
12 |
|
13 |
|
Lines 15-22
Link Here
|
15 |
import org.eclipse.core.resources.IFile; |
16 |
import org.eclipse.core.resources.IFile; |
16 |
import org.eclipse.core.runtime.IProgressMonitor; |
17 |
import org.eclipse.core.runtime.IProgressMonitor; |
17 |
import org.eclipse.osgi.util.NLS; |
18 |
import org.eclipse.osgi.util.NLS; |
18 |
import org.eclipse.pde.core.plugin.IPluginModelBase; |
19 |
import org.eclipse.pde.core.plugin.*; |
19 |
import org.eclipse.pde.core.plugin.PluginRegistry; |
|
|
20 |
import org.eclipse.pde.internal.core.*; |
20 |
import org.eclipse.pde.internal.core.*; |
21 |
import org.eclipse.pde.internal.core.ibundle.IBundlePluginModel; |
21 |
import org.eclipse.pde.internal.core.ibundle.IBundlePluginModel; |
22 |
import org.eclipse.pde.internal.core.ibundle.IManifestHeader; |
22 |
import org.eclipse.pde.internal.core.ibundle.IManifestHeader; |
Lines 105-110
Link Here
|
105 |
validatePluginID(plugin, attr, isFragment); |
105 |
validatePluginID(plugin, attr, isFragment); |
106 |
} else if (name.equals("version")) { //$NON-NLS-1$ |
106 |
} else if (name.equals("version")) { //$NON-NLS-1$ |
107 |
validateVersionAttribute(plugin, attr); |
107 |
validateVersionAttribute(plugin, attr); |
|
|
108 |
validateVersion(plugin, attr); |
108 |
} else if (name.equals("fragment") || name.equals("unpack")) { //$NON-NLS-1$ //$NON-NLS-2$ |
109 |
} else if (name.equals("fragment") || name.equals("unpack")) { //$NON-NLS-1$ //$NON-NLS-2$ |
109 |
validateBoolean(plugin, attr); |
110 |
validateBoolean(plugin, attr); |
110 |
} else if (!name.equals("os") && !name.equals("ws") && !name.equals("nl") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
111 |
} else if (!name.equals("os") && !name.equals("ws") && !name.equals("nl") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
Lines 425-428
Link Here
|
425 |
report(message, getLine(parent), severity, PDEMarkerFactory.CAT_OTHER); |
426 |
report(message, getLine(parent), severity, PDEMarkerFactory.CAT_OTHER); |
426 |
} |
427 |
} |
427 |
} |
428 |
} |
|
|
429 |
|
430 |
private void validateVersion(Element plugin, Attr attr) { |
431 |
String id = plugin.getAttribute("id"); //$NON-NLS-1$ |
432 |
String version = plugin.getAttribute("version"); //$NON-NLS-1$ |
433 |
if (version.equals("0.0.0")) //$NON-NLS-1$ |
434 |
return; |
435 |
ModelEntry entry = PluginRegistry.findEntry(id); |
436 |
IPluginModelBase[] allModels = entry.getActiveModels(); |
437 |
for (int i = 0; i < allModels.length; i++) { |
438 |
IPluginModelBase availablePlugin = allModels[i]; |
439 |
if (id.equals(availablePlugin.getPluginBase().getId())) { |
440 |
if (version.equals(availablePlugin.getPluginBase().getVersion())) { |
441 |
return; |
442 |
} |
443 |
} |
444 |
} |
445 |
report(NLS.bind(PDECoreMessages.Builders_Feature_mismatchPluginVersion, new String[] {version, id}), getLine(plugin, attr.getName()), CompilerFlags.WARNING, PDEMarkerFactory.CAT_OTHER); |
446 |
} |
428 |
} |
447 |
} |