From fbe4427dcae3b70c478de235c9c9fbca217319d6 Mon Sep 17 00:00:00 2001 From: bombcar Date: Mon, 8 Jan 2024 13:23:32 -0600 Subject: [PATCH] Correctly store the OC version in the config file (#114) * fix extraneous @VERSION@ * don't doublecopy * spotless don't gradle --- addon.gradle | 7 +++++++ src/main/resources/application.conf | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/addon.gradle b/addon.gradle index 507a2ca06d..1f3e4055ae 100644 --- a/addon.gradle +++ b/addon.gradle @@ -1,5 +1,12 @@ +import org.apache.tools.ant.filters.ReplaceTokens + tasks.withType(ScalaCompile) { scalaCompileOptions.forkOptions.with { memoryMaximumSize = '4g' } } +tasks.named("processResources", ProcessResources).configure { + filesMatching("application.conf") { + filter(ReplaceTokens, tokens: [version: project.version]) + } +} diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index 844669cf50..190e0a5596 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -7,7 +7,7 @@ opencomputers { # The version of OC this config was generated by. This is used to allow the # mod to reset parts of the config when their meaning changed across # versions, so that the user does not have to delete it. - version: "@VERSION@" + version: "@version@" # Client side settings, presentation and performance related stuff. client {