Proguard (optimizatin & shrinking only) no obfuscation :D

This commit is contained in:
Daniel Mills 2021-08-02 19:50:56 -04:00
parent 160bdf5472
commit 8c6c1b3ccc
2 changed files with 52 additions and 19 deletions

View File

@ -1,14 +1,3 @@
plugins {
id 'java'
id 'io.freefair.lombok' version '5.2.1'
id "com.github.johnrengelman.shadow" version "7.0.0"
}
group 'com.volmit.iris'
version '1.5.18'
def apiVersion = '1.17'
def name = 'Iris'
def main = 'com.volmit.iris.Iris'
/*
* Iris is a World Generator for Minecraft Bukkit Servers
@ -28,6 +17,28 @@ def main = 'com.volmit.iris.Iris'
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.1.0'
}
}
plugins {
id 'java'
id 'io.freefair.lombok' version '5.2.1'
id "com.github.johnrengelman.shadow" version "7.0.0"
}
group 'com.volmit.iris'
version '1.5.18'
def apiVersion = '1.17'
def name = 'Iris'
def main = 'com.volmit.iris.Iris'
// ADD YOURSELF AS A NEW LINE IF YOU WANT YOUR OWN BUILD TASK GENERATED
// ==============================================================
registerCustomOutputTask('Cyberpwn', 'C://Users/cyberpwn/Documents/development/server/plugins');
@ -37,6 +48,29 @@ registerCustomOutputTask('Coco', 'C:/Users/sjoer/Documents/MCServer/plugins');
registerCustomOutputTask('Strange', 'D://Servers/1.17 Test Server/plugins');
// ==============================================================
def dependsDir = "${buildDir}/libs/dependencies/"
task copyDepends(type: Copy) {
dependsOn(":shadowJar")
group('proguard')
from configurations.default
into "${dependsDir}"
}
task proguard(type: proguard.gradle.ProGuardTask) {
dependsOn(":copyDepends")
group('proguard')
configuration 'proguard.pro'
injars("${buildDir}/libs/" + name + "-" + version + "-all.jar")
outjars("${buildDir}/production/" + name + "/" + version + "/" + name + "-" + version + ".jar")
libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
libraryjars "${System.getProperty('java.home')}/jmods/"
libraryjars "${dependsDir}"
dontobfuscate()
dontwarn()
verbose()
}
def registerCustomOutputTask(name, path) {
tasks.register('build' + name, Copy) {
group('development')
@ -75,13 +109,6 @@ shadowJar
{
append("plugin.yml")
minimize()
dependencies {
include(dependency('org.zeroturnaround:zt-zip:1.14'))
include(dependency('com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.4.2'))
include(dependency('io.papermc:paperlib:1.0.5'))
include(dependency('com.dfsek:Paralithic:0.4.0'))
include(dependency('org.ow2.asm:asm:9.0'))
}
}
manifest()
@ -100,7 +127,6 @@ dependencies {
implementation 'org.bukkit.craftbukkit:1.16.3:1.16.3'
implementation 'org.bukkit.craftbukkit:1.16.1:1.16.1'
implementation 'com.sk89q.worldedit:worldedit-bukkit:7.2.0-SNAPSHOT'
implementation 'io.lumine.xikage:MythicMobs:4.9.1'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'me.clip:placeholderapi:2.10.10'
implementation 'org.ow2.asm:asm:9.0'

7
proguard.pro vendored Normal file
View File

@ -0,0 +1,7 @@
-keep public class * {
public * ;
}
-keepclassmembers public class * {
public * ;
}