How can you strip java
or scala
annotations programmatically?
One of the deliverables for my current project is my code, plus whatever dependencies my code relies on, as an uber-jar. We're building an SDK therefore any of the included dependencies need to be renamed as to not interfere with the SDK client's dependencies (meaning if we're using apache commons version X, and they're using version Y, there aren't any conflicts). We used sbt-assembly
to rename the packages our code relies on. For example org.apache.* -> com.mycompany.org.apache.*
Our project is largely written in scala
and we're using sbt
to build. Recently I determined that shading causes problems with the ScalaSignature
annotation. This in turn causes build problems when the uber-jar is used in the client's project.
I have determined that removing ScalaSignature
resolves the problem. I used ProGuard
to do this, however that tool is overkill for what we are trying to achieve. I'm just curious if anyone out there has found a tool that can strip specified annotations. Or even better, a tool that will rename the packages while preserving ScalaSignature
in a way that scalac
is happy with.