Skip to content

Commit

Permalink
#57 potentially working proguard setup, reduced size by ~75% (main co…
Browse files Browse the repository at this point in the history
…de is only 3MB but nearly 40MB are the scala library and dependencies) 😢
  • Loading branch information
tobyweston committed Apr 15, 2018
1 parent d66f94a commit c34590b
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions proguard.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,13 @@ proguardOptions in Proguard ++= Seq(
"-dontwarn",
"-ignorewarnings",
"-dontobfuscate",
// "-dontoptimize",
"-dontoptimize",
"-printusage unused-code.txt",
"-printconfiguration proguard.conf",
"""
-keep public class bad.robot.** {
*;
}
-keepclassmembers class * {
** MODULE$;
}
"""
"-keep class bad.robot.** { *; }",
"-keep class scala.Symbol { *; }",
"-keep enum ** { *; }",
"-keepclassmembers class * { ** MODULE$; }"
)

proguardOptions in Proguard += ProguardOptions.keepMain("bad.robot.temperature.Main")
Expand All @@ -29,8 +24,9 @@ javaOptions in(Proguard, proguard) := Seq("-Xmx2G") // avoids out of memor

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 _ => None
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
}
}

Expand Down

0 comments on commit c34590b

Please sign in to comment.