Skip to content

Publish JExtract-generated source code alongside compiled bindings#2

Merged
Thihup merged 3 commits intomainfrom
copilot/publish-source-code-jextract
Jan 16, 2026
Merged

Publish JExtract-generated source code alongside compiled bindings#2
Thihup merged 3 commits intomainfrom
copilot/publish-source-code-jextract

Conversation

Copy link
Copy Markdown

Copilot AI commented Jan 16, 2026

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:

  • Added sourcesJar task to package generated code from build/bindings/
  • Included sources JAR in Maven publication artifacts
  • Updated bindings task to output both JARs

GitHub Actions workflow:

  • Modified artifact upload to include webgpu-sources.jar alongside webgpu.jar

Result

Both GitHub Actions artifacts and Maven publications now include:

  • webgpu.jar - compiled bindings
  • webgpu-sources.jar - generated source code
Original prompt

publish the source code generate by the JExtract both in upload-action and publish-action


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Publish source code generated by JExtract Publish JExtract-generated source code alongside compiled bindings Jan 16, 2026
Copilot AI requested a review from Thihup January 16, 2026 12:06
@Thihup Thihup marked this pull request as ready for review January 16, 2026 12:06
Copilot AI review requested due to automatic review settings January 16, 2026 12:06
@Thihup Thihup merged commit 48b9c36 into main Jan 16, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 sourcesJar task to package generated Java sources from build/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")
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
artifact file("build/webgpu.jar")
artifact jar

Copilot uses AI. Check for mistakes.
task sourcesJar(type: Jar, dependsOn: jextract) {
archiveBaseName = 'webgpu'
archiveClassifier = 'sources'
from 'build/bindings'
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
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.

3 participants