score:0

I have a public repository of an SBT plugin that manages to pass jars to proguard. It doesn't use the proguard plugin but the code might help you figure how to gather dependencies.

https://github.com/tlazaro/xsbt-plugin-deployer/blob/master/src/main/scala/Deployer.scala

Look for:

private def getDepsJars(project: ProjectRef, bs: BuildStructure) = forAllProjects(project, bs) {p =>
    artifactPath in Compile in packageBin in p get bs.data
  }

That might give you a way to get started. It gathers every needed jar which is what you usually want, not just the unmanaged.

Alternatively you can just use this plugin and maybe collaborate. The code is a bit sloppy, it not intended to be released yet. The plugin does some other neat stuff like compressing everything with pack200 into a jar and having a custom ClassLoader that loads the compressed classes from there in runtime.

score:0

adamw/xsbt-proguard-plugin, which is the successor of siasia/xsbt-proguard-plugin seems to have the very option:

By default Proguard will be instructed to include everything except classes from the Java runtime. To treat additional libraries as external (i.e. to add them to the list of -libraryjars passed to Proguard), do the following. Here comes the example how to select a module named "httpclient" from the library dependencies:

proguardLibraryJars <++= (update) map (_.select(module = moduleFilter(name = "httpclient")))

Related Query

More Query from same tag