Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 77412 Details for
Bug 198724
Raise warning when . is not on bundle-classpath and there are source folders
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
org.eclipse.pde.patch
clipboard.txt (text/plain), 11.94 KB, created by
Chris Aniszczyk
on 2007-08-30 16:46:05 EDT
(
hide
)
Description:
org.eclipse.pde.patch
Filename:
MIME Type:
Creator:
Chris Aniszczyk
Created:
2007-08-30 16:46:05 EDT
Size:
11.94 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/correction/ResolutionGenerator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ResolutionGenerator.java,v >retrieving revision 1.29 >diff -u -r1.29 ResolutionGenerator.java >--- src/org/eclipse/pde/internal/ui/correction/ResolutionGenerator.java 26 Jul 2007 18:59:09 -0000 1.29 >+++ src/org/eclipse/pde/internal/ui/correction/ResolutionGenerator.java 30 Aug 2007 20:47:01 -0000 >@@ -91,6 +91,8 @@ > new ChooseClassXMLResolution(AbstractPDEMarkerResolution.RENAME_TYPE, marker)}; > case PDEMarkerFactory.M_DEPRECATED_PROVIDE_PACKAGE: > return new IMarkerResolution[] {new RenameProvidePackageResolution(AbstractPDEMarkerResolution.RENAME_TYPE)}; >+ case PDEMarkerFactory.M_MISSING_BUNDLE_CLASSPATH_ENTRY: >+ return new IMarkerResolution[] {new AddBundleClassPathMarkerResolution(AbstractPDEMarkerResolution.CREATE_TYPE, marker.getAttribute("entry", null))}; //$NON-NLS-1$) > } > return NO_RESOLUTIONS; > } >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.917 >diff -u -r1.917 pderesources.properties >--- src/org/eclipse/pde/internal/ui/pderesources.properties 29 Aug 2007 15:29:34 -0000 1.917 >+++ src/org/eclipse/pde/internal/ui/pderesources.properties 30 Aug 2007 20:47:01 -0000 >@@ -2366,3 +2366,5 @@ > StateViewPage_showOnlyUnresolved_label=Show only unresolved plug-ins > StateViewPage_focusActionDescription=Focus on selected item > SchemaPreviewLauncher_msgEditorHasUnsavedChanges=Open schema editor has unsaved changes >+ >+AddBundleClassPathResolution_add=Add ''{0}'' to the bundle classpath >\ No newline at end of file >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.319 >diff -u -r1.319 PDEUIMessages.java >--- src/org/eclipse/pde/internal/ui/PDEUIMessages.java 28 Aug 2007 22:05:14 -0000 1.319 >+++ src/org/eclipse/pde/internal/ui/PDEUIMessages.java 30 Aug 2007 20:46:59 -0000 >@@ -3002,5 +3002,5 @@ > public static String UpdateSiteProvisionerDialog_siteLocation; > public static String UpdateSiteProvisionerDialog_missBothErrorMessage; > >- >+ public static String AddBundleClassPathResolution_add; > } >\ No newline at end of file >Index: src/org/eclipse/pde/internal/ui/correction/AddBundleClassPathMarkerResolution.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/ui/correction/AddBundleClassPathMarkerResolution.java >diff -N src/org/eclipse/pde/internal/ui/correction/AddBundleClassPathMarkerResolution.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/ui/correction/AddBundleClassPathMarkerResolution.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,44 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.pde.internal.ui.correction; >+ >+import org.eclipse.osgi.util.NLS; >+import org.eclipse.pde.internal.core.ibundle.IBundle; >+import org.eclipse.pde.internal.core.text.bundle.Bundle; >+import org.eclipse.pde.internal.core.text.bundle.BundleClasspathHeader; >+import org.eclipse.pde.internal.core.text.bundle.BundleModel; >+import org.eclipse.pde.internal.ui.PDEUIMessages; >+import org.osgi.framework.Constants; >+ >+public class AddBundleClassPathMarkerResolution extends >+AbstractManifestMarkerResolution { >+ >+ private String fValue; >+ >+ public AddBundleClassPathMarkerResolution(int type, String value) { >+ super(type); >+ this.fValue = value; >+ } >+ >+ public String getLabel() { >+ return NLS.bind(PDEUIMessages.AddBundleClassPathResolution_add, fValue); >+ } >+ >+ protected void createChange(BundleModel model) { >+ IBundle bundle = model.getBundle(); >+ if (bundle instanceof Bundle) { >+ BundleClasspathHeader header = (BundleClasspathHeader)bundle.getManifestHeader(Constants.BUNDLE_CLASSPATH); >+ if (header != null) >+ header.addLibrary(fValue); >+ } >+ } >+ >+} >#P org.eclipse.pde.core >Index: src/org/eclipse/pde/internal/core/builders/PDEMarkerFactory.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/PDEMarkerFactory.java,v >retrieving revision 1.17 >diff -u -r1.17 PDEMarkerFactory.java >--- src/org/eclipse/pde/internal/core/builders/PDEMarkerFactory.java 26 Jul 2007 18:59:10 -0000 1.17 >+++ src/org/eclipse/pde/internal/core/builders/PDEMarkerFactory.java 30 Aug 2007 20:47:02 -0000 >@@ -41,6 +41,7 @@ > public static final int M_UNECESSARY_DEP = 0x1017; // other problem > public static final int M_MISSING_EXPORT_PKGS = 0x1018; // other problem > public static final int M_DEPRECATED_PROVIDE_PACKAGE = 0x1019; // deprecation >+ public static final int M_MISSING_BUNDLE_CLASSPATH_ENTRY = 0x1020; // fatal problem > > // build properties fixes > public static final int B_APPEND_SLASH_FOLDER_ENTRY = 0x2001; >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.45 >diff -u -r1.45 BundleErrorReporter.java >--- src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java 7 Aug 2007 19:07:15 -0000 1.45 >+++ src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java 30 Aug 2007 20:47:02 -0000 >@@ -48,6 +48,7 @@ > import org.eclipse.osgi.service.resolver.VersionRange; > import org.eclipse.osgi.util.ManifestElement; > import org.eclipse.osgi.util.NLS; >+import org.eclipse.pde.core.build.IBuild; > import org.eclipse.pde.core.plugin.IFragmentModel; > import org.eclipse.pde.core.plugin.IPluginBase; > import org.eclipse.pde.core.plugin.IPluginModelBase; >@@ -58,6 +59,7 @@ > import org.eclipse.pde.internal.core.PDECore; > import org.eclipse.pde.internal.core.PDECoreMessages; > import org.eclipse.pde.internal.core.TargetPlatformHelper; >+import org.eclipse.pde.internal.core.build.WorkspaceBuildModel; > import org.eclipse.pde.internal.core.ibundle.IBundle; > import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase; > import org.eclipse.pde.internal.core.ibundle.IManifestHeader; >@@ -475,6 +477,52 @@ > report(PDECoreMessages.BundleErrorReporter_ClasspathNotEmpty, > header.getLineNumber() + 1, CompilerFlags.ERROR, > PDEMarkerFactory.CAT_FATAL); >+ } else { >+ validateBundleClasspathMappings(header); >+ } >+ } >+ >+ private void validateBundleClasspathMappings(IHeader header) { >+ IFile buildProperties = fProject.getFile("build.properties"); //$NON-NLS-1$ >+ if(buildProperties != null && buildProperties.exists()) { >+ WorkspaceBuildModel wbm = >+ new WorkspaceBuildModel(buildProperties); >+ wbm.load(); >+ if (!wbm.isLoaded()) >+ return; >+ >+ IBuild build = wbm.getBuild(); >+ if(build != null) { >+ ArrayList sourceEntries = >+ BuildErrorReporter.getSourceEntries(build); >+ // verify classpath entry <-> source entry mappings >+ for(int i = 0; i < sourceEntries.size(); i++) { >+ String entry = (String) sourceEntries.get(i); >+ validateMapping(header, entry); >+ } >+ >+ } >+ } >+ } >+ >+ private void validateMapping(IHeader header, String entry) { >+ boolean match = false; >+ ManifestElement[] elements = header.getElements(); >+ for(int i = 0; i < elements.length; i++) { >+ if(entry.equals(elements[i].getValue())) >+ match = true; >+ } >+ if(!match) { // report error >+ IMarker marker = report(PDECoreMessages.BundleErrorReporter_missingClassPathEntries, >+ header.getLineNumber() + 1, >+ CompilerFlags.ERROR, >+ PDEMarkerFactory.M_MISSING_BUNDLE_CLASSPATH_ENTRY, >+ PDEMarkerFactory.CAT_FATAL); >+ try { >+ if (marker != null) { >+ marker.setAttribute("entry", entry); //$NON-NLS-1$ >+ } >+ } catch (CoreException e) {} > } > } > >Index: src/org/eclipse/pde/internal/core/builders/BuildErrorReporter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/BuildErrorReporter.java,v >retrieving revision 1.29 >diff -u -r1.29 BuildErrorReporter.java >--- src/org/eclipse/pde/internal/core/builders/BuildErrorReporter.java 5 Aug 2007 20:06:15 -0000 1.29 >+++ src/org/eclipse/pde/internal/core/builders/BuildErrorReporter.java 30 Aug 2007 20:47:02 -0000 >@@ -488,6 +488,21 @@ > } > return unlisted; > } >+ >+ public static ArrayList getSourceEntries(IBuild build) { >+ ArrayList sourceEntryKeys = new ArrayList(); >+ IBuildEntry[] entries = build.getBuildEntries(); >+ for (int i = 0; i < entries.length; i++) { >+ String name = entries[i].getName(); >+ if (name.startsWith(PROPERTY_SOURCE_PREFIX)) { >+ // splice the entry >+ int index = name.indexOf('.'); >+ String entry = name.substring(index + 1, name.length()); >+ sourceEntryKeys.add(entry); >+ } >+ } >+ return sourceEntryKeys; >+ } > > private void validateIncludes(IBuildEntry includes, ArrayList sourceIncludes) { > if (includes == null) >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.75 >diff -u -r1.75 pderesources.properties >--- src/org/eclipse/pde/internal/core/pderesources.properties 28 Aug 2007 19:16:46 -0000 1.75 >+++ src/org/eclipse/pde/internal/core/pderesources.properties 30 Aug 2007 20:47:02 -0000 >@@ -157,6 +157,7 @@ > 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. >+BundleErrorReporter_missingClassPathEntries=There is a mismatch between the bundle classpath and build.properties > > ManifestConsistencyChecker_projectCheck=static project references may interfere with the correct dynamic build order of plug-in projects > ManifestConsistencyChecker_buildPropertiesSubtask=Verifying build.properties >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.39 >diff -u -r1.39 PDECoreMessages.java >--- src/org/eclipse/pde/internal/core/PDECoreMessages.java 28 Aug 2007 19:16:46 -0000 1.39 >+++ src/org/eclipse/pde/internal/core/PDECoreMessages.java 30 Aug 2007 20:47:02 -0000 >@@ -182,6 +182,7 @@ > public static String BundleErrorReporter_importexport_servicesDeprecated; > public static String BundleErrorReporter_unecessaryDependencyDueToFragmentHost; > public static String BundleErrorReporter_missingPackagesInProject; >+ public static String BundleErrorReporter_missingClassPathEntries; > > public static String BundleErrorReporter_startHeader_autoStartDeprecated;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 198724
:
75402
| 77412 |
77413
|
77420
|
78216
|
79773
|
79774