Skip to content

Commit 418c464

Browse files
committed
nna
1 parent e2c3de2 commit 418c464

File tree

4 files changed

+13
-21
lines changed

4 files changed

+13
-21
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66

77
group 'dev.felnull'
88
archivesBaseName = "felnull-java-library"
9-
version '1.27'
9+
version '1.31'
1010

1111
repositories {
1212
mavenCentral()
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package dev.felnull.fnjl;
22

3-
public class BuildIn {
4-
protected static final String VERSION = "1.27";
3+
public class FNJLBuildIn {
4+
protected static final String VERSION = "1.31";
55

66
protected static final int NATIVE_LIB_VERSION = 3;
77
}

src/main/java/dev/felnull/fnjl/FelNullJavaLibrary.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class FelNullJavaLibrary {
1313
* @return FelNullJavaLibraryのバージョン
1414
*/
1515
public static String getVersion() {
16-
return BuildIn.VERSION;
16+
return FNJLBuildIn.VERSION;
1717
}
1818

1919
/**
@@ -22,7 +22,7 @@ public static String getVersion() {
2222
* @return バージョン
2323
*/
2424
public static int getNativeLibVersion() {
25-
return BuildIn.NATIVE_LIB_VERSION;
25+
return FNJLBuildIn.NATIVE_LIB_VERSION;
2626
}
2727

2828
}

src/main/java/dev/felnull/fnjl/jni/NativeLibraryManager.java

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public class NativeLibraryManager {
2121
private static boolean inited;
2222
private static boolean load;
2323
private static Path libraryFolder;
24-
private static String relocatePath;
2524

2625
/**
2726
* JNIライブラリを読み込む
@@ -40,15 +39,6 @@ public static void loadLibrary() {
4039
}
4140
}
4241

43-
/**
44-
* ShadowJarなどでNativeライブラリの場所を変更してる場合に指定
45-
*
46-
* @param relocatePath 移動パス
47-
*/
48-
public static void setRelocatePath(String relocatePath) {
49-
NativeLibraryManager.relocatePath = relocatePath;
50-
}
51-
5242
/**
5343
* 読み込みに失敗したかどうか
5444
*
@@ -101,15 +91,17 @@ private static boolean loadExtractLibrary(OSs.Type os, String aarch) throws IOEx
10191

10292
private static void extractLibrary(OSs.Type os, String aarch) throws IOException {
10393
String libname = "FNJL" + aarch + "." + os.getLibName();
104-
String pp = FelNullJavaLibrary.class.getPackage().getName().replace(".", "/") + "/natives/" + libname;
105-
94+
/* String cn = FelNullJavaLibrary.class.getSimpleName();
95+
String pn = FelNullJavaLibrary.class.getName();
96+
String ppa = pn.substring(0, pn.length() - cn.length() - 1).replace(".", "/");
97+
String pp = ppa + "/natives/" + libname;
98+
*/
99+
String pp = "dev/felnull/fnjl/natives/" + libname;
100+
//dev/felnull/imp/libs/dev/felnull/fnjl/dev/felnull/imp/libs/natives/FNJLx64.dll:
106101
InputStream stream = loadResource(pp);
107102

108-
if (stream == null && relocatePath != null)
109-
stream = loadResource(relocatePath + "/" + pp);
110-
111103
if (stream == null)
112-
throw new IOException("Library does not exist: " + pp + (relocatePath != null ? (" and " + relocatePath + "/" + pp) : ""));
104+
throw new IOException("Library does not exist: " + pp);
113105

114106
String name = "FNJL" + FelNullJavaLibrary.getNativeLibVersion() + aarch + "." + os.getLibName();
115107
Path path = getNativeLibraryFolder().resolve(name);

0 commit comments

Comments
 (0)