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 |
|