Skip to content

Conversation

@ktoso
Copy link
Collaborator

@ktoso ktoso commented Nov 18, 2024

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.

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.
@ktoso ktoso changed the title [WIP] towards making jars with dylibs Sample for making jars with dylibs Nov 19, 2024
@ktoso ktoso merged commit 82b5e60 into swiftlang:main Nov 19, 2024
12 checks passed
@ktoso ktoso deleted the wip-jar-project branch November 19, 2024 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant