Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always use full-named launcher library native fragment on Mac #629

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading