From e76ec74c858e52f568154a4a4aa3def2dab0d320 Mon Sep 17 00:00:00 2001 From: Kli Kli Date: Wed, 21 Aug 2024 11:42:50 +0200 Subject: [PATCH] chore: ensure mod_version in resource files is not cached --- build.gradle | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 52259b7a..f7fca86c 100644 --- a/build.gradle +++ b/build.gradle @@ -173,9 +173,19 @@ dependencies { } processResources { + def props = new HashMap<>(project.properties) + def keys = new ArrayList(props.keySet()) //to avoid concurrent modification exception + + for (String key : keys) { + if (!(props.get(key) instanceof String) && !(props.get(key) instanceof Integer)) { + props.remove(key) + } + } + filesMatching(['META-INF/neoforge.mods.toml']) { - expand project.properties + expand props } + getInputs().properties(props) } // Example for how to get properties into the manifest for reading at runtime.