From dfd255f7081e425178d0a30a64efd5cd5bbf7d9d Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Thu, 8 Feb 2024 10:34:07 +0000 Subject: [PATCH] Minor cleanup in metadataTask --- data/build.gradle | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/data/build.gradle b/data/build.gradle index dd02d562..a1e3b469 100644 --- a/data/build.gradle +++ b/data/build.gradle @@ -43,7 +43,6 @@ variants.each { variant -> // Depend on langTask and the following properties dependsOn langTask inputs.properties( - mod_id: rootProject.name, version: project.mod_version, authors: project.authors, licence: project.licence, @@ -63,15 +62,14 @@ variants.each { variant -> // Declare task outputs so they can be used by other tasks outputs.dir outputDir - def overrides = new TreeMap() - overrides.mod_id = inputs.properties.mod_id.toLowerCase() - overrides.json_authors = inputs.properties.authors.split(',').collect { "\"$it\"" }.join(", ") - // Need to do this at execution time; - // langTask won't have built anything at configuration time... + // LangTask.getTranslation() can't be used at configuration time... doLast { - overrides.name = langTask.get().getTranslation("freecam.name") - overrides.description = langTask.get().getTranslation("freecam.description") + def values = new TreeMap(inputs.properties) + values.mod_id = rootProject.name.toLowerCase() + values.name = langTask.get().getTranslation("freecam.name") + values.description = langTask.get().getTranslation("freecam.description") + values.json_authors = values.authors.split(',').collect { "\"$it\"" }.join(", ") copy { // Include files under `src/platform` @@ -79,11 +77,11 @@ variants.each { variant -> into outputDir filesMatching("fabric.mod.json") { - expand inputs.properties + overrides + expand values } filesMatching("META-INF/mods.toml") { - expand inputs.properties + overrides + expand values } } }