-
-
Notifications
You must be signed in to change notification settings - Fork 103
Initial FFI setup #1287
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
tychedelia
merged 6 commits into
processing:the-wgpu-moment
from
tychedelia:1270-ffi-scaffold
Oct 16, 2025
Merged
Initial FFI setup #1287
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
32c31b5
Inital scaffold for libprocessing ffi.
tychedelia a596ad2
Remove EAP.
tychedelia 9ae1d01
Update docs.
tychedelia 8f2542b
Factor out gradle utils. Add flag for disabling webgpu and enforcing …
tychedelia 0078714
Remove processing.h
tychedelia 5662716
Set java version for all projects.
tychedelia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -124,3 +124,5 @@ generated/ | |
| /app/windows/obj | ||
| /java/gradle/build | ||
| /java/gradle/example/.processing | ||
|
|
||
| libProcessing/ffi/include/* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| plugins { | ||
| `kotlin-dsl` | ||
| } | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
| } |
56 changes: 56 additions & 0 deletions
56
buildSrc/src/main/kotlin/processing/gradle/CargoBuildTask.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| package processing.gradle | ||
|
|
||
| import org.gradle.api.DefaultTask | ||
| import org.gradle.api.file.DirectoryProperty | ||
| import org.gradle.api.file.RegularFileProperty | ||
| import org.gradle.api.provider.Property | ||
| import org.gradle.api.tasks.* | ||
| import org.gradle.process.ExecOperations | ||
| import javax.inject.Inject | ||
|
|
||
| abstract class CargoBuildTask : DefaultTask() { | ||
|
|
||
| @get:Inject | ||
| abstract val execOperations: ExecOperations | ||
|
|
||
| @get:InputDirectory | ||
| abstract val cargoWorkspaceDir: DirectoryProperty | ||
|
|
||
| @get:Input | ||
| abstract val manifestPath: Property<String> | ||
|
|
||
| @get:Input | ||
| abstract val release: Property<Boolean> | ||
|
|
||
| @get:Input | ||
| abstract val cargoPath: Property<String> | ||
|
|
||
| @get:OutputFile | ||
| abstract val outputLibrary: RegularFileProperty | ||
|
|
||
| init { | ||
| group = "rust" | ||
| description = "Builds Rust library using cargo" | ||
|
|
||
| // release by default | ||
| release.convention(true) | ||
| } | ||
|
|
||
| @TaskAction | ||
| fun build() { | ||
| val buildType = if (release.get()) "release" else "debug" | ||
| logger.lifecycle("Building Rust library ($buildType mode)...") | ||
|
|
||
| val args = mutableListOf("build") | ||
| if (release.get()) { | ||
| args.add("--release") | ||
| } | ||
| args.add("--manifest-path") | ||
| args.add(manifestPath.get()) | ||
|
|
||
| execOperations.exec { | ||
| workingDir = cargoWorkspaceDir.get().asFile | ||
| commandLine = listOf(cargoPath.get()) + args | ||
| } | ||
| } | ||
| } |
38 changes: 38 additions & 0 deletions
38
buildSrc/src/main/kotlin/processing/gradle/CargoCleanTask.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| package processing.gradle | ||
|
|
||
| import org.gradle.api.DefaultTask | ||
| import org.gradle.api.file.DirectoryProperty | ||
| import org.gradle.api.provider.Property | ||
| import org.gradle.api.tasks.* | ||
| import org.gradle.process.ExecOperations | ||
| import javax.inject.Inject | ||
|
|
||
| abstract class CargoCleanTask : DefaultTask() { | ||
|
|
||
| @get:Inject | ||
| abstract val execOperations: ExecOperations | ||
|
|
||
| @get:InputDirectory | ||
| abstract val cargoWorkspaceDir: DirectoryProperty | ||
|
|
||
| @get:Input | ||
| abstract val manifestPath: Property<String> | ||
|
|
||
| @get:Input | ||
| abstract val cargoPath: Property<String> | ||
|
|
||
| init { | ||
| group = "rust" | ||
| description = "Cleans Rust build artifacts" | ||
| } | ||
|
|
||
| @TaskAction | ||
| fun clean() { | ||
| logger.lifecycle("Cleaning Rust build artifacts...") | ||
|
|
||
| execOperations.exec { | ||
| workingDir = cargoWorkspaceDir.get().asFile | ||
| commandLine(cargoPath.get(), "clean", "--manifest-path", manifestPath.get()) | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a workaround until kotlin
2.3.0is released with jdk 25 support.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we leave a little TODO saying that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's more complicated now as it enforces android source level compat