Skip to content

Commit

Permalink
[PDE-Build] Always use the OSGi profiles provided by the runtime bundle
Browse files Browse the repository at this point in the history
The code in PDE(-build) usually only matches respectively is adapted to
content of the profiles provided by the org.eclipse.osgi bundle of the
same release and not necessarily of previous or even future releases.
For example with [1] PDE-build now relies on the system.packages
provided by the JRE-1.1 profile in o.e.osgi since this release.
Of course these profiles are missing in previous versions of o.e.osgi.
This causes errors during PDE's product export if an earlier version of
o.e.osgi is in the target-platform because the system.packages for the
JRE-1.1 are then null/empty.

[1] - eclipse-pde#1239
  • Loading branch information
HannesWell authored and fedejeanne committed Jul 31, 2024
1 parent 29af22d commit ec73ea2
Showing 1 changed file with 1 addition and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -823,13 +823,6 @@ public void cleanupOriginalState() {
state.resolve();
}

private File getOSGiLocation() {
BundleDescription osgiBundle = state.getBundle(BUNDLE_OSGI, null);
if (osgiBundle == null)
return null;
return new File(osgiBundle.getLocation());
}

private String[] getJavaProfiles() {
return getProfileManager().getJavaProfiles();
}
Expand Down Expand Up @@ -884,20 +877,7 @@ public void setEESources(String[] eeSources) {

public ProfileManager getProfileManager() {
if (profileManager == null) {
File osgi = getOSGiLocation();
String[] sources = null;
if (osgi != null) {
if (eeSources != null) {
sources = new String[eeSources.length + 1];
sources[0] = osgi.getAbsolutePath();
System.arraycopy(eeSources, 0, sources, 1, eeSources.length);
} else {
sources = new String[] {osgi.getAbsolutePath()};
}
profileManager = new ProfileManager(sources, false);
} else {
profileManager = new ProfileManager(eeSources, true);
}
profileManager = new ProfileManager(eeSources, true);
}
return profileManager;
}
Expand Down

0 comments on commit ec73ea2

Please sign in to comment.