Closed hrj closed 13 years ago
you cannot specify a config file, but inline the config by overriding proguardOption
in your project.
it guess the ability to specify a file would be a nice feature to have.
Here's an example which I used to get rid of a boatload of proguard spew/helpful messages. In the simplest case, just jam this code or similar in your sbt project definition class.
val toKeep = List(
"scala.Function1",
"scala.Function2",
"scala.Tuple2",
"org.xml.sax.EntityResolver",
...more class names here...
)
val keepOptions = toKeep.map { "-keep public class " + _ }
val dontNote = List(
// Proguard message: "Note: com.admob.android.ads.analytics.InstallReceiver: can't find dynamically referenced class com.google.android.apps.analytics.AnalyticsReceiver"
"com.admob.android.ads.analytics.InstallReceiver",
// Proguard message: "Note: scala.Enumeration accesses a field 'MODULE$' dynamically"
"scala.Enumeration"
)
val dontNoteOptions = dontNote.map { "-dontnote " + _ }
override def proguardOption = (super.proguardOption ++ keepOptions ++ dontNoteOptions) mkString " "
I was kicking around the idea of writing some wrappers for proguard config along these lines.
see GH-57
I am not well versed with SBT plugins, or even with SBT for that matter.
How can I instruct the proguard task to use an external configuration file?
From a cursory glance it looks like the proguard task has all the command line parameters specified in the task definition itself.