-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathproguard.gradle
36 lines (29 loc) · 979 Bytes
/
proguard.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
buildscript {
def proguardVersion = "6.0.3"
dependencies {
classpath("net.sf.proguard:proguard-gradle:$proguardVersion")
}
repositories {
mavenCentral()
}
}
task minimizeJar(type: proguard.gradle.ProGuardTask, dependsOn: shadowJar) {
// We will minimize result of shadowJar task
def jarFile = (tasks.shadowJar as Jar).archivePath
// Specify the input jars and output jars
injars(jarFile.path)
outjars("${jarFile.parent}/${jarFile.name.replace("-all", ".min")}")
// Don't obfuscate/minimize calls of provided libraries
libraryjars("${System.properties.'java.home'}/lib/rt.jar")
def providedLibs = project.configurations.compileOnly
for (lib in providedLibs) {
libraryjars(lib.path)
}
// More logs
verbose
// Proguard warnings will not stop build
ignorewarnings
dontwarn
// Import static configurations
configuration("proguard/proguard-rules.pro")
}