Disable plain Gradle jar so only shaded plugin jar is produced #4

Merged
NotAlexNoyle merged 1 commits from codex/prevent-generation-of-oldcombatmechanics.jar into master 2026-03-23 05:52:55 -04:00
NotAlexNoyle commented 2026-03-23 05:52:17 -04:00 (Migrated from github.com)

Motivation

  • Prevent Gradle from emitting an unshaded plugin jar (OldCombatMechanics-<version>.jar) which does not contain shaded dependencies and risks being mistaken for the distributable artefact.
  • Ensure the build produces the single shaded plugin artefact build/libs/OldCombatMechanics.jar from the ShadowJar task.

Description

  • Disabled the plain Gradle jar task by setting tasks.named<Jar>("jar") { enabled = false } in build.gradle.kts so it no longer produces the unshaded jar.
  • Kept the shadowJar configuration as the sole assembled plugin artefact and ensured assemble depends on shadowJar so the shaded OldCombatMechanics.jar remains the output.
  • Updated AGENTS.md to document the packaging change so repository notes reflect that only the shaded jar is produced.

Testing

  • Ran ./gradlew -q -I /tmp/print-task-state.init.gradle.kts help to inspect task state, which printed jar.enabled=false and shadowJar.enabled=true, confirming the task disable took effect. (success)
  • Attempted ./gradlew clean assemble to build the artefact but the run failed in this environment because no Java 17 toolchain installation was available for Gradle to use; the change itself does not depend on that toolchain and is ready for CI/maintainer verification. (environment failure)

Codex Task

### Motivation - Prevent Gradle from emitting an unshaded plugin jar (`OldCombatMechanics-<version>.jar`) which does not contain shaded dependencies and risks being mistaken for the distributable artefact. - Ensure the build produces the single shaded plugin artefact `build/libs/OldCombatMechanics.jar` from the ShadowJar task. ### Description - Disabled the plain Gradle `jar` task by setting `tasks.named<Jar>("jar") { enabled = false }` in `build.gradle.kts` so it no longer produces the unshaded jar. - Kept the `shadowJar` configuration as the sole assembled plugin artefact and ensured `assemble` depends on `shadowJar` so the shaded `OldCombatMechanics.jar` remains the output. - Updated `AGENTS.md` to document the packaging change so repository notes reflect that only the shaded jar is produced. ### Testing - Ran `./gradlew -q -I /tmp/print-task-state.init.gradle.kts help` to inspect task state, which printed `jar.enabled=false` and `shadowJar.enabled=true`, confirming the task disable took effect. (success) - Attempted `./gradlew clean assemble` to build the artefact but the run failed in this environment because no Java 17 toolchain installation was available for Gradle to use; the change itself does not depend on that toolchain and is ready for CI/maintainer verification. (environment failure) ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69c10c0f51e0832f9ab0ad5cd866ead2)
Sign in to join this conversation.