| author | Ben Cox | 2011-09-29 11:44:17 (EDT) |
|---|---|---|
| committer | cwindatt | 2011-10-14 15:11:56 (EDT) |
| commit | 298e31911fa04f97a92b60302cd07362c0e4be40 (patch) (side-by-side diff) | |
| tree | 23939fca36550242a0fef7a93ed9426db13ba98a | |
| parent | 75b70f90b500aa0031a89b6e02c185249cb62c21 (diff) | |
| download | eclipse.pde.ui-298e31911fa04f97a92b60302cd07362c0e4be40.zip eclipse.pde.ui-298e31911fa04f97a92b60302cd07362c0e4be40.tar.gz eclipse.pde.ui-298e31911fa04f97a92b60302cd07362c0e4be40.tar.bz2 | |
Add warning for Eclipse-GenericCapability and
Eclipse-GenericRequire, instead pointing to Provide-Capability and
Require-Capability.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=355391
3 files changed, 33 insertions, 1 deletions
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECoreMessages.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECoreMessages.java index cc8c406..31f7b1d 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECoreMessages.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECoreMessages.java @@ -201,6 +201,8 @@ public class PDECoreMessages extends NLS { public static String BundleErrorReporter_InvalidSymbolicName; public static String BundleErrorReporter_invalidFilterSyntax; public static String BundleErrorReporter_importexport_servicesDeprecated; + public static String BundleErrorReporter_eclipse_genericCapabilityDeprecated; + public static String BundleErrorReporter_eclipse_genericRequireDeprecated; public static String BundleErrorReporter_unecessaryDependencyDueToFragmentHost; public static String BundleErrorReporter_missingPackagesInProject; public static String BundleErrorReporter_noExecutionEnvironmentSet; diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java index cc052fd..30df9f1 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java @@ -72,6 +72,8 @@ public class BundleErrorReporter extends JarManifestErrorReporter { validateBundleLocalization(); validateProvidePackage(); validateEclipseBundleShape(); + validateEclipseGenericCapability(); + validateEclipseGenericRequire(); } private boolean validateBundleManifestVersion() { @@ -236,7 +238,7 @@ public class BundleErrorReporter extends JarManifestErrorReporter { // Header introduced in OSGi R4 - warn if R3 manifest if (!fOsgiR4) - report(NLS.bind(PDECoreMessages.BundleErrorReporter_R4SyntaxInR3Bundle,Constants.FRAGMENT_HOST), header.getLineNumber() + 1, CompilerFlags.WARNING, PDEMarkerFactory.M_R4_SYNTAX_IN_R3_BUNDLE, PDEMarkerFactory.CAT_OTHER); + report(NLS.bind(PDECoreMessages.BundleErrorReporter_R4SyntaxInR3Bundle, Constants.FRAGMENT_HOST), header.getLineNumber() + 1, CompilerFlags.WARNING, PDEMarkerFactory.M_R4_SYNTAX_IN_R3_BUNDLE, PDEMarkerFactory.CAT_OTHER); if (!isCheckUnresolvedImports()) return; @@ -466,6 +468,32 @@ public class BundleErrorReporter extends JarManifestErrorReporter { } } + private void validateEclipseGenericCapability() { + IHeader header = getHeader(ICoreConstants.ECLIPSE_GENERIC_CAPABILITY); + if (header == null) { + return; + } + String message; + if (fOsgiR4 && isCheckDeprecated()) { + message = NLS.bind(PDECoreMessages.BundleErrorReporter_eclipse_genericCapabilityDeprecated, ICoreConstants.ECLIPSE_GENERIC_CAPABILITY, Constants.PROVIDE_CAPABILITY); + report(message, header.getLineNumber() + 1, CompilerFlags.P_DEPRECATED, PDEMarkerFactory.CAT_DEPRECATION); + } + + } + + private void validateEclipseGenericRequire() { + IHeader header = getHeader(ICoreConstants.ECLIPSE_GENERIC_REQUIRED); + if (header == null) { + return; + } + String message; + if (fOsgiR4 && isCheckDeprecated()) { + message = NLS.bind(PDECoreMessages.BundleErrorReporter_eclipse_genericRequireDeprecated, ICoreConstants.ECLIPSE_GENERIC_REQUIRED, Constants.REQUIRE_CAPABILITY); + report(message, header.getLineNumber() + 1, CompilerFlags.P_DEPRECATED, PDEMarkerFactory.CAT_DEPRECATION); + } + + } + private void validateBundleActivator() { IHeader header = getHeader(Constants.BUNDLE_ACTIVATOR); if (header == null) diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/pderesources.properties b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/pderesources.properties index a08f996..84636ee 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/pderesources.properties +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/pderesources.properties @@ -187,6 +187,8 @@ BundleTextChangeListener_editNames_modify=Modify "{0}" header BundleErrorReporter_invalidFilterSyntax=Platform filter syntax is invalid BundleErrorReporter_reqExecEnv_conflict=The JRE container on the classpath is not a perfect match to the ''{0}'' execution environment BundleErrorReporter_importexport_servicesDeprecated=''{0}'' header is deprecated, use the runtime facilities instead of the manifest for service declaration +BundleErrorReporter_eclipse_genericCapabilityDeprecated=''{0}'' header is deprecated; use ''{1}''. +BundleErrorReporter_eclipse_genericRequireDeprecated=''{0}'' header is deprecated; use ''{1}''. BundleErrorReporter_unecessaryDependencyDueToFragmentHost=The ''{0}'' dependency is not necessary as it is already specified in Fragment-Host header BundleErrorReporter_localization_properties_file_not_exist=no valid properties files exist in the localization directory specified BundleErrorReporter_illegalManifestVersion=The bundle manifest version is invalid. Valid ranges are 1-2. |

