# mkdir
output/plugin
output/stubs
output/classes
output/sources

# kotlinc
-opt-in org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
-opt-in org.jetbrains.kotlin.extensions.internal.InternalNonStableExtensionPoints
-cp %KOTLIN_STDLIB%:%KOTLIN_COMPILER%
-d output/plugin
plugin/Plugin.kt

# copy
plugin/META-INF/services/org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar
output/plugin/META-INF/services/org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar

# kapt
-language-version 1.9
-Kapt-mode=stubs
-Kapt-stubs=output/stubs
-Kapt-classes=output/classes
-Kapt-sources=output/sources
-Kapt-classpath=.
-d output/classes
-Xplugin=output/plugin
Test.kt

# kotlinc
-language-version 1.9
-d output/classes
Test.kt

# java
-cp output/classes:%KOTLIN_STDLIB%
test.TestKt

# after
OK
