Skip to content

Commit

Permalink
Always use full-named launcher library native fragment on Mac
Browse files Browse the repository at this point in the history
For all supported platforms full-named native launcher fragments exist
with name 'org.eclipse.equinox.launcher.<ws>.<os>.<arch>' for a long
time, even for all architectures supported on mac.

Also remove consideration of old development locations of the launcher
fragments.

This also fixes eclipse-equinox#625
  • Loading branch information
HannesWell committed May 13, 2024
1 parent 99a8578 commit d877e3f
Showing 1 changed file with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
import java.util.Locale;
import java.util.Properties;
import java.util.Set;
import java.util.StringJoiner;
import java.util.StringTokenizer;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
Expand Down Expand Up @@ -447,15 +446,6 @@ private String getArch() {
return name;
}

private String getFragmentString(String fragmentOS, String fragmentWS, String fragmentArch) {
StringJoiner buffer = new StringJoiner("."); //$NON-NLS-1$
buffer.add(PLUGIN_ID).add(fragmentWS).add(fragmentOS);
if (!(fragmentOS.equals(Constants.OS_MACOSX) && !Constants.ARCH_X86_64.equals(fragmentArch))) {
buffer.add(fragmentArch);
}
return buffer.toString();
}

/**
* Sets up the JNI bridge to native calls
*/
Expand All @@ -475,11 +465,8 @@ private void setupJNI(URL[] defaultPath) {
}
if (libPath == null) {
//find our fragment name
String fragmentOS = getOS();
String fragmentWS = getWS();
String fragmentArch = getArch();

libPath = getLibraryPath(getFragmentString(fragmentOS, fragmentWS, fragmentArch), defaultPath);
String fragmentName = String.join(".", PLUGIN_ID, getWS(), getOS(), getArch()); //$NON-NLS-1$
libPath = getLibraryPath(fragmentName, defaultPath);
}
library = libPath;
if (library != null)
Expand Down Expand Up @@ -509,10 +496,6 @@ private String getLibraryPath(String fragmentName, URL[] defaultPath) {
for (int i = urls.length - 1; i >= 0 && libPath == null; i--) {
File entryFile = new File(urls[i].getFile());
String dir = entryFile.getParent();
if (inDevelopmentMode) {
String devDir = dir + "/" + PLUGIN_ID + "/fragments"; //$NON-NLS-1$ //$NON-NLS-2$
fragment = searchFor(fragmentName, devDir);
}
if (fragment == null)
fragment = searchFor(fragmentName, dir);
if (fragment != null)
Expand Down

0 comments on commit d877e3f

Please sign in to comment.