Putting everything into one project and avoiding closed source might solve the problem, but not necessarily.
The big question in this case is the one of dependencies.
You have no dependencies you want to transform.
You can use single or multi-project setup and your compiler plugin.
You have only open source Kotlin dependencies.
Download the source code, compile them with your plugin active and use the locally compiled code in your project.
This works. However, it will be harder and harder to maintain in the future as you have to recompile those dependencies every time they change. Not to mention you might have to recompile the whole dependency tree… it’s a mess.
You have only Kotlin dependencies (might be closed source) and all your dependencies are compiled with the IR compiler.
You might be able to solve this in a general way, but it will be difficult. It also have the problem of maintenance and deeper dependencies as in Case 2.
You cannot use the Kotlin compiler to solve this problem.
I would choose case 1 and avoid dependencies I want to transform.
Also, there is one more thing to mention here.
init runs only when you create an instance of that class. For objects it is even more complex as they may be initialised lazily. So, for example you cannot count on the
init function to build up an object registry because anything you don’t touch won’t be in that registry.
It might be possible to solve your problem without a compiler plugin. It might be even better to do it without a compiler plugin.