Hi everyone! I would like to track which external ...
# compiler
o
Hi everyone! I would like to track which external dependent classes were used during compilation of some Kotlin files. Output could be similar to jdeps java tool. Is this reasonable to try to achieve this with a Kotlin Compiler Plugin? If so, what would be the best approach? Would we use a class visitor for the compiled classes and extract all used/dependent external classes- or is there a better approach? Thanks in advance!
j
There's some incremental build data stored in caches-jvm. It has some (source file, symbols/classes) mappings that might be what you're looking for?
o
Thanks for the input, Justin. I am afraid I can't really rely on the JVM cache for this, I am hoping for a more explicit and deterministic way to get the info. Like an extension point, or interface that would somehow expose what's being loaded from the JAR in the classpath. If this is not possible, maybe providing a wrapper around the file system to track file usage?
j
Hey @Olivier Notteghem - I'm actually trying to do the same thing for the Bazel Kotlin rules... have you any leads on the right APIs to use?