Use bundled plugin config.yml as canonical resource #4

Merged
NotAlexNoyle merged 1 commits from codex/use-existing-config-in-plugin-jar into master 2026-03-23 13:32:15 -04:00
NotAlexNoyle commented 2026-03-23 13:32:00 -04:00 (Migrated from github.com)

Motivation

  • Stop generating defaults at runtime and treat the checked-in config.yml as the canonical plugin configuration that should be shaded into the plugin JAR and copied to the data folder on first run.

Description

  • Add src/resources as a resources source set in eternalcombat-plugin/build.gradle.kts so eternalcombat-plugin/src/resources/config.yml is packaged into the plugin artifact.
  • Change startup in CombatPlugin to copy the bundled config.yml into the plugin data folder with saveResource("config.yml", false) when the file is missing and then load that file via ConfigService.
  • Remove saveDefaults() from ConfigService.create(...) so the Okaeri loader does not create or overwrite defaults and the checked-in file remains the source of truth.

Testing

  • Ran git diff --check successfully after the changes.
  • Attempted to run ./gradlew :eternalcombat-plugin:shadowJar (and :processResources) but the Gradle build could not complete in this environment due to a Java toolchain requirement for Java 17 (environment has Java 25), so packaging could not be validated here.

Codex Task

### Motivation - Stop generating defaults at runtime and treat the checked-in `config.yml` as the canonical plugin configuration that should be shaded into the plugin JAR and copied to the data folder on first run. ### Description - Add `src/resources` as a resources source set in `eternalcombat-plugin/build.gradle.kts` so `eternalcombat-plugin/src/resources/config.yml` is packaged into the plugin artifact. - Change startup in `CombatPlugin` to copy the bundled `config.yml` into the plugin data folder with `saveResource("config.yml", false)` when the file is missing and then load that file via `ConfigService`. - Remove `saveDefaults()` from `ConfigService.create(...)` so the Okaeri loader does not create or overwrite defaults and the checked-in file remains the source of truth. ### Testing - Ran `git diff --check` successfully after the changes. - Attempted to run `./gradlew :eternalcombat-plugin:shadowJar` (and `:processResources`) but the Gradle build could not complete in this environment due to a Java toolchain requirement for Java 17 (environment has Java 25), so packaging could not be validated here. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69c177ae0544832f9ee8dd0cf268e867)
Sign in to join this conversation.