Optimize the shrinked jars and obfuscate them

This commit is contained in:
Username404-59 2021-04-14 18:05:20 +02:00
parent 3af606ce79
commit f8ddd825ac
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 8 additions and 3 deletions

View File

@ -33,13 +33,18 @@ subprojects {
val shrinkJar = register("shrinkJar", proguard.gradle.ProGuardTask::class) {
injars(this@tasks.getByName("remapJar"))
outjars("$rootDir/shrinkedJars/")
keep("class fr.username404.snowygui.** { * ; }")
keep("class fr.username404.snowygui.mixins.* { * ; }")
keep("class fr.username404.snowygui.fabric.** { * ; }")
keep("class fr.username404.snowygui.forge.** { * ; }")
keepattributes(); keepdirectories(); keeppackagenames(); keepparameternames()
adaptclassstrings(); adaptresourcefilecontents()
adaptclassstrings()
dontwarn("fr.username404.**")
dontwarn("java.**") // Needed for the current version of proguard
// Note: dontpreverify() should NOT be used, it will cause errors at runtime
dontoptimize(); dontobfuscate()
useuniqueclassmembernames()
optimizations("method/inlining/*, code/allocation/variable, class/merging/vertical, code/removal/advanced, code/simplification/branch, code/merging")
optimizationpasses(4)
overloadaggressively()
}
if (this@subprojects.name != "common") build.get().finalizedBy(shrinkJar)
}