xsbt-proguard-plugin – taking over, new release

I recently took over the maintenance of xsbt-proguard-plugin from siasia. The plugin lets you create single “fat” jars from your project, using the Proguard library.

Some of the most important changes:

  • the group id of the plugin is now org.scala-sbt; the plugin is hosted on sbt’s Ivy repository
  • proguarding projects with multiple subprojects (modules) now works as expected
  • supporting sbt 0.12 (only)
  • updating Proguard to 4.8

To use the plugin, add to project/plugins.sbt:

1
2
3
resolvers += Resolver.url("sbt-plugin-snapshots", url("http://repo.scala-sbt.org/scalasbt/sbt-plugin-snapshots/"))(Resolver.ivyStylePatterns)
 
addSbtPlugin("org.scala-sbt" % "xsbt-proguard-plugin" % "0.1.3-SNAPSHOT")

So far I only deployed a snapshot version (0.1.3-SNAPSHOT). If there won’t be any bug reports, or when the bug reports get fixed, I’ll do a release of a normal version soon.

Please test!

Adam

  • http://twitter.com/ggajos Grzegorz Gajos

    For single jar packaging I’m using (“com.eed3si9n” % “sbt-assembly” % “0.8.6”) but I try to give a shot on this. When I try to package using this plugin build I end up with
    [error] (*:proguard) java.io.IOException: The output jar is empty. Did you specify the proper ‘-keep’ options?
    Do you have an idea what could go wrong?

  • http://www.warski.org/ Adam Warski

    sbt-assembly is great, but the main use-case for proguard is when you really want to keep the jar size down, stripping any unused classes, methods, etc.

    As to the error, do you have a main class specified? Do you have any -keep options in the proguard opts?