View | Details | Raw Unified | Return to bug 181210 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/core/PDECoreMessages.java (-1 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2010 IBM Corporation and others.
2
 * Copyright (c) 2005, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 187-192 Link Here
187
	public static String BundleErrorReporter_InvalidFormatInBundleVersion;
187
	public static String BundleErrorReporter_InvalidFormatInBundleVersion;
188
	public static String BundleErrorReporter_NotExistInProject;
188
	public static String BundleErrorReporter_NotExistInProject;
189
	public static String BundleErrorReporter_BundleRangeInvalidInBundleVersion;
189
	public static String BundleErrorReporter_BundleRangeInvalidInBundleVersion;
190
	public static String BundleErrorReporter_R4SyntaxInR3Bundle;
190
191
191
	public static String BundleErrorReporter_invalidVersionRangeFormat;
192
	public static String BundleErrorReporter_invalidVersionRangeFormat;
192
	public static String BundleErrorReporter_NotExistPDE;
193
	public static String BundleErrorReporter_NotExistPDE;
(-)src/org/eclipse/pde/internal/core/pderesources.properties (+1 lines)
Lines 176-181 Link Here
176
BundleErrorReporter_unsatisfiedConstraint=Unsatisfied constraint: ''{0}''
176
BundleErrorReporter_unsatisfiedConstraint=Unsatisfied constraint: ''{0}''
177
BundleErrorReporter_noExecutionEnvironmentSet=No required execution environment has been set
177
BundleErrorReporter_noExecutionEnvironmentSet=No required execution environment has been set
178
BundleErrorReporter_MissingVersion=''{0}'' is missing version constraint information
178
BundleErrorReporter_MissingVersion=''{0}'' is missing version constraint information
179
BundleErrorReporter_R4SyntaxInR3Bundle=The ''{0}'' header requires ''Bundle-ManifestVersion: 2''
179
BundleTextChangeListener_editNames_newLine=Add a new line at the end of the file
180
BundleTextChangeListener_editNames_newLine=Add a new line at the end of the file
180
BundleTextChangeListener_editNames_remove=Remove "{0}" header
181
BundleTextChangeListener_editNames_remove=Remove "{0}" header
181
BundleTextChangeListener_editNames_insert=Insert "{0}" header
182
BundleTextChangeListener_editNames_insert=Insert "{0}" header
(-)src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java (+22 lines)
Lines 151-156 Link Here
151
		validatePluginId(header, id);
151
		validatePluginId(header, id);
152
		validateSingleton(header, elements[0]);
152
		validateSingleton(header, elements[0]);
153
153
154
		// Header introduced in OSGi R4 - warn if R3 manifest
155
		if (!fOsgiR4)
156
			report(NLS.bind(PDECoreMessages.BundleErrorReporter_R4SyntaxInR3Bundle, Constants.BUNDLE_SYMBOLICNAME), header.getLineNumber() + 1, CompilerFlags.WARNING, PDEMarkerFactory.M_R4_SYNTAX_IN_R3_BUNDLE, PDEMarkerFactory.CAT_OTHER);
157
154
		return true;
158
		return true;
155
	}
159
	}
156
160
Lines 230-235 Link Here
230
			return;
234
			return;
231
		}
235
		}
232
236
237
		// Header introduced in OSGi R4 - warn if R3 manifest
238
		if (!fOsgiR4)
239
			report(NLS.bind(PDECoreMessages.BundleErrorReporter_R4SyntaxInR3Bundle,Constants.FRAGMENT_HOST), header.getLineNumber() + 1, CompilerFlags.WARNING, PDEMarkerFactory.M_R4_SYNTAX_IN_R3_BUNDLE, PDEMarkerFactory.CAT_OTHER);
240
233
		if (!isCheckUnresolvedImports())
241
		if (!isCheckUnresolvedImports())
234
			return;
242
			return;
235
243
Lines 550-555 Link Here
550
				}
558
				}
551
			}
559
			}
552
		}
560
		}
561
562
		// Header introduced in OSGi R4 - warn if R3 manifest
563
		if (!fOsgiR4)
564
			report(NLS.bind(PDECoreMessages.BundleErrorReporter_R4SyntaxInR3Bundle, Constants.REQUIRE_BUNDLE), header.getLineNumber() + 1, CompilerFlags.WARNING, PDEMarkerFactory.M_R4_SYNTAX_IN_R3_BUNDLE, PDEMarkerFactory.CAT_OTHER);
