Skip to content

Sample for making jars with dylibs #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 19, 2024
Merged

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