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

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/core/MinimalState.java (-2 / +10 lines)
Lines 61-73 Link Here
61
61
62
	private boolean fNoProfile;
62
	private boolean fNoProfile;
63
63
64
	private static final String SYSTEM_BUNDLE = "org.eclipse.osgi"; //$NON-NLS-1$
64
	private static final String DEFAULT_SYSTEM_BUNDLE = "org.eclipse.osgi"; //$NON-NLS-1$
65
65
66
	protected static boolean DEBUG = false;
66
	protected static boolean DEBUG = false;
67
67
68
	protected static StateObjectFactory stateObjectFactory;
68
	protected static StateObjectFactory stateObjectFactory;
69
69
70
	protected static String DIR;
70
	protected static String DIR;
71
	
72
	protected String fSystemBundle = DEFAULT_SYSTEM_BUNDLE;
71
73
72
	static {
74
	static {
73
		DEBUG = PDECore.getDefault().isDebugging()
75
		DEBUG = PDECore.getDefault().isDebugging()
Lines 84-89 Link Here
84
		this.fEEListChanged = state.fEEListChanged;
86
		this.fEEListChanged = state.fEEListChanged;
85
		this.fExecutionEnvironments = state.fExecutionEnvironments;
87
		this.fExecutionEnvironments = state.fExecutionEnvironments;
86
		this.fNoProfile = state.fNoProfile;
88
		this.fNoProfile = state.fNoProfile;
89
		this.fSystemBundle = state.fSystemBundle;
87
	}
90
	}
88
	
91
	
89
	protected MinimalState() {		
92
	protected MinimalState() {		
Lines 155-165 Link Here
155
						"Error parsing plug-in manifest file at " + bundleLocation.toString(), null)); //$NON-NLS-1$
158
						"Error parsing plug-in manifest file at " + bundleLocation.toString(), null)); //$NON-NLS-1$
156
		}
159
		}
157
		BundleDescription desc = addBundle(manifest, bundleLocation, bundleId);
160
		BundleDescription desc = addBundle(manifest, bundleLocation, bundleId);
158
		if (desc != null && SYSTEM_BUNDLE.equals(desc.getSymbolicName())) {
161
		if (desc != null && "true".equals(manifest.get("Eclipse-SystemBundle"))) {
159
			// if this is the system bundle then 
162
			// if this is the system bundle then 
160
			// indicate that the javaProfile has changed since the new system
163
			// indicate that the javaProfile has changed since the new system
161
			// bundle may not contain profiles for all EE's in the list
164
			// bundle may not contain profiles for all EE's in the list
162
			fEEListChanged = true;
165
			fEEListChanged = true;
166
			fSystemBundle = desc.getSymbolicName();
163
		}
167
		}
164
		if (desc != null) {
168
		if (desc != null) {
165
			addAuxiliaryData(desc, manifest, hasBundleStructure);
169
			addAuxiliaryData(desc, manifest, hasBundleStructure);
Lines 346-350 Link Here
346
			return constraint.getName();
350
			return constraint.getName();
347
		return constraint.getName() + '_' + versionRange;
351
		return constraint.getName() + '_' + versionRange;
348
	}
352
	}
353
	
354
	public String getSystemBundle() {
355
		return fSystemBundle;
356
	}
349
357
350
}
358
}
(-)src/org/eclipse/pde/internal/core/PDEState.java (+3 lines)
Lines 140-145 Link Here
140
			resolveState(false);
140
			resolveState(false);
141
			saveState(dir);
141
			saveState(dir);
142
		} else {
142
		} else {
143
			// get the system bundle from the State
144
			if (fState.getPlatformProperties() != null && fState.getPlatformProperties().length > 0)
145
				fSystemBundle = (String) fState.getPlatformProperties()[0].get("system.bundle");
143
			boolean propertiesChanged = initializePlatformProperties();
146
			boolean propertiesChanged = initializePlatformProperties();
144
			fState.setResolver(Platform.getPlatformAdmin().getResolver());
147
			fState.setResolver(Platform.getPlatformAdmin().getResolver());
145
			if (propertiesChanged)
148
			if (propertiesChanged)
(-)src/org/eclipse/pde/internal/core/ClasspathHelper.java (-1 / +1 lines)
Lines 253-259 Link Here
253
		IPluginLibrary[] libraries = base.getLibraries();
253
		IPluginLibrary[] libraries = base.getLibraries();
254
 		try {
254
 		try {
255
 			if (project.hasNature(JavaCore.NATURE_ID)) {
255
 			if (project.hasNature(JavaCore.NATURE_ID)) {
256
 				Map classpathMap = getClasspathMap(project, checkExcluded, !base.getId().equals("org.eclipse.osgi"), false); //$NON-NLS-1$
256
 				Map classpathMap = getClasspathMap(project, checkExcluded, !base.getId().equals(PDECore.getDefault().getModelManager().getState().getSystemBundle()), false); //$NON-NLS-1$
257
 				IFile file = project.getFile("build.properties"); //$NON-NLS-1$
257
 				IFile file = project.getFile("build.properties"); //$NON-NLS-1$
258
 				boolean searchBuild = file.exists();
258
 				boolean searchBuild = file.exists();
259
 				if (searchBuild) {
259
 				if (searchBuild) {
(-)src/org/eclipse/pde/internal/core/PluginModelManager.java (-1 / +1 lines)
Lines 647-653 Link Here
647
	 */
647
	 */
648
	public ModelEntry findEntry(String id) {
648
	public ModelEntry findEntry(String id) {
649
		if ("system.bundle".equals(id)) //$NON-NLS-1$
649
		if ("system.bundle".equals(id)) //$NON-NLS-1$
650
			id = "org.eclipse.osgi";  //$NON-NLS-1$
650
			id = getState().getSystemBundle();
651
		return id == null ? null : (ModelEntry)getEntryTable().get(id);
651
		return id == null ? null : (ModelEntry)getEntryTable().get(id);
652
	}
652
	}
653
653
(-)src/org/eclipse/pde/internal/core/TargetPlatformHelper.java (-8 / +14 lines)
Lines 50-57 Link Here
50
50
51
public class TargetPlatformHelper {
51
public class TargetPlatformHelper {
52
	
52
	
53
	private static final String SYSTEM_BUNDLE = "org.eclipse.osgi"; //$NON-NLS-1$
54
	
55
	private static String REFERENCE_PREFIX = "reference:"; //$NON-NLS-1$
53
	private static String REFERENCE_PREFIX = "reference:"; //$NON-NLS-1$
56
	private static String FILE_URL_PREFIX = "file:"; //$NON-NLS-1$
54
	private static String FILE_URL_PREFIX = "file:"; //$NON-NLS-1$
57
55
Lines 225-240 Link Here
225
		return result;
223
		return result;
226
	}
224
	}
227
	
225
	
226
	private static Dictionary getTargetEnvironment(MinimalState state) {
227
		Dictionary result = getTargetEnvironment();
228
		result.put("system.bundle", state.getSystemBundle());
229
		return result;
230
	}
231
	
228
	public static Dictionary[] getPlatformProperties(String[] profiles, MinimalState state) {
232
	public static Dictionary[] getPlatformProperties(String[] profiles, MinimalState state) {
229
		if (profiles == null || profiles.length == 0)
233
		if (profiles == null || profiles.length == 0)
230
			return new Dictionary[] {getTargetEnvironment()};
234
			return new Dictionary[] {getTargetEnvironment(state)};
231
		
235
		
232
		// add java profiles for those EE's that have a .profile file in the current system bundle
236
		// add java profiles for those EE's that have a .profile file in the current system bundle
233
		ArrayList result = new ArrayList(profiles.length);
237
		ArrayList result = new ArrayList(profiles.length);
234
		for (int i = 0; i < profiles.length; i++) {
238
		for (int i = 0; i < profiles.length; i++) {
235
			Properties profileProps = getJavaProfileProperties(profiles[i], state.getState());
239
			Properties profileProps = getJavaProfileProperties(profiles[i], state.getSystemBundle(), state.getState());
236
			if (profileProps != null) {
240
			if (profileProps != null) {
237
				Dictionary props = TargetPlatformHelper.getTargetEnvironment();
241
				Dictionary props = TargetPlatformHelper.getTargetEnvironment(state);
238
				String systemPackages = profileProps.getProperty(Constants.FRAMEWORK_SYSTEMPACKAGES);
242
				String systemPackages = profileProps.getProperty(Constants.FRAMEWORK_SYSTEMPACKAGES);
239
				if (systemPackages != null)
243
				if (systemPackages != null)
240
					props.put(Constants.FRAMEWORK_SYSTEMPACKAGES, systemPackages);
244
					props.put(Constants.FRAMEWORK_SYSTEMPACKAGES, systemPackages);
Lines 246-256 Link Here
246
		}
250
		}
247
		if (result.size() > 0)
251
		if (result.size() > 0)
248
			return (Dictionary[])result.toArray(new Dictionary[result.size()]);
252
			return (Dictionary[])result.toArray(new Dictionary[result.size()]);
249
		return new Dictionary[] {TargetPlatformHelper.getTargetEnvironment()};
253
		return new Dictionary[] {TargetPlatformHelper.getTargetEnvironment(state)};
250
	}
254
	}
251
	
255
	
252
	private static Properties getJavaProfileProperties(String ee, State state) {
256
	// We need system bundle passed here, because we are building the properties to be passed to
253
		BundleDescription osgiBundle = state.getBundle(SYSTEM_BUNDLE, null);
257
	// the State - it doesn't know which is the system bundle yet.
258
	private static Properties getJavaProfileProperties(String ee, String systemBundle, State state) {
259
		BundleDescription osgiBundle = state.getBundle(systemBundle, null);
254
		if (osgiBundle == null) 
260
		if (osgiBundle == null) 
255
			return null;
261
			return null;
256
		
262
		

Return to bug 195281