I'm pretty sure the answer is "no", but is it poss...
# compiler
r
I'm pretty sure the answer is "no", but is it possible to have a compiler plugin also apply to dependencies (including Java ones)? Presumably the compiler would need to parse the JVM bytecode or kilb into IR, then apply the plugin.
🚫 1
j
For targeting the JVM, no. The
.jar
of a dependency is present as part of compilation, but that same
.jar
is then put on the classpath of
java
when running the application. It's not part of the compilation unit such that you could modify it. You would have to do that as a post-processing step using something like ASM or the new JDK ClassFile API over the entirety of your application's class files. There's also tools like ProGuard or R8 which are open source and in which you could write a transform step. R8 has an IR that's much higher-level than processing raw bytecode.
r
R8 has an IR that's much higher-level than processing raw bytecode.
TIL, that sounds promising. I'm hoping to use a condenser from lyden eventually