Skip to content

Commit

Permalink
rm processresources
Browse files Browse the repository at this point in the history
  • Loading branch information
eerussianguy committed Aug 22, 2024
1 parent 4ae158d commit 2308d52
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -93,31 +93,8 @@ neoForge {

tasks {
processResources {
if (modIsInCI) {
doLast {
val jsonMinifyStart: Long = System.currentTimeMillis()
var jsonMinified: Long = 0
var jsonBytesBefore: Long = 0
var jsonBytesAfter: Long = 0

fileTree(mapOf("dir" to outputs.files.asPath, "include" to "**/*.json")).forEach {
jsonMinified++
jsonBytesBefore += it.length()
try {
it.writeText(JsonOutput.toJson(JsonSlurper().parse(it)).replace("\"__comment__\":\"This file was automatically created by mcresources\",", ""))
} catch (e: Exception) {
println("JSON Error in ${it.path}")
throw e
}

jsonBytesAfter += it.length()
}
println("Minified $jsonMinified json files. Reduced ${jsonBytesBefore / 1024} kB to ${(jsonBytesAfter / 1024)} kB. Took ${System.currentTimeMillis() - jsonMinifyStart} ms")
}
}
}


jar {
manifest {
attributes["Implementation-Version"] = project.version
Expand Down

0 comments on commit 2308d52

Please sign in to comment.