-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathproguard.sbt
43 lines (37 loc) · 1.7 KB
/
proguard.sbt
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
37
38
39
40
41
42
43
enablePlugins(SbtProguard)
proguardOptions in Proguard ++= Seq(
"-dontnote",
"-dontwarn",
"-ignorewarnings",
"-dontobfuscate",
"-dontoptimize",
"-printusage unused-code.txt",
"-printconfiguration proguard.conf",
"-keep class bad.robot.** { *; }",
"-keep class org.apache.logging.** { *; }",
"-keep class org.slf4j.** { *; }",
"-keep class scala.collection.** { *; }", // the TrieMap (MapLike) will disappear without this
"-keep class org.http4s.** { *; }", // no connections/logs show up without this
// "-keep class cats.** { *; }",
// "-keep class shapeless.** { *; }",
// "-keep class scalaz.** { *; }",
// "-keep class fs2.io.** { *; }",
// "-keep class org.rrd4j.** { *; }",
// "-keep class io.circe.** { *; }",
// "-keep class scala.** { *; }",
// "-keep class ** { *; }",
"-keep class scala.Symbol { *; }",
"-keep enum ** { *; }",
"-keepclassmembers class * { ** MODULE$; }"
)
proguardOptions in Proguard += ProguardOptions.keepMain("bad.robot.temperature.Main")
proguardInputs in Proguard := (dependencyClasspath in Compile).value.files
proguardFilteredInputs in Proguard ++= ProguardOptions.noFilter((packageBin in Compile).value)
javaOptions in(Proguard, proguard) := Seq("-Xmx2G") // avoids out of memory (https://github.com/sbt/sbt-proguard/issues/3)
proguardInputFilter in Proguard := { file =>
file.name match {
case "log4j-api-2.11.0.jar" => Some("!META-INF/**") // https://sourceforge.net/p/proguard/bugs/665/
case jar if jar.contains(name.value) => None // leave temperature-machine alone
case _ => Some("!META-INF/MANIFEST.MF") // avoid proguard merge conflicts
}
}