File tree Expand file tree Collapse file tree 2 files changed +4
-22
lines changed
src/main/java/org/algo4j/util Expand file tree Collapse file tree 2 files changed +4
-22
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,9 @@ machine:
55
66dependencies :
77 pre :
8- - chmod a+x gradlew
98 - cmake jni
109 override :
11- - ./ gradlew dependencies
10+ - bash gradlew dependencies
1211 - cmake --build . --target all -- -j 8
1312#
1413
1716 - if [ -e ./gradlew ]; then ./gradlew jacocoTestReport;else gradle jacocoTestReport;fi
1817 - bash <(curl -s https://codecov.io/bash)
1918 override :
20- - ./ gradlew check --info
19+ - bash gradlew check --info
2120#
2221
2322general :
Original file line number Diff line number Diff line change 11package org .algo4j .util ;
22
3- import org .jetbrains .annotations .Contract ;
4- import org .jetbrains .annotations .NonNls ;
53import org .jetbrains .annotations .NotNull ;
64
75import java .io .File ;
1412 */
1513@ SuppressWarnings ("WeakerAccess" )
1614public final class Loader {
17- public final static String JNI_LIB_NAME ;
15+ public final static @ NotNull String JNI_LIB_NAME ;
1816private static boolean loaded = false ;
1917
2018/*
@@ -25,24 +23,9 @@ public final class Loader {
2523loadJni ();
2624}
2725
28- @ NotNull
29- @ Contract (pure = true )
30- private static String libraryName (@ NonNls @ NotNull String libName ) {
31- String ___ = System .getProperty ("os.name" );
32- String fileName ;
33- if (___ .contains ("Linux" ))
34- fileName = libName + ".so" ;
35- else if (___ .contains ("Windows" ))
36- fileName = libName + ".dll" ;
37- else // if (___.contains("OSX"))
38- fileName = libName + ".dylib" ;
39- // else fileName = libName;
40- return new File (fileName ).getAbsolutePath ();
41- }
42-
4326public static void loadJni () {
4427if (!loaded ) {
45- System .load (libraryName ( JNI_LIB_NAME ));
28+ System .load (new File ( System . mapLibraryName ( JNI_LIB_NAME )). getAbsolutePath ( ));
4629loaded = true ;
4730}
4831}
You can’t perform that action at this time.
0 commit comments