MpApt icon indicating copy to clipboard operation
MpApt copied to clipboard

Help wanted

Open Foso opened this issue 4 years ago • 2 comments

Hi there are some things i need help with:

  1. I need a better way to detect when the last class of a module/platform was read and the processing is finished, right now i'm relying on fact that the classes NativeIrGenerationExtension, DebugLogClassGenerationInterceptor and JsSyntheticTranslateExtensionExt are called after the SyntheticResolveExtensionImpl class. I would like to find to have solution that doesn't need these extra classes.

  2. I would like to have a solution where you don't have to manually register every extension classes and just pass the instance of MpAptProject in only one class and this class will register all needed extension classes.

Maybe something like this:

val processor = MpAptTestProcessor(configuration)
val mpapt = MpAptProject(processor)
Mpapt.init(mpapt)

My problem is that i need the project file for the "Register"-classes (I don't know what's the correct name for this classes "IrGenerationExtension.registerExtension()" ) and the kotlin-compiler is using com.intellij.mock.MockProject but the kotlin-compiler-embeddable is using org.jetbrains.kotlin.com.intellij.mock.MockProject and they both have the "Register"-classes with the same name but they need the different project objects. Right now i'm using only the kotlin-compiler-embeddable as dependency in MpApt

  1. Testing I don't know what's the best way to write tests for this library

Foso avatar Sep 03 '19 19:09 Foso

  1. Testing There are compile testing libraries out there, for example: https://github.com/tschuchortdev/kotlin-compile-testing

That test annotation processors by invoking compilation through K2JVMCompiler class, and it accepts plugin options. So it should be possible to use a simple unit test that checks JS/JVM through the usual code path

ATizik avatar Sep 05 '19 14:09 ATizik

If you have questions regarding the compile testing library, feel free to contact me. I'm also working on a library somewhat similar to this one, but it will fill a different role since I'm targeting the JVM only.

tschuchortdev avatar Sep 09 '19 14:09 tschuchortdev