From 170c7e26bf50ad41a2a83b7594939098b56e8110 Mon Sep 17 00:00:00 2001 From: sky Date: Thu, 8 Jul 2021 01:09:24 +0800 Subject: [PATCH] + update custom description node --- .../izzel/taboolib/gradle/Description.groovy | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/main/groovy/io/izzel/taboolib/gradle/Description.groovy b/src/main/groovy/io/izzel/taboolib/gradle/Description.groovy index 947d837..aa4ae47 100644 --- a/src/main/groovy/io/izzel/taboolib/gradle/Description.groovy +++ b/src/main/groovy/io/izzel/taboolib/gradle/Description.groovy @@ -22,6 +22,7 @@ class Description { def libraries def dependencies def requiredMods = "spongeapi@7.2.0" + def custom = new HashMap() static List buildFile() { def str = [] @@ -68,6 +69,13 @@ class Description { appendNameList(str, softdepend, "softdepend") appendNameList(str, loadbefore, "loadbefore") appendNameList(str, libraries, "libraries") + custom.entrySet().each { + if (it.value instanceof List) { + appendNameList(str, it.value, it.key) + } else { + appendName(str, it.value, it.key) + } + } return str.join("\n").getBytes(StandardCharsets.UTF_8) } @@ -80,6 +88,13 @@ class Description { appendNameList(str, depend, "depends") appendNameList(str, softdepend, "softDepends") appendNameList(str, libraries, "libraries") + custom.entrySet().each { + if (it.value instanceof List) { + appendNameList(str, it.value, it.key) + } else { + appendName(str, it.value, it.key) + } + } return str.join("\n").getBytes(StandardCharsets.UTF_8) } @@ -99,6 +114,13 @@ class Description { appendNameList(str, softdepend, "softdepend") appendNameList(str, loadbefore, "loadbefore") appendNameList(str, libraries, "libraries") + custom.entrySet().each { + if (it.value instanceof List) { + appendNameList(str, it.value, it.key) + } else { + appendName(str, it.value, it.key) + } + } return str.join("\n").getBytes(StandardCharsets.UTF_8) } @@ -237,4 +259,8 @@ class Description { def requiredMods(requiredMods) { this.requiredMods = requiredMods } + + def custom(String key, value) { + this.custom[key] = value + } }