Skip to content

Publish JExtract-generated source code alongside compiled bindings - #2

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

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

Conversation

CopilotAI commented Jan 16, 2026

Copy link
Copy Markdown

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.

CopilotAIand others added 2 commits January 16, 2026 12:01
Co-authored-by: Thihup <13357965+Thihup@users.noreply.github.com>
Co-authored-by: Thihup <13357965+Thihup@users.noreply.github.com>
CopilotAI changed the title [WIP] Publish source code generated by JExtractPublish JExtract-generated source code alongside compiled bindingsJan 16, 2026
CopilotAI requested a review from ThihupJanuary 16, 2026 12:06
@Thihup
Thihup marked this pull request as ready for review January 16, 2026 12:06
CopilotAI review requested due to automatic review settings January 16, 2026 12:06
@Thihup
Thihup merged commit 48b9c36 into mainJan 16, 2026

CopilotAI left a comment

Copy link
Copy Markdown

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.

FileDescription
lib/build.gradleAdded sourcesJar task and updated bindings task and Maven publication to include sources
.github/workflows/build-and-publish-bindings.ymlModified artifact upload step to include webgpu-sources.jar

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadlib/build.gradle
@@ -93,6 +100,7 @@ publishing {
version = "$wgpuVersion"

artifact file("build/webgpu.jar")

CopilotAIJan 16, 2026

Copy link

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.
Comment threadlib/build.gradle
task sourcesJar(type: Jar, dependsOn: jextract) {
archiveBaseName = 'webgpu'
archiveClassifier = 'sources'
from 'build/bindings'

CopilotAIJan 16, 2026

Copy link

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 freeto 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

@Thihup