### Eclipse Workspace Patch 1.0 #P org.eclipse.pde.ui Index: src/org/eclipse/pde/internal/ui/pderesources.properties =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/pderesources.properties,v retrieving revision 1.1003 diff -u -r1.1003 pderesources.properties --- src/org/eclipse/pde/internal/ui/pderesources.properties 18 Aug 2008 16:41:00 -0000 1.1003 +++ src/org/eclipse/pde/internal/ui/pderesources.properties 4 Sep 2008 23:09:43 -0000 @@ -7,6 +7,7 @@ # # Contributors: # IBM Corporation - initial API and implementation +# Code 9 Corporation - on going enhancements and maintenance ############################################################################### ##################################### # PDE resource strings @@ -56,6 +57,7 @@ ToggleLinkWithEditorAction_toolTip = Link with Editor ToggleLinkWithEditorAction_description = Link with active editorPDEMultiPageContentOutline.SortingAction.label = Sort PDECompilersConfigurationBlock_general=General +PDECompilersConfigurationBlock_versioning=Versioning PDECompilersConfigurationBlock_references=References PDECompilersConfigurationBlock_setting_changed_project=Compiler settings have changed. A rebuild of the project is required for the changes to take effect.\n\nRebuild {0} now? PDECompilersConfigurationBlock_settings_changed=Settings Changed @@ -1492,6 +1494,10 @@ compilers_p_deprecated = Usage of deprecated attributes and &elements: compilers_p_internal = Usage of internal extension &points: compilers_p_exported_pkgs = Missing exported &packages: +compilers_p_missing_exp_pkg = Missing versions on exported packages: +compilers_p_missing_imp_pkg = Missing versions on imported packages: +compilers_p_missing_require_bundle = Missing versions on required bundles: + compilers_s_create_docs = &Generate reference documentation from schemas compilers_s_doc_folder = Do&cumentation folder: compilers_s_open_tags = &Unmatched tags in documentation: Index: src/org/eclipse/pde/internal/ui/PDEUIMessages.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEUIMessages.java,v retrieving revision 1.380 diff -u -r1.380 PDEUIMessages.java --- src/org/eclipse/pde/internal/ui/PDEUIMessages.java 18 Aug 2008 15:33:31 -0000 1.380 +++ src/org/eclipse/pde/internal/ui/PDEUIMessages.java 4 Sep 2008 23:09:41 -0000 @@ -6,7 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * IBM - Initial API and implementation + * IBM Corporation - initial API and implementation + * Code 9 Corporation - on going enhancements and maintenance *******************************************************************************/ package org.eclipse.pde.internal.ui; @@ -92,15 +93,11 @@ public static String OrganizeManifestsProcessor_rootMessage; public static String PDECompilersConfigurationBlock_general; - + public static String PDECompilersConfigurationBlock_versioning; public static String PDECompilersConfigurationBlock_references; - public static String PDECompilersConfigurationBlock_setting_changed_project; - public static String PDECompilersConfigurationBlock_settings_changed; - public static String PDECompilersConfigurationBlock_settings_changed_all; - public static String PDECompilersConfigurationBlock_usage; public static String PDEWizardNewFileCreationPage_errorMsgStartsWithDot; @@ -1924,6 +1921,9 @@ public static String compilers_p_not_externalized_att; public static String compilers_p_deprecated; public static String compilers_p_internal; + public static String compilers_p_missing_imp_pkg; + public static String compilers_p_missing_exp_pkg; + public static String compilers_p_missing_require_bundle; public static String compilers_s_create_docs; public static String compilers_s_doc_folder; public static String compilers_s_open_tags; Index: src/org/eclipse/pde/internal/ui/preferences/PDECompilersConfigurationBlock.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/PDECompilersConfigurationBlock.java,v retrieving revision 1.7 diff -u -r1.7 PDECompilersConfigurationBlock.java --- src/org/eclipse/pde/internal/ui/preferences/PDECompilersConfigurationBlock.java 26 May 2008 15:46:44 -0000 1.7 +++ src/org/eclipse/pde/internal/ui/preferences/PDECompilersConfigurationBlock.java 4 Sep 2008 23:09:44 -0000 @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Code 9 Corporation - on going enhancements and maintenance *******************************************************************************/ package org.eclipse.pde.internal.ui.preferences; @@ -203,13 +204,19 @@ private static final Key KEY_P_MISSING_EXPORT_PKGS = getPDEPrefKey(CompilerFlags.P_MISSING_EXPORT_PKGS); private static final Key KEY_P_DEPRECATED = getPDEPrefKey(CompilerFlags.P_DEPRECATED); private static final Key KEY_P_INTERNAL = getPDEPrefKey(CompilerFlags.P_INTERNAL); + + // versioning + private static final Key KEY_P_VERSION_EXP_PKG = getPDEPrefKey(CompilerFlags.P_MISSING_VERSION_EXP_PKG); + private static final Key KEY_P_VERSION_IMP_PKG = getPDEPrefKey(CompilerFlags.P_MISSING_VERSION_IMP_PKG); + private static final Key KEY_P_VERSION_REQ_BUNDLE = getPDEPrefKey(CompilerFlags.P_MISSING_VERSION_REQ_BUNDLE); + private static final Key KEY_S_CREATE_DOCS = getPDEPrefKey(CompilerFlags.S_CREATE_DOCS); private static final Key KEY_S_DOC_FOLDER = getPDEPrefKey(CompilerFlags.S_DOC_FOLDER); private static final Key KEY_S_OPEN_TAGS = getPDEPrefKey(CompilerFlags.S_OPEN_TAGS); private static String[] SEVERITIES = {PDEUIMessages.PDECompilersConfigurationBlock_error, PDEUIMessages.PDECompilersConfigurationBlock_warning, PDEUIMessages.PDECompilersConfigurationBlock_ignore}; - private static Key[] fgAllKeys = {KEY_F_UNRESOLVED_FEATURES, KEY_F_UNRESOLVED_PLUGINS, KEY_P_BUILD, KEY_P_INTERNAL, KEY_P_DEPRECATED, KEY_P_DISCOURAGED_CLASS, KEY_P_INCOMPATIBLE_ENV, KEY_P_MISSING_EXPORT_PKGS, KEY_P_NO_REQUIRED_ATT, KEY_P_NOT_EXTERNALIZED, KEY_P_UNKNOWN_ATTRIBUTE, KEY_P_UNKNOWN_CLASS, KEY_P_UNKNOWN_ELEMENT, KEY_P_UNKNOWN_IDENTIFIER, KEY_P_UNKNOWN_RESOURCE, KEY_P_UNRESOLVED_EX_POINTS, KEY_P_UNRESOLVED_IMPORTS, KEY_S_CREATE_DOCS, KEY_S_DOC_FOLDER, KEY_S_OPEN_TAGS}; + private static Key[] fgAllKeys = {KEY_F_UNRESOLVED_FEATURES, KEY_F_UNRESOLVED_PLUGINS, KEY_P_BUILD, KEY_P_INTERNAL, KEY_P_DEPRECATED, KEY_P_DISCOURAGED_CLASS, KEY_P_INCOMPATIBLE_ENV, KEY_P_MISSING_EXPORT_PKGS, KEY_P_NO_REQUIRED_ATT, KEY_P_NOT_EXTERNALIZED, KEY_P_UNKNOWN_ATTRIBUTE, KEY_P_UNKNOWN_CLASS, KEY_P_UNKNOWN_ELEMENT, KEY_P_UNKNOWN_IDENTIFIER, KEY_P_UNKNOWN_RESOURCE, KEY_P_UNRESOLVED_EX_POINTS, KEY_P_UNRESOLVED_IMPORTS, KEY_P_VERSION_EXP_PKG, KEY_P_VERSION_IMP_PKG, KEY_P_VERSION_REQ_BUNDLE, KEY_S_CREATE_DOCS, KEY_S_DOC_FOLDER, KEY_S_OPEN_TAGS}; /** * Constant representing the {@link IDialogSettings} section for this block @@ -495,13 +502,16 @@ ScrolledComposite scomp = createScrolledComposite(parent, 1); Composite sbody = SWTFactory.createComposite(scomp, 1, 1, GridData.FILL_BOTH); scomp.setContent(sbody); - //General + // General Composite client = createExpansibleComposite(sbody, PDEUIMessages.PDECompilersConfigurationBlock_general); initializeComboControls(client, new String[] {PDEUIMessages.compilers_p_no_required_att, PDEUIMessages.CompilersConfigurationTab_buildPropertiesErrors, PDEUIMessages.CompilersConfigurationTab_incompatEnv, PDEUIMessages.compilers_p_exported_pkgs}, new Key[] {KEY_P_NO_REQUIRED_ATT, KEY_P_BUILD, KEY_P_INCOMPATIBLE_ENV, KEY_P_MISSING_EXPORT_PKGS}, CompilerFlags.PLUGIN_FLAGS); - //Usage + // Versioning + client = createExpansibleComposite(sbody, PDEUIMessages.PDECompilersConfigurationBlock_versioning); + initializeComboControls(client, new String[] {PDEUIMessages.compilers_p_missing_require_bundle, PDEUIMessages.compilers_p_missing_exp_pkg, PDEUIMessages.compilers_p_missing_imp_pkg}, new Key[] {KEY_P_VERSION_REQ_BUNDLE, KEY_P_VERSION_EXP_PKG, KEY_P_VERSION_IMP_PKG}, CompilerFlags.PLUGIN_FLAGS); + // Usage client = createExpansibleComposite(sbody, PDEUIMessages.PDECompilersConfigurationBlock_usage); initializeComboControls(client, new String[] {PDEUIMessages.compilers_p_unresolved_import, PDEUIMessages.compilers_p_unresolved_ex_points, PDEUIMessages.compilers_p_internal, PDEUIMessages.compilers_p_deprecated, PDEUIMessages.compilers_p_not_externalized_att}, new Key[] {KEY_P_UNRESOLVED_IMPORTS, KEY_P_UNRESOLVED_EX_POINTS, KEY_P_INTERNAL, KEY_P_DEPRECATED, KEY_P_NOT_EXTERNALIZED}, CompilerFlags.PLUGIN_FLAGS); - //References + // References client = createExpansibleComposite(sbody, PDEUIMessages.PDECompilersConfigurationBlock_references); initializeComboControls(client, new String[] {PDEUIMessages.compilers_p_unknown_element, PDEUIMessages.compilers_p_unknown_attribute, PDEUIMessages.compilers_p_unknown_class, PDEUIMessages.compilers_p_discouraged_class, PDEUIMessages.compilers_p_unknown_resource, PDEUIMessages.compilers_p_unknown_identifier}, new Key[] {KEY_P_UNKNOWN_ELEMENT, KEY_P_UNKNOWN_ATTRIBUTE, KEY_P_UNKNOWN_CLASS, KEY_P_DISCOURAGED_CLASS, KEY_P_UNKNOWN_RESOURCE, KEY_P_UNKNOWN_IDENTIFIER,}, CompilerFlags.PLUGIN_FLAGS); #P org.eclipse.pde.core Index: src/org/eclipse/pde/internal/core/builders/CompilerFlags.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/CompilerFlags.java,v retrieving revision 1.12 diff -u -r1.12 CompilerFlags.java --- src/org/eclipse/pde/internal/core/builders/CompilerFlags.java 15 May 2008 23:20:18 -0000 1.12 +++ src/org/eclipse/pde/internal/core/builders/CompilerFlags.java 4 Sep 2008 23:09:46 -0000 @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Code 9 Corporation - on going enhancements and maintenance *******************************************************************************/ package org.eclipse.pde.internal.core.builders; @@ -58,6 +59,10 @@ public static final String P_DEPRECATED = "compilers.p.deprecated"; //$NON-NLS-1$ public static final String P_INTERNAL = "compilers.p.internal"; //$NON-NLS-1$ + public static final String P_MISSING_VERSION_EXP_PKG = "compilers.p.missing-version-export-package"; //$NON-NLS-1$ + public static final String P_MISSING_VERSION_IMP_PKG = "compilers.p.missing-version-import-package"; //$NON-NLS-1$ + public static final String P_MISSING_VERSION_REQ_BUNDLE = "compilers.p.missing-version-require-bundle"; //$NON-NLS-1$ + /** * schema preferences */ Index: src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java,v retrieving revision 1.66 diff -u -r1.66 BundleErrorReporter.java --- src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java 8 Jul 2008 16:14:52 -0000 1.66 +++ src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java 4 Sep 2008 23:09:46 -0000 @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Code 9 Corporation - on going enhancements and maintenance * Brock Janiczak - bug 169373 * Gary Duprex - bug 150225 * Bartosz Michalik - bug 209432, 214156 @@ -490,6 +491,11 @@ private void validateBundleVersionAttribute(IHeader header, ManifestElement element) { String versionRange = element.getAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE); + int severity = CompilerFlags.getFlag(fProject, CompilerFlags.P_MISSING_VERSION_REQ_BUNDLE); + if (severity != CompilerFlags.IGNORE && versionRange == null) { + report(NLS.bind(PDECoreMessages.BundleErrorReporter_MissingVersion, element.getValue()), getPackageLine(header, element), severity, PDEMarkerFactory.CAT_OTHER); + } + if (versionRange != null && !VersionUtil.validateVersionRange(versionRange).isOK()) { report(NLS.bind(PDECoreMessages.BundleErrorReporter_InvalidFormatInBundleVersion, element.getValue()), getPackageLine(header, element), CompilerFlags.ERROR, PDEMarkerFactory.CAT_FATAL); } @@ -554,7 +560,7 @@ ManifestElement[] elements = header.getElements(); for (int i = 0; i < elements.length; i++) { validateSpecificationVersionAttribute(header, elements[i]); - validateVersionAttribute(header, elements[i], true); + validateImportPackageVersion(header, elements[i]); } return; } @@ -587,11 +593,10 @@ validateSpecificationVersionAttribute(header, elements[i]); validateResolutionDirective(header, elements[i]); + if (!hasUnresolved) continue; - validateVersionAttribute(header, elements[i], true); - int length = elements[i].getValueComponents().length; for (int j = 0; j < length; j++) { ImportPackageSpecification importSpec = imports[index++]; @@ -667,7 +672,7 @@ for (int i = 0; i < elements.length; i++) { checkCanceled(monitor); - validateVersionAttribute(header, elements[i], false); + validateExportPackageVersion(header, elements[i]); validateSpecificationVersionAttribute(header, elements[i]); validateX_InternalDirective(header, elements[i]); validateX_FriendsDirective(header, elements[i]); @@ -798,6 +803,14 @@ return CompilerFlags.getFlag(fProject, CompilerFlags.P_UNRESOLVED_IMPORTS) != CompilerFlags.IGNORE; } + protected boolean isCheckMissingExportPackageVersion() { + return CompilerFlags.getFlag(fProject, CompilerFlags.P_MISSING_VERSION_EXP_PKG) != CompilerFlags.IGNORE; + } + + protected boolean isCheckMissingImportPackageVersion() { + return CompilerFlags.getFlag(fProject, CompilerFlags.P_MISSING_VERSION_IMP_PKG) != CompilerFlags.IGNORE; + } + private void validateTranslatableHeaders() { int severity = CompilerFlags.getFlag(fProject, CompilerFlags.P_NOT_EXTERNALIZED); if (severity == CompilerFlags.IGNORE) @@ -831,13 +844,31 @@ } } + private void validateImportPackageVersion(IHeader header, ManifestElement element) { + String version = element.getAttribute(Constants.VERSION_ATTRIBUTE); + int severity = CompilerFlags.getFlag(fProject, CompilerFlags.P_MISSING_VERSION_IMP_PKG); + if (severity != CompilerFlags.IGNORE && version == null) { + report(NLS.bind(PDECoreMessages.BundleErrorReporter_MissingVersion, element.getValue()), getPackageLine(header, element), severity, PDEMarkerFactory.CAT_OTHER); + } + validateVersionAttribute(header, element, true); + } + + private void validateExportPackageVersion(IHeader header, ManifestElement element) { + String version = element.getAttribute(Constants.VERSION_ATTRIBUTE); + int severity = CompilerFlags.getFlag(fProject, CompilerFlags.P_MISSING_VERSION_EXP_PKG); + if (severity != CompilerFlags.IGNORE && version == null) { + report(NLS.bind(PDECoreMessages.BundleErrorReporter_MissingVersion, element.getValue()), getPackageLine(header, element), severity, PDEMarkerFactory.CAT_OTHER); + } + validateVersionAttribute(header, element, false); + } + private void validateVersionAttribute(IHeader header, ManifestElement element, boolean range) { String version = element.getAttribute(Constants.VERSION_ATTRIBUTE); - if (version == null) - return; - IStatus status = range ? VersionUtil.validateVersionRange(version) : VersionUtil.validateVersion(version); - if (!status.isOK()) { - report(status.getMessage(), getPackageLine(header, element), CompilerFlags.ERROR, PDEMarkerFactory.CAT_FATAL); + if (version != null) { + IStatus status = range ? VersionUtil.validateVersionRange(version) : VersionUtil.validateVersion(version); + if (!status.isOK()) { + report(status.getMessage(), getPackageLine(header, element), CompilerFlags.ERROR, PDEMarkerFactory.CAT_FATAL); + } } } Index: src/org/eclipse/pde/internal/core/pderesources.properties =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/pderesources.properties,v retrieving revision 1.97 diff -u -r1.97 pderesources.properties --- src/org/eclipse/pde/internal/core/pderesources.properties 8 Jul 2008 16:53:29 -0000 1.97 +++ src/org/eclipse/pde/internal/core/pderesources.properties 4 Sep 2008 23:09:45 -0000 @@ -135,6 +135,7 @@ BundleErrorReporter_NoExist=The type ''{0}'' is not on the plug-in classpath BundleErrorReporter_startHeader_autoStartDeprecated=The ''{0}'' header is deprecated, use ''{1}'' BundleErrorReporter_InvalidFormatInBundleVersion=The specified version does not have the correct format (major.minor.micro.qualifier) or contains invalid characters +BundleErrorReporter_MissingVersion=''{0}'' is missing version constraint information BundleErrorReporter_NotExistInProject=Package ''{0}'' does not exist in this plug-in BundleErrorReporter_missingPackagesInProject=This plug-in does not export all of its packages BundleErrorReporter_BundleRangeInvalidInBundleVersion=Unsatisfied version constraint: ''{0}'' Index: src/org/eclipse/pde/internal/core/PDECoreMessages.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECoreMessages.java,v retrieving revision 1.55 diff -u -r1.55 PDECoreMessages.java --- src/org/eclipse/pde/internal/core/PDECoreMessages.java 8 Jul 2008 16:53:29 -0000 1.55 +++ src/org/eclipse/pde/internal/core/PDECoreMessages.java 4 Sep 2008 23:09:45 -0000 @@ -6,7 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * IBM - Initial API and implementation + * IBM Corporation - initial API and implementation + * Code 9 Corporation - on going enhancements and maintenance *******************************************************************************/ package org.eclipse.pde.internal.core; @@ -22,26 +23,17 @@ public static String BuildErrorReporter_cannotFindJar; public static String BundleErrorReporter_badFilter; - public static String BundleErrorReporter_bundleActivationPolicy_unsupported; - public static String BundleErrorReporter_localization_folder_not_exist; - public static String BundleErrorReporter_localization_properties_file_not_exist; - public static String BundleErrorReporter_providePackageHeaderDeprecated; - public static String BundleErrorReporter_reqExecEnv_conflict; - public static String BundleErrorReporter_reqExecEnv_unknown; - public static String BundleErrorReporter_unresolvedExporter; - public static String BundleErrorReporter_unresolvedHost; - public static String BundleErrorReporter_unsatisfiedConstraint; - public static String BundleErrorReporter_unsupportedSingletonDirective; + public static String BundleErrorReporter_MissingVersion; public static String BundleTextChangeListener_editNames_insert; Index: src/org/eclipse/pde/internal/core/PreferenceInitializer.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PreferenceInitializer.java,v retrieving revision 1.9 diff -u -r1.9 PreferenceInitializer.java --- src/org/eclipse/pde/internal/core/PreferenceInitializer.java 7 May 2008 15:50:52 -0000 1.9 +++ src/org/eclipse/pde/internal/core/PreferenceInitializer.java 4 Sep 2008 23:09:45 -0000 @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Code 9 Corporation - on going enhancements and maintenance *******************************************************************************/ package org.eclipse.pde.internal.core; @@ -60,6 +61,9 @@ prefs.putInt(CompilerFlags.P_BUILD, CompilerFlags.WARNING); prefs.putInt(CompilerFlags.P_INCOMPATIBLE_ENV, CompilerFlags.WARNING); prefs.putInt(CompilerFlags.P_MISSING_EXPORT_PKGS, CompilerFlags.IGNORE); + prefs.putInt(CompilerFlags.P_MISSING_VERSION_EXP_PKG, CompilerFlags.IGNORE); + prefs.putInt(CompilerFlags.P_MISSING_VERSION_IMP_PKG, CompilerFlags.IGNORE); + prefs.putInt(CompilerFlags.P_MISSING_VERSION_REQ_BUNDLE, CompilerFlags.IGNORE); prefs.putBoolean(CompilerFlags.S_CREATE_DOCS, false); prefs.put(CompilerFlags.S_DOC_FOLDER, "doc"); //$NON-NLS-1$