Skip to content
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

Redesign jextract-swift: plugins and avoid custom swift features #170

Merged
merged 8 commits into from
Nov 14, 2024

Conversation

ktoso
Copy link
Collaborator

@ktoso ktoso commented Nov 9, 2024

Redesign jextract-swift: plugins and avoid custom swift features

We now heavily rely on Swift thunk generation and call into those C
calling convention compatible APIs from Java. They translate into member
calls on classes -- this way we'll be able to also do structs and other
things.

This also introduces gradle to "drive" the swift package jextract
plugin. This allows us for samples to be a plain ./gradlew run,
and no more manual running of any make or other swift interface
generation steps etc.

This is a big milestone towards getting "just works" builds with the
jextract route.

Follow ups will handle more java library path handling and more types of
calls we can make, like variables, and importing structs etc.

@ktoso ktoso changed the title JExtract as a build plugin, remove need for manual jextract-generate JExtract as a build plugin, remove need for nightly toolchains and manual jextract-generate Nov 9, 2024
@ktoso ktoso marked this pull request as draft November 9, 2024 01:40
@ktoso ktoso force-pushed the wip-jextract-plugin branch 25 times, most recently from 654d0a2 to dc0a2c3 Compare November 13, 2024 03:57
@ktoso ktoso marked this pull request as ready for review November 14, 2024 10:14
@ktoso ktoso force-pushed the wip-jextract-plugin branch from cd67ec6 to 358bc50 Compare November 14, 2024 13:28
We now heavily rely on Swift thunk generation and call into those C
calling convention compatible APIs from Java. They translate into member
calls on classes -- this way we'll be able to also do structs and other
things.

This also introduces gradle to "drive" the `swift package jextract`
plugin. This allows us for samples to be a plain `./gradlew run`,
and no more manual running of any make or other swift interface
generation steps etc.

This is a big milestone towards getting "just works" builds with the
jextract route.

Follow ups will handle more java library path handling and more types of
calls we can make, like variables, and importing structs etc.
working on samples validation

fixed name deduplication logic
Change how we do static initialization, to automatically load library as we first use a class from it!

rename verify step

fix variable import test for new scheme

gitignore .d and similar files

split out samples into separate job

ci: reorganize jobs

include objc workaround for linux

dont rebuild twice to get better output

build dependency fixes in gradle: depend on SwiftKit as well

lib paths: workaround for swiftly installed 6.0.2 lib path

ignore .idea directory
Correct reference counting in init thunk

lots of fixing around how we deal with config and library loading

move trace functions into SwiftKit; avoid regenerating

adjust swift source gen tests
@ktoso ktoso force-pushed the wip-jextract-plugin branch from 7def075 to 7df2a33 Compare November 14, 2024 13:57
@ktoso ktoso changed the title JExtract as a build plugin, remove need for nightly toolchains and manual jextract-generate Redesign jextract-swift: plugins and avoid custom swift features Nov 14, 2024
@ktoso ktoso merged commit 0c57644 into main Nov 14, 2024
12 checks passed
@ktoso ktoso deleted the wip-jextract-plugin branch November 14, 2024 14:13
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