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 79773 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), 13.12 KB, created by
Chris Aniszczyk
on 2007-10-04 16:43:39 EDT
(
hide
)
Description:
org.eclipse.pde.patch
Filename:
MIME Type:
Creator:
Chris Aniszczyk
Created:
2007-10-04 16:43:39 EDT
Size:
13.12 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.ui >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.332 >diff -u -r1.332 PDEUIMessages.java >--- src/org/eclipse/pde/internal/ui/PDEUIMessages.java 2 Oct 2007 20:54:37 -0000 1.332 >+++ src/org/eclipse/pde/internal/ui/PDEUIMessages.java 4 Oct 2007 20:42:38 -0000 >@@ -3047,6 +3047,7 @@ > public static String PDEJavaHelper_msgContentAssistAvailable; > > public static String AddExportPackageResolution_Label; >+ public static String AddBundleClassPathResolution_add; > > // target provisioning stuff > public static String UpdateSiteDownloader_message; >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.930 >diff -u -r1.930 pderesources.properties >--- src/org/eclipse/pde/internal/ui/pderesources.properties 2 Oct 2007 20:54:36 -0000 1.930 >+++ src/org/eclipse/pde/internal/ui/pderesources.properties 4 Oct 2007 20:42:39 -0000 >@@ -2398,3 +2398,4 @@ > 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 >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.30 >diff -u -r1.30 ResolutionGenerator.java >--- src/org/eclipse/pde/internal/ui/correction/ResolutionGenerator.java 24 Sep 2007 12:12:32 -0000 1.30 >+++ src/org/eclipse/pde/internal/ui/correction/ResolutionGenerator.java 4 Oct 2007 20:42:39 -0000 >@@ -94,6 +94,8 @@ > return new IMarkerResolution[] {new RenameProvidePackageResolution(AbstractPDEMarkerResolution.RENAME_TYPE)}; > case PDEMarkerFactory.M_EXECUTION_ENVIRONMENT_NOT_SET: > return new IMarkerResolution[] { new AddDefaultExecutionEnvironmentResolution(AbstractPDEMarkerResolution.CREATE_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/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,46 @@ >+/******************************************************************************* >+ * 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); >+ else >+ model.getBundle().setHeader(Constants.BUNDLE_CLASSPATH, 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.18 >diff -u -r1.18 PDEMarkerFactory.java >--- src/org/eclipse/pde/internal/core/builders/PDEMarkerFactory.java 24 Sep 2007 12:12:34 -0000 1.18 >+++ src/org/eclipse/pde/internal/core/builders/PDEMarkerFactory.java 4 Oct 2007 20:42:40 -0000 >@@ -43,6 +43,7 @@ > 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_EXECUTION_ENVIRONMENT_NOT_SET = 0x1020; // other problem >+ public static final int M_MISSING_BUNDLE_CLASSPATH_ENTRY = 0x1021; // 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.48 >diff -u -r1.48 BundleErrorReporter.java >--- src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java 28 Sep 2007 22:16:29 -0000 1.48 >+++ src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java 4 Oct 2007 20:42:40 -0000 >@@ -49,6 +49,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; >@@ -59,6 +60,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; >@@ -484,11 +486,64 @@ > > private void validateBundleClasspath() { > IHeader header = getHeader(Constants.BUNDLE_CLASSPATH); >- if (header != null && header.getElements().length == 0) { >- report(PDECoreMessages.BundleErrorReporter_ClasspathNotEmpty, >- header.getLineNumber() + 1, CompilerFlags.ERROR, >- PDEMarkerFactory.CAT_FATAL); >+ if (header != null) { >+ if (header.getElements().length == 0) { >+ report(PDECoreMessages.BundleErrorReporter_ClasspathNotEmpty, >+ header.getLineNumber() + 1, CompilerFlags.ERROR, >+ PDEMarkerFactory.CAT_FATAL); >+ } > } >+ 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 = >+ PDEBuilderHelper.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, sourceEntries.size()); >+ } >+ >+ } >+ } >+ } >+ >+ private void validateMapping(IHeader header, String entry, int sourceEntrySize) { >+ boolean match = false; >+ ManifestElement[] elements = >+ header != null ? header.getElements() : new ManifestElement[0]; >+ for(int i = 0; i < elements.length; i++) { >+ if(entry.equals(elements[i].getValue())) >+ match = true; >+ } >+ // if we have no match, report an error >+ if(!match) { >+ // however, catch the case when we have a source.. entry and no Bundle-ClassPath entry >+ if(entry.equals(".") && sourceEntrySize == 1) //$NON-NLS-1$ >+ return; >+ int line = header != null ? header.getLineNumber() + 1 : 1; >+ IMarker marker = report(PDECoreMessages.BundleErrorReporter_missingClassPathEntries, >+ line, >+ 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) {} >+ } > } > > private void validateRequireBundle(IProgressMonitor monitor) { >Index: src/org/eclipse/pde/internal/core/builders/PDEBuilderHelper.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/PDEBuilderHelper.java,v >retrieving revision 1.1 >diff -u -r1.1 PDEBuilderHelper.java >--- src/org/eclipse/pde/internal/core/builders/PDEBuilderHelper.java 18 Sep 2007 20:56:11 -0000 1.1 >+++ src/org/eclipse/pde/internal/core/builders/PDEBuilderHelper.java 4 Oct 2007 20:42:40 -0000 >@@ -16,7 +16,9 @@ > import org.eclipse.core.resources.IResource; > import org.eclipse.core.runtime.IPath; > import org.eclipse.jdt.core.IClasspathEntry; >+import org.eclipse.pde.core.build.IBuild; > import org.eclipse.pde.core.build.IBuildEntry; >+import org.eclipse.pde.internal.build.IBuildPropertiesConstants; > > public class PDEBuilderHelper { > >@@ -45,5 +47,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(IBuildPropertiesConstants.PROPERTY_SOURCE_PREFIX)) { >+ // splice the entry >+ String entry = >+ name.substring(IBuildPropertiesConstants.PROPERTY_SOURCE_PREFIX.length(), name.length()); >+ sourceEntryKeys.add(entry); >+ } >+ } >+ return sourceEntryKeys; >+ } >+ > > } >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.40 >diff -u -r1.40 PDECoreMessages.java >--- src/org/eclipse/pde/internal/core/PDECoreMessages.java 24 Sep 2007 12:12:34 -0000 1.40 >+++ src/org/eclipse/pde/internal/core/PDECoreMessages.java 4 Oct 2007 20:42:40 -0000 >@@ -183,6 +183,7 @@ > public static String BundleErrorReporter_unecessaryDependencyDueToFragmentHost; > public static String BundleErrorReporter_missingPackagesInProject; > public static String BundleErrorReporter_noExecutionEnvironmentSet; >+ public static String BundleErrorReporter_missingClassPathEntries; > > public static String BundleErrorReporter_startHeader_autoStartDeprecated; > >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.77 >diff -u -r1.77 pderesources.properties >--- src/org/eclipse/pde/internal/core/pderesources.properties 28 Sep 2007 22:16:29 -0000 1.77 >+++ src/org/eclipse/pde/internal/core/pderesources.properties 4 Oct 2007 20:42:40 -0000 >@@ -158,6 +158,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
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