Using the information available at http://confluence.jetbrains.com/display/IDEADEV/External+Builder+API+and+Plugins I'm trying to writing a small plugin to instrument the .class files after compilation.
Following the information on the above page I've:
- put the code and META-INF in the jps-plugin dir
- created the org.jetbrains.jps.incremental.BuilderService file in META-INF/services and put the fqcn in it
- subclassed BuilderService with
-- createModuleLevelBuilders() returning a List containing an instance of my plugin as only element
-- getTargetTypes() returning a List containing JavaModuleBuildTargetType.ALL_TYPES
-- createBuilders() just calls super.createBuilders()
- the plugin extends ClassProcessingBuilder (using BuilderCategory.CLASS_INSTRUMENTER as category)
I used https://github.com/JetBrains/intellij-scala as an example but must be doing some differently I guess.
Maybe I'm missing something wrong here because when I launch "debugging project" from the plugin project I see my plugin (i.e. it is listed) but the plugin it is not working. So I started wondering whether an external builder can be debugged this way and more importantly how to go about it correctly. Any pointer would be much appreciated.