Hi. I created a kotlin compiler plugin which adds ...
# compiler
g
Hi. I created a kotlin compiler plugin which adds kotlinx.serialization.Serializable annotation to specific classes automatically. However even if I see in the built decompiled class file the added annotation, the whole serializer code for that class of the kotlinx-serialization plugin is not generated. So is my plugin executed after the kotlinx-serialization plugin? How can this be fixed? I've implemented it as ClassBuilderInterceptorExtension with DelegatingClassBuilder if it's important
👀 3
b
AFAIK there is no way to define order now, feel free to create an issue. cc @Roman Artemev [JB]
👌 1
g
On kotlinx.serialization github project or JB youtrack?
l
I'd think kotl.in/issue
âž• 1
b
y
Can't you define the order by registering your Extension as the first one? I believe Anvil uses that because it needs to run before other plugins.
Found it:
Copy code
private fun AnalysisHandlerExtension.Companion.registerExtensionFirst(
    project: MockProject,
    extension: AnalysisHandlerExtension
  ) {
    project.extensionArea
      .getExtensionPoint(AnalysisHandlerExtension.extensionPointName)
      .registerExtension(extension, LoadingOrder.FIRST, project)
  }
I believe a generic implementation of this can be quite easily made.