So here is what I have found out from reading the ...
# compiler
k
So here is what I have found out from reading the sources in the past two days: Generally speaking it is not possible to simply create a synthetic class outside the bounds of existing class, at least there is no officially endorsed way of doing so. However there are several ways to do it, if you really need to. The first way is to obtain the
CompilerConfiguration
using the
CompilerConfigurationExtension
in order to get hold of the output directory. You can then write your own files using the
BinaryClassWriter
. This way is pretty safe and should be stable across future releases. The second method would be to use either the
AnalysisHandlerExtension
or the
CollectAdditionalSourcesExtension
to access and modify the list of source files. The list of sources is leaking and can simply be casted into a
MutableList
. While this can be pretty useful, it is not recommendable, because this will probably be fixed in the future.
👍 2
r
thanks Iven, useful info