Consider the common case of using a specific versioned jar to implement a method, but not exposing any types from that jar in the public or protected API (only in method signatures of private methods).
Now what I want is an automatic compile-time linking of this code by name-mangling the original package name and replacing it in the generated code within SBT (again: I want to add a plugin to SBT or a setting in the build.sbt that does this on every sbt compile
).
The goal of this is to avoid classpath errors with multiple possibly incompatible versions of a classes with the same package/class name. Note: in the situation I describe above, inlining or this name-mangling should always work and allow one to side-step version-hell (at the cost of larger jars).
This sounds like the sort of thing that ProGuard would be able to do. There is an SBT ProGuard plugin but it doesn't appear to be actively maintained.
If I were tackling this problem, personally speaking I would look to a custom classloader for a solution rather than name mangling.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With