Has anyone ever used proguard with http4k? I have...
# http4k
a
Has anyone ever used proguard with http4k? I have shrinking and optimizing working, but obfuscating causes issues with the
static
router. It calls the
loadMetaResource
function, which looks up a resource in the
META-INF
folder based on the calling class name. Unfortunately, since the class name is obfuscated and the resource paths are not, the
mime.types
file cannot be found.
I suspect (but don't know) that if the
mime.types
wasn't put in
META-INF
, the path structure would have been obfuscated consistently with the class file, and this issue wouldn't occur. Is there a particular reason for putting
mime.types
in
META-INF
?
d
It's been a while... I can't remember why it's there (my knowledge of the meta inf folder is patchy)
But that is also where the webjars put their files so it's not just static resources which would be affected
a
I'm not convinced there's any need to obfuscate library classes anyway, so maybe I can add an exception
j
So... there are lots of options in proguard to rename things based on the obfuscation, or to get the output mapping file and rename resources based on that etc. It is a pretty deep rabbit hole. If there is no need to rename things it does make it easier.
🤔 1