swiftlang / swift-java

Apache License 2.0
724 stars 27 forks source link

[WIP] towards making jars with dylibs #180

Open ktoso opened 19 hours ago

ktoso commented 19 hours ago

This allows us to include dylibs in the jar and load them as resources.

This allows us to:

-> % java --enable-native-access=ALL-UNNAMED -cp
../../SwiftKit/build/classes/java/main:./build/libs/swift-and-java-jar-sample-lib-1.0-SNAPSHOT.jar
-Djava.library.path=/usr/lib/swift/ Example.java
[swift][MySwiftLibrary/MySwiftLibrary.swift:27](helloWorld())
helloWorld()

and we can even include the swiftCore libs in the jar to make it really fat and include all swift dependencies. I think we should maybe make that an option in the inevitable gradle plugin we'll need to do here.