I'm playing around with a couple ideas I had for dynamic program analysis, and looking to write a plugin.
1)I have a bytecode rewriter, and I want it to sit IDEAs compilation path. That is, after IDEA compiles a .class file, it should then mutate that file in-place, using my bytecode rewriter. It looks like the Compiler API should allow this (ClassInstrumentingCompiler?), but I honestly can't figure out how. Any pointers or code examples would be greatly appreciated.
2)When the rewritten code is run (using any command-line run configuration), it will communicate with a small runtime library I've written. This runtime library needs to be automatically added to the classpath, and a configuration string needs to be passed to it as a command-line system property. Both of these should happen without the user being aware of it. Again, any pointers or examples would be great.
(No, I won't say what I'm doing with the instrumentation. Trust me, it'll be wicked cool if it works.)