565
553
	}
566
	}
554
567
555
	private void validateBundleVersionAttribute(IHeader header, ManifestElement element) {
568
	private void validateBundleVersionAttribute(IHeader header, ManifestElement element) {
Lines 966-971 Link Here
966
		int severity = CompilerFlags.getFlag(fProject, CompilerFlags.P_DEPRECATED);
979
		int severity = CompilerFlags.getFlag(fProject, CompilerFlags.P_DEPRECATED);
967
		if (header == null)
980
		if (header == null)
968
			return;
981
			return;
982
983
		// Header introduced in OSGi R4 - warn if R3 manifest
984
		if (!fOsgiR4)
985
			report(NLS.bind(PDECoreMessages.BundleErrorReporter_R4SyntaxInR3Bundle, Constants.BUNDLE_ACTIVATIONPOLICY), header.getLineNumber() + 1, CompilerFlags.WARNING, PDEMarkerFactory.M_R4_SYNTAX_IN_R3_BUNDLE, PDEMarkerFactory.CAT_OTHER);
986
969
		if (TargetPlatformHelper.getTargetVersion() >= 3.3) {
987
		if (TargetPlatformHelper.getTargetVersion() >= 3.3) {
970
			validateHeaderValue(header, new String[] {Constants.ACTIVATION_LAZY});
988
			validateHeaderValue(header, new String[] {Constants.ACTIVATION_LAZY});
971
		} else if (severity != CompilerFlags.IGNORE && !containsValidActivationHeader()) {
989
		} else if (severity != CompilerFlags.IGNORE && !containsValidActivationHeader()) {
Lines 1130-1135 Link Here
1130
			location = new String();
1148
			location = new String();
1131
		}
1149
		}
1132
1150
1151
		// Header introduced in OSGi R4 - warn if R3 manifest
1152
		if (!fOsgiR4)
1153
			report(NLS.bind(PDECoreMessages.BundleErrorReporter_R4SyntaxInR3Bundle, Constants.BUNDLE_LOCALIZATION), header.getLineNumber() + 1, CompilerFlags.WARNING, PDEMarkerFactory.M_R4_SYNTAX_IN_R3_BUNDLE, PDEMarkerFactory.CAT_OTHER);
1154
1133
		IResource res = PDEProject.getBundleRoot(fProject).findMember(location);
1155
		IResource res = PDEProject.getBundleRoot(fProject).findMember(location);
1134
		if (res == null || !(res instanceof IContainer)) {
1156
		if (res == null || !(res instanceof IContainer)) {
1135
			report(PDECoreMessages.BundleErrorReporter_localization_folder_not_exist, header.getLineNumber() + 1, CompilerFlags.getFlag(fProject, CompilerFlags.P_UNKNOWN_RESOURCE), PDEMarkerFactory.CAT_OTHER);
1157
			report(PDECoreMessages.BundleErrorReporter_localization_folder_not_exist, header.getLineNumber() + 1, CompilerFlags.getFlag(fProject, CompilerFlags.P_UNKNOWN_RESOURCE), PDEMarkerFactory.CAT_OTHER);
(-)src/org/eclipse/pde/internal/core/builders/PDEMarkerFactory.java (+1 lines)
Lines 48-53 Link Here
48
	public static final int M_LAZYLOADING_HAS_NO_EFFECT = 0x1022; //other problem
48
	public static final int M_LAZYLOADING_HAS_NO_EFFECT = 0x1022; //other problem
49
	public static final int M_DISCOURAGED_CLASS = 0x1023; //other problem
49
	public static final int M_DISCOURAGED_CLASS = 0x1023; //other problem
50
	public static final int M_NO_LINE_TERMINATION = 0x1024; // fatal problem
50
	public static final int M_NO_LINE_TERMINATION = 0x1024; // fatal problem
51
	public static final int M_R4_SYNTAX_IN_R3_BUNDLE = 0x1025; // other problem
51
52
52
	// build properties fixes
53
	// build properties fixes
53
	public static final int B_APPEND_SLASH_FOLDER_ENTRY = 0x2001;
54
	public static final int B_APPEND_SLASH_FOLDER_ENTRY = 0x2001;
(-)src/org/eclipse/pde/internal/ui/PDEUIMessages.java (+3 lines)
Lines 2944-2949 Link Here
2944
	public static String AddExportPackageResolution_Label;
2944
	public static String AddExportPackageResolution_Label;
2945
	public static String AddBundleClassPathResolution_add;
2945
	public static String AddBundleClassPathResolution_add;
2946
2946
2947
	public static String AddBundleManifestVersionResolution_description;
2948
	public static String AddBundleManifestVersionResolution_label;
2949
2947
	public static String AddToJavaSearchJob_0;
2950
	public static String AddToJavaSearchJob_0;
2948
2951
2949
	public static String AntGeneratingExportWizard_0;
2952
	public static String AntGeneratingExportWizard_0;
(-)src/org/eclipse/pde/internal/ui/correction/AddBundleManifestVersionResolution.java (+40 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.pde.internal.ui.correction;
12
13
import org.eclipse.pde.internal.core.text.bundle.BundleModel;
14
import org.eclipse.pde.internal.ui.PDEUIMessages;
15
import org.osgi.framework.Constants;
16
17
/**
18
 * Resolution to add the Bundle-ManifestVersion header to the manifest.  Will set the manifest
19
 * version to 2 to support OSGi R4 headers.
20
 */
21
public class AddBundleManifestVersionResolution extends AbstractManifestMarkerResolution {
22
	
23
	public AddBundleManifestVersionResolution() {
24
		super(AbstractPDEMarkerResolution.CREATE_TYPE);
25
	}
26
27
	public String getLabel() {
28
		return PDEUIMessages.AddBundleManifestVersionResolution_label;
29
	}
30
31
	public String getDescription() {
32
		return PDEUIMessages.AddBundleManifestVersionResolution_description;
33
	}
34
35
	protected void createChange(BundleModel model) {
36
		// Add the Bundle-ManifestVersion header.
37
		model.getBundle().setHeader(Constants.BUNDLE_MANIFESTVERSION, String.valueOf(2));
38
	}
39
40
}
(-)src/org/eclipse/pde/internal/ui/correction/ResolutionGenerator.java (+2 lines)
Lines 110-115 Link Here
110
					return new IMarkerResolution[] {new NoLineTerminationResolution(AbstractPDEMarkerResolution.CREATE_TYPE)};
110
					return new IMarkerResolution[] {new NoLineTerminationResolution(AbstractPDEMarkerResolution.CREATE_TYPE)};
111
				}
111
				}
112
				return new IMarkerResolution[] {new NoLineTerminationResolution(AbstractPDEMarkerResolution.REMOVE_TYPE)};
112
				return new IMarkerResolution[] {new NoLineTerminationResolution(AbstractPDEMarkerResolution.REMOVE_TYPE)};
113
			case PDEMarkerFactory.M_R4_SYNTAX_IN_R3_BUNDLE :
114
				return new IMarkerResolution[] {new AddBundleManifestVersionResolution()};
113
		}
115
		}
114
		return NO_RESOLUTIONS;
116
		return NO_RESOLUTIONS;
115
	}
