Fix shaded jar output naming #2

Merged
NotAlexNoyle merged 1 commits from codex/modify-gradle-build-for-shaded-jar into master 2026-03-23 07:00:35 -04:00
NotAlexNoyle commented 2026-03-23 07:00:25 -04:00 (Migrated from github.com)

Motivation

  • Prevent spaces in the plugin shaded JAR filename so downstream tools and uploads don't break due to a space in the artifact name.
  • Ensure the root project copies the actual shaded artifact produced by the plugin subproject instead of relying on a hardcoded file path.

Description

  • Set the plugin shadow task archive name to EternalCombat-${project.version}.jar by updating tasks.shadowJar.archiveFileName in eternalcombat-plugin/build.gradle.kts.
  • Add val pluginShadowJar = project(":eternalcombat-plugin").tasks.named("shadowJar") in the root build.gradle.kts and change the pluginJar Copy task to dependsOn(pluginShadowJar) and from(pluginShadowJar) so it copies the actual task output into build/libs/.
  • Remove the previous hardcoded from(layout.projectDirectory.file("eternalcombat-plugin/build/libs/EternalCombat v${project.version}.jar")) path and the rename step so the output filename matches the shadowed jar.

Testing

  • Ran ./gradlew assemble which failed in this environment because no Java 17 toolchain is available, so the build could not complete (toolchain auto-provisioning not configured).

Codex Task

### Motivation - Prevent spaces in the plugin shaded JAR filename so downstream tools and uploads don't break due to a space in the artifact name. - Ensure the root project copies the actual shaded artifact produced by the plugin subproject instead of relying on a hardcoded file path. ### Description - Set the plugin shadow task archive name to `EternalCombat-${project.version}.jar` by updating `tasks.shadowJar.archiveFileName` in `eternalcombat-plugin/build.gradle.kts`. - Add `val pluginShadowJar = project(":eternalcombat-plugin").tasks.named("shadowJar")` in the root `build.gradle.kts` and change the `pluginJar` `Copy` task to `dependsOn(pluginShadowJar)` and `from(pluginShadowJar)` so it copies the actual task output into `build/libs/`. - Remove the previous hardcoded `from(layout.projectDirectory.file("eternalcombat-plugin/build/libs/EternalCombat v${project.version}.jar"))` path and the `rename` step so the output filename matches the shadowed jar. ### Testing - Ran `./gradlew assemble` which failed in this environment because no Java 17 toolchain is available, so the build could not complete (toolchain auto-provisioning not configured). ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69c11c4ef168832f81cf1d8a44795dd9)
Sign in to join this conversation.