Minify json files and images

This commit is contained in:
Martin Prokoph
2024-08-25 12:52:37 +02:00
parent 8aab796530
commit 64d26e38b5
6 changed files with 12 additions and 1 deletions

View File

@@ -1,3 +1,6 @@
import groovy.json.JsonSlurper
import groovy.json.JsonOutput
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false
@@ -58,6 +61,14 @@ allprojects {
return changes.toString()
}
}
processResources {
// Minify json resources
doLast {
fileTree(dir: outputs.files.asPath, include: "**/*.json").each {
File file -> file.text = JsonOutput.toJson(new JsonSlurper().parse(file))
}
}
}
java {
withSourcesJar()