117
	}
(-)src/org/eclipse/pde/internal/ui/pderesources.properties (+2 lines)
Lines 2126-2131 Link Here
2126
OptionalImportPkgResolution_label=Mark package ''{0}'' as an optional imported package
2126
OptionalImportPkgResolution_label=Mark package ''{0}'' as an optional imported package
2127
OptionalRequireBundleResolution_description=Mark bundle ''{0}'' as optional
2127
OptionalRequireBundleResolution_description=Mark bundle ''{0}'' as optional
2128
OptionalRequireBundleResolution_label=Mark bundle ''{0}'' as optional
2128
OptionalRequireBundleResolution_label=Mark bundle ''{0}'' as optional
2129
AddBundleManifestVersionResolution_description=Adds the ''Bundle-ManifestVersion: 2'' header to support OSGi R4 headers
2130
AddBundleManifestVersionResolution_label=Add the ''Bundle-ManifestVersion: 2'' header
2129
OrganizeManifestJob_taskName=Organizing Manifest Headers...
2131
OrganizeManifestJob_taskName=Organizing Manifest Headers...
2130
OrganizeManifestsWizard_title=Organize Manifests Wizard
2132
OrganizeManifestsWizard_title=Organize Manifests Wizard
2131
OrganizeManifestsWizardPage_title=Organize Manifests
2133
OrganizeManifestsWizardPage_title=Organize Manifests

Return to bug 181210