Hey, as a followup to my message above: If you are...
# arrow-meta
s
Hey, as a followup to my message above: If you are generating new files in the
build
folder (and mark them in gradle) instead of appending to already existing ones, debug seems to work out of the box I have implemented POC to entertain the idea - https://github.com/ShikaSD/kotlin-compiler-di/commit/b7c7f77f5b0b1436e7107421f21fcb6f1910cf88
h
Nice! What are the advantages compared to the extension bridge approach with annotation processors? :)
s
For one, you have much more flexibility, as you are not relying on annotations only, but can gather information using everything available to compiler. Another benefit compared to kapt is speed: everything is done in a single compiler launch.
h
Ah, okay. But an annotation processor can also work on things without annotation, or get surrounding declarations etc. A custom compiler plugin can just be used in a build, does it? And since it uses generated sources dir, autocompletion in the ide works instantly, right?
Oh i am sorry, i hope my questions don't sound offensive, I'm very interested in this topic :)
s
No worries (I am not very familiar with annotation processors myself :D) You are completely right, if you configure it in the way I did it works straight away. I suspect that compiler has a bit more info about source code, but not quite sure. I have also managed to make it work across different modules which was a problem using kapt.
h
Ah, cross module would be interesting, what are the differences here? What information does the compiler provide? With apt you get the ast around the thing that you want to process
s
You can check the thing arrow do in this meta compiler, adding support for higher kinds and implicits resolution. They use a lot of compiler capabilities there :)