Publish JExtract-generated source code alongside compiled bindings#2
Publish JExtract-generated source code alongside compiled bindings#2
Conversation
Co-authored-by: Thihup <[email protected]>
Co-authored-by: Thihup <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR enables publishing of JExtract-generated source code alongside compiled bindings to improve IDE integration and debugging experience.
Changes:
- Added a
sourcesJartask to package generated Java sources frombuild/bindings/ - Updated Maven publication to include the sources JAR artifact
- Modified GitHub Actions workflow to upload both compiled and source JARs as artifacts
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/build.gradle | Added sourcesJar task and updated bindings task and Maven publication to include sources |
| .github/workflows/build-and-publish-bindings.yml | Modified artifact upload step to include webgpu-sources.jar |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -93,6 +100,7 @@ publishing { | |||
| version = "$wgpuVersion" | |||
|
|
|||
| artifact file("build/webgpu.jar") | |||
There was a problem hiding this comment.
Inconsistent artifact specification in Maven publication. Line 102 uses file() while line 103 directly references the task. For consistency and to follow Gradle best practices, line 102 should directly reference the jar task instead of using file(\"build/webgpu.jar\"), as the build output path is already defined by the jar task configuration.
| artifact file("build/webgpu.jar") | |
| artifact jar |
| task sourcesJar(type: Jar, dependsOn: jextract) { | ||
| archiveBaseName = 'webgpu' | ||
| archiveClassifier = 'sources' | ||
| from 'build/bindings' |
There was a problem hiding this comment.
Hardcoded path instead of using Gradle's file references. Consider using from file('build/bindings') or better yet, referencing the location through a variable or property to make the configuration more explicit and maintainable.
JExtract generates Java source code for WebGPU bindings, but only the compiled JAR was being published. This prevents users from attaching sources in their IDEs and makes debugging harder.
Changes
lib/build.gradle:
sourcesJartask to package generated code frombuild/bindings/bindingstask to output both JARsGitHub Actions workflow:
webgpu-sources.jaralongsidewebgpu.jarResult
Both GitHub Actions artifacts and Maven publications now include:
webgpu.jar- compiled bindingswebgpu-sources.jar- generated source codeOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.