File tree Expand file tree Collapse file tree 5 files changed +8
-1
lines changed
Samples/SwiftAndJavaJarSampleLib Expand file tree Collapse file tree 5 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,9 @@ let package = Package(
6363 . target(
6464 name: " MySwiftLibrary " ,
6565 dependencies: [
66- . product( name: " SwiftRuntimeFunctions " , package : " swift-java " ) ,
66+ . product( name: " SwiftJava " , package : " swift-java " ) ,
67+ . product( name: " CSwiftJavaJNI " , package : " swift-java " ) ,
68+ . product( name: " SwiftRuntimeFunctions " , package : " swift-java " )
6769 ] ,
6870 exclude: [
6971 " swift-java.config " ,
Original file line number Diff line number Diff line change @@ -134,6 +134,8 @@ extension AnyJavaObject {
134134 _ body: ( jclass ) throws -> Result
135135 ) throws -> Result {
136136 let resolvedClass = try classLoader. findClass ( fullJavaClassName)
137+ // OK to force unwrap, as classLoader will throw ClassNotFoundException
138+ // if the class cannot be found.
137139 return try body ( resolvedClass!. javaThis)
138140 }
139141
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ struct JNIEnumTests {
5050 @SuppressWarnings( " unused " )
5151 private static final boolean INITIALIZED_LIBS = initializeLibs();
5252 static boolean initializeLibs() {
53+ System.loadLibrary(SwiftLibraries.LIB_NAME_SWIFT_JAVA);
5354 System.loadLibrary(LIB_NAME);
5455 return true;
5556 }
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ struct JNIModuleTests {
5353 static final String LIB_NAME = " SwiftModule " ;
5454
5555 static {
56+ System.loadLibrary(SwiftLibraries.LIB_NAME_SWIFT_JAVA);
5657 System.loadLibrary(LIB_NAME);
5758 }
5859 """
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ struct JNIStructTests {
5353 @SuppressWarnings( " unused " )
5454 private static final boolean INITIALIZED_LIBS = initializeLibs();
5555 static boolean initializeLibs() {
56+ System.loadLibrary(SwiftLibraries.LIB_NAME_SWIFT_JAVA);
5657 System.loadLibrary(LIB_NAME);
5758 return true;
5859 }
You can’t perform that action at this time.
0 commit comments