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 + } }