Since it might be useful to others using ProGuard with Scala, here is what I
did to get back the 300kB. It isn't really 2.8 specific- it is just some more
aggressive settings that I used to compensate for the increase in size from
2.8.
ProGuard removes annotations in the obfuscation step. I don't want my
classes/members to be renamed, but I do want to remove annotations and most
attributes, including the Scala signature annotation.
I previously completely disabled obfuscation:
-dontobfuscate
Instead, I now use:
-keep,allowoptimization,allowshrinking class * { *; }",
-keepattributes SourceFile,LineNumberTable
This prevents renaming but still strips attributes/annotations. If you need
to preserve certain annotations, you can append them to -keepattributes.
I also needed to enable optimization to reduce it another 100kB. I dropped -
dontoptimize and added:
-optimizationpasses 2
-optimizations !code/allocation/variable
More passes increase processing time, but you might get a larger size decrease
or a performance increase. Three passes did not reduce the size any more than
two did for me. The second line disables an optimization that did not work
for me (it gave a runtime error).
-Mark
--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To post to this group, send email to simple-b...@googlegroups.com.
To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.
[snip]
This info is highly useful. Since I'm also writing some command-line Scala
programs, I can easily see myself using this information very soon.
Mark, any chance you might consider throwing it up on the SBT wiki? I know
it's not SBT-specific, but the wiki seems like a reasonable place for now.
If not, I'll just bookmark this thread. ;-)
Thanks for writing this up.
--
-Brian
Brian Clapper, http://www.clapper.org/bmc/
I am astounded ... at the wonderful power you have developed -- and terrified
at the thought that so much hideous and bad music may be put on record
forever.
-- Arthur Sullivan, on seeing a demonstration of Edison's new
talking machine in 1888
Sure. This is only one part of configuring ProGuard with Scala of course.
http://code.google.com/p/simple-build-tool/wiki/ProGuard
-Mark